Mention GZIP_PROG in INSTALL.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
ffc65bee
DA
12013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
4 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
5 (get_visually_first_element, move_it_vertically_backward): Ajust users.
6 * bidi.c (bidi_find_paragraph_start): Likewise.
7 * indent.c (vmotion): Likewise.
8
70743157
PE
92013-03-05 Paul Eggert <eggert@cs.ucla.edu>
10
11 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
12 * filelock.c: Include <c-ctype.h>.
13 (MAX_LFINFO): New top-level constant.
14 (lock_info_type): Remove members pid, boot_time. Add members at,
15 dot, colon. Change user member to be the entire buffer, not a
16 pointer. This allows us to handle the case where a foreign
17 pid or boot time exceeds the local range. All uses changed.
18 (LINKS_MIGHT_NOT_WORK): New constant.
19 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
20 (defined_WINDOWSNT): Remove.
21 (MAKE_LOCK_NAME, file_in_lock_file_name):
22 Always use .#FILE (not .#-FILE) for the file lock,
23 even if it is a regular file.
24 (rename_lock_file): New function.
25 (create_lock_file): Use it.
26 (create_lock_file, read_lock_data):
27 Prefer a symbolic link for the lock file, falling back on a
28 regular file if symlinks don't work. Do not try to create
29 symlinks on MS-Windows, due to security hassles. Stick with
30 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
31 link, rename, unlink, mkstemp) when creating locks, as a GNUish
32 host may be using a Windowsish file system, and cannot use
33 MS-Windows-only system calls. Fall back on mktemp if mkstemp
34 doesn't work. Don't fail merely because of a symlink-contents
35 length limit in the current file system; fall back on regular
36 files. Increase the symlink contents length limit to 8 KiB, this
37 should be big enough for any real use and doesn't crunch the
38 stack.
39 (create_lock_file, lock_file_1, read_lock_data):
40 Simplify allocation of lock file buffers now that they fit in 8 KiB.
41 (lock_file_1): Return error number, not bool. All callers changed.
42 (ELOOP): New macro, if not already defined.
43 (read_lock_data): Return size of lock file contents, not Lisp object.
44 All callers changed. Handle a race condition if some other process
45 replaces a regular-file lock with a symlink lock or vice versa,
46 while we're trying to read the lock.
47 (current_lock_owner): Parse contents more carefully, to help avoid
48 confusing a regular-file lock with some other application's use
49 of the file. Check for lock file contents being too long, or
50 not parsing correctly.
51 (current_lock_owner, lock_file):
52 Allow foreign pid and boot times that exceed the local range.
53 (current_lock_owner, lock_if_free, lock_file):
54 Simplify allocation of lock file contents.
55 * w32.c (sys_rename_replace): New function, containing most of
56 the contents of the old sys_rename.
57 (sys_rename): Use it.
58 (fchmod): New dummy function.
59 * w32.h (sys_rename_replace, fchmod): New decls.
60
05e193f1
EZ
612013-03-05 Eli Zaretskii <eliz@gnu.org>
62
63 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
64 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
65 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
66 <dmantipov@yandex.ru>.
67
725eb027
PE
682013-03-05 Paul Eggert <eggert@cs.ucla.edu>
69
a318f811
PE
70 Fix a build failure on OpenBSD 4.x and MirBSD.
71 * sysdep.c (KERN_PROC, kinfo_proc)
72 [BSD_SYSTEM && (!KERN_PROC || __MirBSD__)]:
73 Define to KERN_PROC2 and kinfo_proc2, for OpenBSD 4.9 and MirBSD.
725eb027
PE
74 list-system-processes still returns nil, but at least it doesn't crash.
75 Problem reported by Nelson H. F. Beebe in
76 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>.
77
3bfc46eb
DA
782013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
79
80 * composite.c (get_composition_id, fill_gstring_header):
81 Use make_uninit_vector where appropriate.
82 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
83 * xselect.c (clean_local_selection_data): Likewise.
84
84ac6f9d
PE
852013-03-04 Paul Eggert <eggert@cs.ucla.edu>
86
87 Fix misuse of ImageMagick that caused core dump (Bug#13846).
88 * image.c (imagemagick_load_image): Calculate height and width
89 after flattening the image, not before.
90
42926ec8
DA
912013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
92
93 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
94 * ftfont.c (ftfont_shape_by_flt): Likewise.
95 * w32uniscribe.c (uniscribe_shape): Likewise.
96
b5029e23
PE
972013-03-02 Paul Eggert <eggert@cs.ucla.edu>
98
99 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
100 The old approach, which fell back on DIR/.#FILE.0 through
101 DIR/.#FILE.9, had race conditions that could not be easily fixed.
102 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
103 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
104 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
105 because the locking mechanism was never reliable in that case).
106 This patch fixes this and other bugs discovered by a code
107 inspection that was prompted by
108 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
109 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
110 to avoid interoperability problems between the MS-Windows and
111 non-MS-Windows implementations. MS-Windows and non-MS-Windows
112 instances of Emacs now ignore each others' locks.
113 * filelock.c (defined_WINDOWSNT): New constant.
114 (MAKE_LOCK_NAME, fill_in_lock_file_name):
115 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
116 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
117 regular files on MS-Windows hosts.
118 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
119 Use SAFE_ALLOCA to avoid problems with long file names.
120 (MAX_LFINFO): Now a local constant, not a global macro.
121 (IS_LOCK_FILE): Remove.
122 (lock_file_1): Don't inspect errno if symlink call succeeds;
123 that's not portable.
124 (lock_file): Document that this function can return if lock
125 creation fails.
2db41375 126 (lock_file): Don't access freed storage.
b5029e23 127
b270d116
AS
1282013-03-02 Andreas Schwab <schwab@linux-m68k.org>
129
130 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
131
81c23309
PE
1322013-03-02 Paul Eggert <eggert@cs.ucla.edu>
133
134 * textprop.c: Use bool for booleans.
135 (validate_interval_range, Fadd_text_properties)
136 (Fremove_text_properties): Prefer bool to int when either works.
137
18f2ac09
EZ
1382013-03-02 Eli Zaretskii <eliz@gnu.org>
139
140 * textprop.c (Fadd_text_properties, Fremove_text_properties): If
141 the interval tree changes as a side effect of calling
142 modify_region, re-do processing starting from the call to
143 validate_interval_range. (Bug#13743)
144
929aeac6 1452013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
146
147 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
148 (Bug#13546).
149
531e70ec
EZ
1502013-02-27 Eli Zaretskii <eliz@gnu.org>
151
152 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
153 _SH_DENYRW flag, instead of emacs_open, to deny any other process
154 access to the lock file until it is written and closed.
155 (Bug#13807)
156
6e65b9cc
PE
1572013-02-27 Paul Eggert <eggert@cs.ucla.edu>
158
159 * callint.c (Qcall_interactively):
160 * macros.c (Qexecute_kbd_macro):
161 Now static.
162
3b166f09
BG
1632013-02-26 Bastien Guerry <bzg@gnu.org>
164
165 * window.c (Frecenter): Tiny docstring enhancement.
166
ecc0fdd4
PE
1672013-02-26 Paul Eggert <eggert@cs.ucla.edu>
168
169 Minor textprop integer cleanup.
170 * intervals.h, textprop.c (add_text_properties_from_list):
171 Return void, not int, since nobody uses the return value.
172 * textprop.c (validate_plist, add_properties, remove_properties)
173 (Fadd_text_properties):
174 Don't assume list length fits in int.
175 (interval_has_all_properties, interval_has_some_properties)
176 (interval_has_some_properties_list, add_properties, remove_properties)
177 (Fadd_text_properties, Fremove_text_properties)
178 (Fremove_list_of_text_properties, text_property_stickiness):
179 Use bool for booleans.
180 (Fadd_text_properties, Fremove_text_properties):
181 (Fremove_list_of_text_properties):
182 Reindent do-while as per GNU style.
183
0248b0d7
EZ
1842013-02-25 Eli Zaretskii <eliz@gnu.org>
185
343a2aef
EZ
186 Implement CLASH_DETECTION for MS-Windows.
187
188 * filelock.c [WINDOWSNT]: Include w32.h.
189 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
190 function of that name. Up-case the macro arguments.
191 (IS_LOCK_FILE): New macro.
192 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
193 (create_lock_file): New function, with body extracted from
194 lock_file_1.
195 [WINDOWSNT]: Implement lock files by writing a regular file with
196 the lock information as its contents.
197 (read_lock_data): New function, on Posix platforms just calls
198 emacs_readlinkat.
199 [WINDOWSNT]: Read the lock info from the file.
200 (current_lock_owner): Call read_lock_data instead of calling
201 emacs_readlinkat directly.
202 (lock_file) [WINDOWSNT]: Run the file name through
203 dostounix_filename.
204
205 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
206 just check if the process by that PID exists.
207
208 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
209 also present, as doing so will fail to error out if the file
210 already exists.
211
212 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
213
0248b0d7
EZ
214 * textprop.c (Fadd_text_properties, Fremove_text_properties)
215 (Fremove_list_of_text_properties): Skip all of the intervals in
216 the region between START and END that already have resp. don't
217 have the requested properties, not just the first one. Add
218 assertions that the loop afterwards always modifies the
219 properties. (Bug#13743)
220
b5071fc7
SM
2212013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
222
223 * callint.c (Fcall_interactively): Use the right lexical environment
224 for `interactive' specs (bug#13811).
225 * eval.c (Feval): Accept a lexical environment.
226
1ddc2bd6
PE
2272013-02-25 Paul Eggert <eggert@cs.ucla.edu>
228
229 Simplify data_start configuration (Bug#13783).
230 This is a followon simplification to the fix for Bug#13650.
231 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
232 (START_FILES): Remove. All uses removed.
233 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
234 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
235 (buildobj.h): Use it.
236 ($(ALLOBJS)): Depend on globals.h.
237 (temacs$(EXEEXT)): Use $(ALLOBJS).
238 * autodeps.mk (ALLOBJS): Move to Makefile.in.
239 * deps.mk (vm-limit.o):
240 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
241 Do not depend on mem-limits.h.
242 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
243 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
244 [__GNUC__ && !ORDINARY_LINK]: Remove.
245 * mem-limits.h, pre-crt0.c: Remove.
246 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
247 * unexcoff.c (etext): New decl.
248 (make_hdr): Use DATA_START instead of start_of_data.
249 * vm-limit.c: Move most of mem-limits.h's contents here.
250 (data_start): New decl. It's OK if this is approximate,
251 so simplify-away some unnecessary exactness.
252 (POINTER): Remove; all uses removed.
253 (data_space_start): Now char *, to avoid casts.
254 (exceeds_lisp_ptr): New function, replacing the old
255 EXCEEDS_LISP_PTR macro. All uses changed.
256 (check_memory_limits): Simplify and remove casts.
257 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
258 (memory_warnings): Use data_start instead of start_of_data.
259
51aa2a8b
AS
2602013-02-24 Andreas Schwab <schwab@linux-m68k.org>
261
262 * xdisp.c (set_message): Only check for debug-on-message if STRING
263 is a string. (Bug#13797)
264
1938d88c
PE
2652013-02-24 Paul Eggert <eggert@cs.ucla.edu>
266
267 Fix regression introduced by July 10 filelock.c patch.
268 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
269 2012-07-10 patch to this file. Reported by Eli Zaretskii in
270 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
271 and diagnosed by Andreas Schwab in
272 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
273
fcee5028
PE
2742013-02-22 Paul Eggert <eggert@cs.ucla.edu>
275
276 Assume C89 or better.
277 * ralloc.c (SIZE, POINTER, NIL):
278 * vm-limit.c (POINTER):
279 Remove, replacing all uses with C89 equivalents. These old
280 symbols were present only for porting to pre-C89 platforms.
281
d78cf5ed
CB
2822013-02-22 Claudio Bley <claudio.bley@gmail.com>
283
284 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
285 This avoids warning messages reported as part of Bug#13546.
286
6bcd97a4
KB
2872013-02-21 Ken Brown <kbrown@cornell.edu>
288
289 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
290
b6c2bfff
SM
2912013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
292
e11dacb5
SM
293 * sheap.c (report_sheap_usage): Prefer message1_nolog.
294
b6c2bfff
SM
295 * keyboard.c (Qcommand_execute): New var.
296 (command_loop_1, read_char): Use it.
297 (Fcommand_execute): Remove, replace by an Elisp implementation.
298 (syms_of_keyboard): Adjust accordingly.
299
d69f1120 3002013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 301
d69f1120
DC
302 * sheap.c (report_sheap_usage): Use message, not message1, so
303 that we don't try to create a buffer while we're in the middle
304 of dumping Emacs. Explain why.
b6c2bfff 305
2a14a4f1 3062013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 307
2a14a4f1
DA
308 * search.c (find_newline): Return byte position in bytepos.
309 Adjust comment.
b6c2bfff
SM
310 (find_next_newline_no_quit, find_before_next_newline):
311 Add bytepos argument.
2a14a4f1
DA
312 * lisp.h (find_newline, find_next_newline_no_quit)
313 (find_before_next_newline): Adjust prototypes.
314 * bidi.c (bidi_find_paragraph_start):
315 * editfns.c (Fconstrain_to_field, Fline_end_position):
316 * indent.c (compute_motion, vmotion):
317 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
318 (get_visually_first_element, move_it_vertically_backward):
319 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
320
872faefb 3212013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
322
323 * w32proc.c (new_child): Avoid leaking handles if the subprocess
324 resources were not orderly released.
325
fd80c659
EZ
3262013-02-17 Eli Zaretskii <eliz@gnu.org>
327
328 * xdisp.c (x_draw_vertical_border): For a window that is neither
329 the leftmost nor the rightmost, redraw both the left and the right
330 vertical borders. (Bug#13723)
331
2f73da9c
SM
3322013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
333
334 * xml.c (init_libxml2_functions):
335 * sound.c (sound_warning):
336 * sheap.c (report_sheap_usage):
337 * process.c (wait_reading_process_output):
338 * msdos.c (XMenuActivate):
339 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
340 * keyboard.c (top_level_1):
341 * editfns.c (Fmessage, Fmessage_box):
342 * callint.c (Fcall_interactively):
343 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
344
fd9547e8
JD
3452013-02-17 Jan Djärv <jan.h.d@swipnet.se>
346
347 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
348 * frame.c (syms_of_frame): ... to here.
349
f277993b
EZ
3502013-02-16 Eli Zaretskii <eliz@gnu.org>
351
c7939585
EZ
352 * w32.c (sys_chown): Remove unused function.
353
cd91fb4b
EZ
354 * w32term.c <input_signal_count>: Declare 'volatile'
355 unconditionally. (Bug#9066)
356
f277993b
EZ
357 * w32.c (set_errno): Reset h_errno and don't set it to any other
358 value. Set errno instead.
359 (check_errno): Reset h_errno.
360 (sys_socket, socket_to_fd, sys_bind, sys_connect)
361 (sys_gethostname, sys_getservbyname, sys_getpeername)
362 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
363 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
364 h_errno.
365 (sys_gethostbyname): Set h_errno only errors detected.
366
e454145b
PE
3672013-02-15 Paul Eggert <eggert@cs.ucla.edu>
368
369 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
370
bcf7fe2a
EZ
3712013-02-15 Eli Zaretskii <eliz@gnu.org>
372
ef9c57e2
EZ
373 * keyboard.c (read_char): Fix calculation of auto-save time out
374 when auto-save-timeout is less than 4. (Bug#13720)
375
ef862e20 376 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 377 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 378
bcf7fe2a
EZ
379 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
380 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
381 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
382 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
383 make sure errno is set to an appropriate value. (Bug#13546)
384 (socket_to_fd): Add assertion against indexing fd_info[] with a
385 value that is out of bounds.
386 (sys_accept): If fd is negative, do not set up the child_process
387 structure for reading.
388
0063fdb1
DA
3892013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
390
391 * composite.c (fill_gstring_header): Remove useless prototype.
392 Break long line.
393 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
394 * print.c (PRINTDECLARE, print_object):
395 * search.c (compile_pattern, fast_looking_at, search_buffer):
396 (simple_search, boyer_moore, Freplace_match):
397 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
398 (get_overlay_arrow_glyph_row, display_mode_element):
399 (decode_mode_spec_coding, message3):
400 * xfaces.c (face_at_string_position): Use bool for booleans.
401 Adjust comments.
402
648e5523 4032013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 404
35b3a27e
PE
405 Fix AIX port (Bug#13650).
406 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
407 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
408 was #undeffed earlier, so it cannot be used as a macro here.
409 Use the constant and not the macro.
35b3a27e 410
648e5523 4112013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 412
0e4e7b74
EZ
413 * w32proc.c (new_child): If no vacant slots are found in
414 child_procs[], make another pass looking for slots whose process
415 has exited or died. (Bug#13546)
416
6e432f0c
EZ
417 * w32.c (sys_pipe): When failing due to file descriptors above
418 MAXDESC, set errno to EMFILE.
419 (_sys_read_ahead): Update cp->status when failing to read serial
420 communications input, so that the status doesn't stay at
421 STATUS_READ_IN_PROGRESS. (Bug#13546)
422
51b3a99c
JD
4232013-02-14 Jan Djärv <jan.h.d@swipnet.se>
424
425 * gtkutil.c (tb_size_cb): New function.
426 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
427
e31560a7
SM
4282013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
429
430 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
431 an event.
432
fe336261
SM
4332013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
434
435 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
436
5a655b9f
DA
4372013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
438
439 * font.c (font_range): Add pos_byte argument. Adjust comment
440 and break long line.
441 * font.h (font_range): Adjust prototype.
442 * composite.c (autocmp_chars): Pass byte position to font_range.
443 Break long line. Remove useless prototype and format comment.
444
1a359750
GM
4452013-02-13 Glenn Morris <rgm@gnu.org>
446
447 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
448
01fcc3a5 4492013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 450
f53f992a
PE
451 Improve AIX port some more (Bug#13650).
452 With this, it should be as good as it was in 23.3, though it's
453 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
454 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
455 * unexaix.c (start_of_text): Remove.
456 (_data, _text): Declare as char[], not int, as AIX manual suggests.
457 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
458 (orig_load_scnptr, orig_data_scnptr):
459 Now off_t, not long, since they are file offsets.
460 (make_hdr): Use _data, not start_of_data ().
461 This is the key part of the fix.
462 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
463 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
464
4458c255
PE
465 * pre-crt0.c (data_start): Initialize to 1.
466 This ports to compilers that optimize the external declaration
467 'int x = 0;' as if it were 'int x;' to shrink the executable.
468
227be86d
PE
469 Improve AIX port (Bug#13650).
470 This doesn't fix the bug, but it makes progress: Emacs builds now.
471 * unexaix.c: Include inttypes.h, stdarg.h.
472 (report_error, report_error_1): Mark as _Noreturn.
473 (report_error): Don't report the wrong errno.
474 (report_error_1): Now varargs. All callers changed.
475 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
476 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
477 (write_ptr): Use %p to print address rather than %lx and a cast
478 to unsigned long. Grow buffer a bit, to be safer.
479
01fcc3a5 4802013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
481
482 * bidi.c (bidi_resolve_neutral): After finding the next
483 non-neutral character, accept NEUTRAL_ON type as well, because
484 directional control characters, such as LRE and RLE, have their
485 type converted to that by bidi_resolve_weak. This avoids aborts
486 when LRE/RLE follows a run of neutrals.
487 (bidi_move_to_visually_next): Assert that return value of
488 bidi_peek_at_next_level is non-negative. Negative values will
489 cause an infloop.
490
83be8524
PE
4912013-02-13 Paul Eggert <eggert@cs.ucla.edu>
492
493 Minor getenv-related fixes.
494 * callproc.c (Fcall_process_region) [!DOS_NT]:
495 Avoid unnecessary duplicate call to getenv.
496 * callproc.c (init_callproc):
497 * dispnew.c (init_display):
498 * sysdep.c (sys_subshell):
499 Omit unnecessary cast of getenv or egetenv.
500
45b2b768
JB
5012013-02-13 Juanma Barranquero <lekktu@gmail.com>
502
503 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
504 Update dependencies.
505
33b49d71
EZ
5062013-02-12 Eli Zaretskii <eliz@gnu.org>
507
508 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
509 marker's position.
510 (display_line): Set w->region_showing to the value of
511 it->region_beg_charpos, not to -1. This fixes redisplay
512 optimization when cursor is moved up after M->. (Bug#13623)
513 (Bug#13626)
c4131562
EZ
514 (try_scrolling): Scroll text up more if point is too close to ZV
515 and inside the scroll margin. This makes sure point is moved
516 outside the scroll margin in these cases.
33b49d71
EZ
517
518 * window.h (struct window): region_showing can no longer be
519 negative.
520
b09a4810
PE
5212013-02-11 Paul Eggert <eggert@cs.ucla.edu>
522
a84b7c53
PE
523 Tune by using memchr and memrchr.
524 * doc.c (Fsnarf_documentation):
525 * fileio.c (Fsubstitute_in_file_name):
526 * search.c (find_newline, scan_newline):
527 * xdisp.c (pos_visible_p, display_count_lines):
528 Use memchr and memrchr rather than scanning byte-by-byte.
529 * search.c (find_newline): Rename from scan_buffer.
530 Omit first arg TARGET, as it's always '\n'. All callers changed.
531
b09a4810
PE
532 Clean up read_key_sequence a tiny bit more.
533 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
534 (read_key_sequence): Remove unused locals.
535
99d0d6dc
SM
5362013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
537
538 Clean up read_key_sequence a bit; reread active keymaps after first event.
539 * keyboard.c (read_char, read_char_x_menu_prompt)
540 (read_char_minibuf_menu_prompt):
541 Replace nmaps+maps with a single `map' arg.
542 (follow_key): Operate on a single map.
543 (active_maps): New function.
544 (test_undefined): Also return true for nil bindings.
545 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
546 a single (composed) keymap. Remember `first_event' to choose the right
547 set of active keymaps. Recompute the set of keymaps after receiving
548 the first event. Remove GOBBLE_FIRST_EVENT.
549 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
550 * keyboard.h (read_char): Update declaration.
551 * lread.c (read_filtered_event): Adjust call to read_char.
552
f5e1b680
EZ
5532013-02-11 Eli Zaretskii <eliz@gnu.org>
554
99d0d6dc
SM
555 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
556 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
557 in the window. (Bug#13675)
558
f74de345
DA
5592013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
560
561 * marker.c (set_marker_internal): If desired position is passed
562 as a marker, avoid call to buf_charpos_to_bytepos.
563 * window.c (Fset_window_point): Omit redundant type checking.
564 (Fset_window_start): Likewise. Format comment.
565 (window_scroll_pixel_based): Use set_marker_restricted_both
566 with character and byte positions obtained from an iterator.
567 (Fset_window_configuration): Use set_marker_restricted_both.
568 * xdisp.c (message_dolog): Likewise.
569
a4ba3963
EZ
5702013-02-10 Eli Zaretskii <eliz@gnu.org>
571
99d0d6dc
SM
572 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
573 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
574 too far. This speeds up some redisplay operations. (Bug#13675)
575
68643cde
DA
5762013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
577
578 * syntax.c (scan_sexps_forward): Fix byte position calculation
579 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
580
7ba11bee
PE
5812013-02-10 Paul Eggert <eggert@cs.ucla.edu>
582
583 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
584 that was not needed.
585
eff1c190
PE
5862013-02-09 Paul Eggert <eggert@cs.ucla.edu>
587
588 Minor hashing refactoring.
589 * fns.c (SXHASH_REDUCE): Move to lisp.h.
590 (sxhash_float): Return EMACS_UINT, for consistency with the other
591 hash functions.
592 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
593 non-static inline function and therefore can't use static vars.
594 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
595 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
596 with the other hash functions.
597
6b48c831
EZ
5982013-02-09 Eli Zaretskii <eliz@gnu.org>
599
4dde2087
EZ
600 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
601 XXXXXX part of the temporary file pattern is not downcased even
602 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 603
8549f9e8
EZ
604 * xdisp.c (decode_mode_spec): Remove handling of %t.
605
6b48c831
EZ
606 * msdos.c (careadlinkatcwd): Remove.
607
75a65c7e
SM
6082013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
609
610 * lread.c (skip_dyn_bytes): New function (bug#12598).
611 (read1): Use it. Use getc instead of READCHAR to read bytes.
612 (load_each_byte): Remove. Update users.
613
8ca30920
DA
6142013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
615
616 * search.c (scan_buffer): Calculate end byte position just once.
617 (scan_newline): Do not recalculate start_byte.
618 (search_command): Use eassert.
619 * syntax.c (struct lisp_parse_state): New member location_byte.
620 (scan_sexps_forward): Record from_byte and avoid redundant
621 character to byte position calculation ...
622 (Fparse_partial_sexp): ... here. Break too long line.
623
25721f5b
DA
6242013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
625
626 * lisp.h (make_uninit_vector): New function.
627 * alloc.c (Fvector, Fmake_byte_code):
628 * ccl.c (Fregister_ccl_program):
629 * charset.c (Fdefine_charset_internal, define_charset_internal):
630 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
631 * composite.c (syms_of_composite):
632 * font.c (Fquery_font, Ffont_info, syms_of_font):
633 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
634 * ftfont.c (ftfont_shape_by_flt):
635 * indent.c (recompute_width_table):
636 * nsselect.m (clean_local_selection_data):
637 * syntax.c (init_syntax_once):
638 * w32unsubscribe.c (uniscribe_shape):
639 * window.c (Fcurrent_window_configuration):
640 * xfaces.c (Fx_family_fonts):
641 * xselect.c (selection_data_to_lisp_data): Use it.
642
9a9d91d9
DA
6432013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
644
645 * coding.c (Fdefine_coding_system_internal): Use AREF where
646 argument is known to be a vector.
647 * fns.c (Flocale_info): Likewise for ASET.
648 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
649 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
650
6871e574
JD
6512013-02-05 Jan Djärv <jan.h.d@swipnet.se>
652
653 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
654 height.
655
656 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
657 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
658 updateCollectionBehaviour.
659
660 * nsterm.m (NEW_STYLE_FS): Remove.
661 (ns_last_use_native_fullscreen): New variable.
662 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
663 (x_set_window_size): Do not take title bar and tool bar into account
664 if isFullscreen returns YES.
665 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
666 (check_native_fs): New function.
667 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
668 (ns_term_init): Remove NEW_STYLE_FS.
669 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
670 and tool bar if isFullscreen returns NO.
671 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
672 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
673 with HAVE_NATIVE_FS.
674 (window:willUseFullScreenPresentationOptions:): New method.
675 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
676 Hide toolbar if not enabled (Bug#13444).
677 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
678 Restore tool bar if enabled, hide it otherwise (Bug#13444).
679 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
680 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
681 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
682 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
683 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
684 (syms_of_nsterm): Add ns-use-native-fullscreen.
685
3f011c7f
PE
6862013-02-04 Paul Eggert <eggert@cs.ucla.edu>
687
688 * fileio.c (Qchoose_write_coding_system): Now static.
689
86f7c0fe
EZ
6902013-02-04 Eli Zaretskii <eliz@gnu.org>
691
692 * xdisp.c (window_buffer_changed): region_showing can be negative,
693 which still means region is being displayed.
694 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
695 whole window when showing region and the mark has changed.
696 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
697 (display_line): If it->region_beg_charpos is non-zero, set the
698 window's region_showing member to -1. (Bug#13623) (Bug#13626)
699
700 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
701 not bitfield of 1 bit.
702
5257b701
DC
7032013-02-03 Daniel Colascione <dancol@dancol.org>
704
705 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
706 daemon mode works on cygw32 when Emacs is installed and not just
707 during development.
708
8ea41ea9
PE
7092013-02-02 Paul Eggert <eggert@cs.ucla.edu>
710
711 Avoid file time stamp bug on MS-Windows (Bug#13149).
712 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
713 as FAT32 doesn't update time stamps when truncating them.
714 Also, check that a file time stamp is not a multiple of 100 ns;
715 this should catch all instances of the problem on MS-Windows,
716 as its native file system resolution is 100 ns or worse, and
717 checking for a non-multiple of 100 ns should impose only a small
718 overhead on systems with ns resolution.
719
94fbc901 7202013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 721
e7ac588e
EZ
722 Avoid encoding file names on MS-Windows when they need to be run
723 through dostounix_filename.
724 * w32.c (normalize_filename): Accept an additional argument
725 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
726 downcase it even if w32-downcase-file-names is non-nil.
727 (dostounix_filename): Accept an additional argument MULTIBYTE and
728 pass it to normalize_filename.
729 (emacs_root_dir): Adjust.
730
731 * msdos.h (dostounix_filename): Adjust prototype.
732
733 * w32.h (dostounix_filename): Adjust prototype.
734
735 * msdos.c (dostounix_filename): Accept an additional argument and
736 ignore it.
737 (init_environment): Adjust callers of dostounix_filename.
738
739 * fileio.c (Ffile_name_directory, file_name_as_directory)
740 (directory_file_name, Fexpand_file_name)
741 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
742 dostounix_filename.
743 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
744 non-nil.
745 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
746 variables, as egetenv is case-insensitive for DOS_NT.
747
748 * dired.c (file_name_completion): Don't call Fdirectory_file_name
749 with an encoded file name.
750
99d0d6dc
SM
751 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
752 Adjust calls to dostounix_filename.
e7ac588e
EZ
753
754 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
755
756 * unexw32.c (unexec): Adjust call to dostounix_filename.
757
758 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
759
760 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
761 dostounix_filename.
762
763 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
764 dostounix_filename.
765
e7c3fb06
EZ
766 * callproc.c (Fcall_process): Make sure program name in PATH and
767 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
768 is passed to exec/spawnve, which fails unless the file-name
769 encoding is UTF-8.
770
18a80473
EZ
771 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
772 even if w32-quote-process-args is nil.
773
35e85499
PE
7742013-02-01 Paul Eggert <eggert@cs.ucla.edu>
775
776 Fix timestamp bug when write-region appends nothing (Bug#13149).
777 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
778 the file's time stamp doesn't change if Emacs happens to write nothing
779 to the file, and on a buggy file system this could cause Emacs to
780 incorrectly infer that the file system doesn't have the bug.
781 Avoid this problem by inhibiting the inference in this case.
782
422ff52b
DA
7832013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
784
785 * window.h (struct window): Convert base_line_number, base_line_pos
786 and column_number_displayed members from Lisp_Object to ptrdiff_t.
787 Convert region_showing member from Lisp_Object to bitfield.
788 Remove sequence_number member. Adjust comments.
789 * window.c (sequence_number): Remove.
790 (make_window): Initialize column_number_displayed.
791 * print.c (print_object): Follow the printed representation of
792 frames and print window pointer to distinguish between windows.
793 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
794 * xdisp.c (wset_base_line_number, wset_base_line_pos)
795 (wset_column_number_displayed, wset_region_showing): Remove.
796 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
797 (try_scrolling, try_cursor_movement, redisplay_window)
798 (try_window_reusing_current_matrix, try_window_id, display_line)
799 (display_mode_lines, decode_mode_spec): Adjust users.
800 * .gdbinit (pwinx): Do not print sequence_number.
801
8654f9d7
PE
8022013-02-01 Paul Eggert <eggert@cs.ucla.edu>
803
804 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
805 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
806 * dired.c: Include <fcntl.h>.
807 (open_directory): New function, which uses open and fdopendir
808 rather than opendir. DOS_NT platforms still use opendir, though.
809 (directory_files_internal, file_name_completion): Use it.
810 (file_attributes): New function, with most of the old Ffile_attributes.
811 (directory_files_internal, Ffile_attributes): Use it.
812 (file_attributes, file_name_completion_stat): First arg is now fd,
813 not dir name. All uses changed. Use fstatat rather than lstat +
814 stat.
815 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
816 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
817 (emacs_readlinkat): New function, with much of the old
818 Ffile_symlink_p, but with an fd argument for speed.
819 It uses readlinkat rather than careadlinkatcwd, so that it
820 need not assume the working directory.
821 (Ffile_symlink_p): Use it.
822 * filelock.c (current_lock_owner): Use emacs_readlinkat
823 rather than emacs_readlink.
824 * lisp.h (emacs_readlinkat): New decl.
825 (READLINK_BUFSIZE, emacs_readlink): Remove.
826 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
827 (emacs_norealloc_allocator, emacs_readlink): Remove.
828 This stuff is moved to fileio.c.
829 * w32.c (fstatat, readlinkat): New functions.
830 (careadlinkat): Don't check that fd == AT_FDCWD.
831 (careadlinkatcwd): Remove; no longer needed.
832
9dbda100
GM
8332013-01-31 Glenn Morris <rgm@gnu.org>
834
835 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
836 (Fwrite_region): Update for new choose_write_coding_system args.
837 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
838 (syms_of_fileio): Add choose-write-coding-system.
839
3f82a88a 8402013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
841
842 * w32.c (sys_open): Zero out the flags for the new file descriptor.
843 (sys_close): Zero out the flags for the file descriptor before
844 closing it. (Bug#13546)
845
806fed21 846 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
847 (logon_network_drive, stat_worker, symlink, chase_symlinks):
848 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
849 DBCS. (Bug#13553)
850
6ee4509a
EZ
851 * w32.c (w32_get_long_filename, init_environment, readlink):
852 Support file names encoded in DBCS codepages.
26854e9c
EZ
853 (readlink): Use the current file-name-coding-system, not the ANSI
854 codepage, to decode and handle targets of symlinks.
6ee4509a 855
cf01a359
EZ
8562013-01-28 Eli Zaretskii <eliz@gnu.org>
857
858 * w32.c (opendir): Now accepts a 'const char *'.
859
6fd326b7
DA
8602013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
861
862 Remove obsolete redisplay code. See the discussion at
863 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
864 * dispnew.c (preemption_period, preemption_next_check): Remove.
865 (Vredisplay_preemption_period): Likewise.
866 (update_frame, update_single_window, update_window, update_frame_1):
867 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
868 used, following the 2012-06-22 change.
869
d8cd7742
EZ
8702013-01-25 Eli Zaretskii <eliz@gnu.org>
871
872 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
873
266fee4f
DA
8742013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
875
876 * font.c (num_fonts): Remove the leftover from old
877 debugging code. Adjust comment style here and there.
59e624b3
DA
878 * insdel.c (insert_1): Remove.
879 * lisp.h (insert_1): Remove prototype.
880 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 881
830e46e6 8822013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
883
884 * w32.c (max_filename_mbslen): New function.
885 (normalize_filename, readdir): Use it to detect locales where ANSI
886 encoding of file names uses a double-byte character set (DBCS).
887 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
888 CharNextExA, instead of incrementing a 'char *' pointer.
889 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 890
81abbb95
EZ
891 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
892 request of memory reservation to 1.7GB. (Bug#13065)
893
830e46e6 8942013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
895
896 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
897 at check_extra_latin label. (Bug#13505)
898
fd3ceb09
DA
8992013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
900
901 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
902 Avoid redundant calls to strlen.
903
edfa7fa0
DA
9042013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
905
906 Drop async_visible and async_iconified fields of struct frame.
907 This is possible because async input is gone; for details, see
908 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
909 * frame.h (struct frame): Remove async_visible and async_iconified
910 members, convert garbaged to unsigned bitfield. Adjust comments.
911 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
912 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
913 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
914 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
915 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
916 * w32term.c: Ditto.
917 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
918 properly. Likewise for obscured.
919 * xterm.c: Ditto.
266fee4f 920 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
921 properly.
922 * nsterm.m: Ditto.
923 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
924
5ad86e34
DA
9252013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
926
927 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
928 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
929
b09cca6a
SM
9302013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
931
932 * xdisp.c (message2, message2_nolog): Remove functions.
933 (message3, message3_nolog): Extract nbytes and multibyteness directly
934 from the string. Change all callers.
935 (message3_nolog): Don't set message_enable_multibyte since set_message
936 will reset it anyway.
937 (message1, message1_nolog): Use message3.
938 (vmessage): Use a stack allocated buffer rather than f->message_buf.
939 (with_echo_area_buffer): Remove last two arguments. Update all callers.
940 (set_message): Drop all but the second arg, which has to be a string.
941 (set_message_1): Simplify now that we know that a1 is NULL and the
942 second arg is a string.
943 * frame.h (struct frame): Remove `message_buf' field.
944 Use glyphs_initialized_p instead.
945 (FRAME_MESSAGE_BUF): Remove macro.
946 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
947 * lisp.h (message2, message2_nolog): Remove declarations.
948 (message3, message3_nolog): Update declarations.
949 * keyboard.c (read_char_minibuf_menu_text)
950 (read_char_minibuf_menu_width): Remove vars.
951 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
952 to correctly handle multibyte strings.
953 * frame.c (delete_frame): Don't free message_buf any more.
954 * editfns.c (message_text, message_length): Remove vars.
955 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
956 * fileio.c (auto_save_error): Use message3 instead of message2.
957 * dispnew.c (adjust_frame_message_buffer): Remove function.
958
54ab1c5a
EZ
9592013-01-23 Eli Zaretskii <eliz@gnu.org>
960
961 * w32term.c (w32fullscreen_hook): Account correctly for the screen
962 real estate used for the tool bar and the menu bar.
963
6c27465b
DA
9642013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
965
966 * insdel.c (prepare_to_modify_buffer): Force redisplay if
967 hidden buffer is prepared to modification (Bug#13164).
968
9d93ce29
DA
9692013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
970
971 * window.h (struct window): Change window_end_valid member from
972 Lisp_Object to a bitfield. Adjust comments.
973 (wset_window_end_valid): Remove.
974 * window.c (adjust_window_count): Clear window_end_valid.
975 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
976 (Fwindow_line_height, set_window_buffer, Frecenter)
977 (Fsplit_window_internal, Fdelete_other_windows_internal)
978 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
979 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
980 * xdisp.c (check_window_end, reconsider_clip_changes)
981 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
982 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
983 (find_first_unchanged_at_end_row, try_window_id): Likewise.
984
1dcb8ea2
DA
9852013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
986
987 * xdisp.c (mark_window_display_accurate): Simplify the loop
988 assuming that the only one of vchild, hchild or buffer window
989 slots is non-nil. Call mark_window_display_accurate_1 for
990 the leaf windows only.
991 (mark_window_display_accurate_1): Always assume leaf window.
992 Adjust comment.
993
b41b8a7e
PE
9942013-01-22 Paul Eggert <eggert@cs.ucla.edu>
995
593a5f2e
PE
996 * emacs.c (Qkill_emacs_hook): Now static.
997
b41b8a7e
PE
998 * fileio.c (Finsert_file_contents): Simplify.
999 Remove unnecessary assignments and tests.
1000
84e5ed96
EZ
10012013-01-21 Eli Zaretskii <eliz@gnu.org>
1002
1003 * w32.c (acl_set_file): Don't test for errors unless
1004 set_file_security returns FALSE. Avoids spurious errors when
1005 saving files.
1006
2ef88fd4
DA
10072013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1008
1009 * fileio.c (Finsert_file_contents): Revert code introduced at
1010 2013-01-18 in favor of the simpler and generally better fix.
1011 Save stack space by removing 'buffer' and reusing 'read_buf'
1012 where appropriate.
1013
d7a0a7c9
PE
10142013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1015
1016 * lisp.h (eabs): Define unconditionally (Bug#13419).
1017 The old "#if !defined (eabs)" was an unnecessary revenant of back
1018 when this macro was called "abs". Document 'eabs' better.
1019
795e7a5b 10202013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
1021
1022 * fns.c (Frandom): Doc fix.
1023
59ac2d13
EZ
10242013-01-19 Eli Zaretskii <eliz@gnu.org>
1025
1026 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1027 segfault when there are lots of overlays.
1028
1029 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
1030 when there are lots of overlays.
1031 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
1032 for the details and a way to reproduce.
1033
b3fbb395
PE
10342013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1035
3a955a1f
PE
1036 * fileio.c: Use O_APPEND to append.
1037 This corresponds better to the natural interpretation of "append",
1038 and avoids the need to open the output file twice, or to invoke
1039 lseek when APPEND is neither nil nor a number.
1040 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1041 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1042 file possibly twice, and lseeking to its end; this avoids the
1043 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1044 at the same time: the combination is never needed and apparently
1045 it doesn't work with DOS_NT.
1046
21cd50b8
PE
1047 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1048 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1049
b3fbb395
PE
1050 Allow floating-point file offsets.
1051 Problem reported by Vitalie Spinu in
1052 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1053 * fileio.c (emacs_lseek): Remove.
1054 (file_offset): New function.
1055 (Finsert_file_contents, Fwrite_region): Use it.
1056
73c14218
CY
10572013-01-19 Chong Yidong <cyd@gnu.org>
1058
1059 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1060 aborting on Fsignal (Bug#13289).
1061
6a9465f3
EZ
10622013-01-19 Eli Zaretskii <eliz@gnu.org>
1063
1064 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1065 set_file_security as failure due to insufficient privileges.
1066 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 1067 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 1068
fa705c99
PE
10692013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1070
9fe43ff6
PE
1071 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1072 The bug was observed on Ubuntu operating inside a virtual machine,
1073 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1074 The workaround introduces a race condition on non-buggy hosts,
1075 but it's an unlikely race and anyway there's a nearly identical
1076 nearby race that can't be fixed.
1077 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1078 New static vars.
1079 (Fwrite_region): Test for file system time stamp bug.
1080 (init_fileio): New function.
1081 * lisp.h (init_fileio): Declare it.
1082 * emacs.c (main): Call it.
1083
fa705c99
PE
1084 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1085 and make it more consistent with other stat-failure diagnostics.
1086
e07469fa
DA
10872013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1088
99d0d6dc
SM
1089 Fix crash when inserting data from non-regular files.
1090 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
1091 for the error description produced by valgrind.
1092 * fileio.c (read_non_regular): Rename to read_contents.
1093 Free Lisp_Save_Value object used to pass parameters.
1094 (read_non_regular_quit): Rename to read_contents_quit.
1095 (Finsert_file_contents): Redesign internal file reading loop to adjust
1096 gap and end positions after each read and so help make_gap to work
1097 properly. Do not signal an I/O error too early and so do not leave
1098 not yet decoded characters in a buffer, which was the reason of
1099 redisplay crash. Use list2 to build return value. Adjust comments.
1100
67722112
PE
11012013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1102
1103 Close a race when statting and reading files (Bug#13149).
1104 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1105 This avoids a race if the file is renamed between stat and open.
1106 This race is not the problem originally noted in Bug#13149;
1107 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1108
468afbac
DA
11092013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1110
1111 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1112 objects, related functions and macros.
1113 (make_save_value): Adjust prototype.
1114 (make_save_pointer): New prototype.
1115 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1116 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1117 * alloc.c (format_save_value): Rename to make_save_value.
1118 (make_save_pointer): New function.
1119 (record_xmalloc): Use make_save_pointer.
1120 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1121 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1122 Change users of make_save_value to make_save_pointer.
1123 Likewise for format_save_value and make_save_value.
1124
0e70695a
DA
11252013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1126
1127 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1128 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1129 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1130 debugging stubs.
1131
963ea40f
PE
11322013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1133
1134 * alloc.c (free_save_value): Now static.
1135
3346c1d0
DA
11362013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1137
1138 * keymap.c (map_keymap_internal): Use format_save_value.
1139 (map_keymap_char_table_item): Adjust accordingly.
1140 * fileio.c (non_regular_fd, non_regular_inserted)
1141 (non_regular_nbytes): Remove.
99d0d6dc
SM
1142 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1143 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
1144 (read_non_regular): Use XSAVE_ macros to extract parameters.
1145 Adjust comment.
1146 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1147 format_save_value.
1148 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1149
2b30549c
DA
11502013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1151
1152 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1153 extraction from any Lisp_Save_Value slot. Add type checking.
1154 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1155 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1156 * xselect.c: All users changed.
1157
1b971ac1
DA
11582013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1159
1160 Some convenient bits to deal with Lisp_Save_Values.
1161 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1162 (allocate_misc): Remove prototype.
1163 (format_save_value): New prototype.
1164 * alloc.c (allocate_misc): Revert back to static.
1165 (format_save_value): New function to build Lisp_Save_Value
1166 object with the specified internal structure.
1167 (make_save_value): Reimplement using format_save_value.
1168 * editfns.c (save_excursion_save): Use format_save_value.
1169 (save_excursion_restore): Use XSAVE_OBJECT.
1170
c50cf2ea
PE
11712013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1172
1173 Avoid needless casts with XSAVE_POINTER.
1174 * alloc.c (mark_object) [GC_MARK_STACK]:
1175 * dired.c (directory_files_internal_unwind):
1176 * fileio.c (do_auto_save_unwind):
1177 * gtkutil.c (pop_down_dialog):
1178 * keymap.c (map_keymap_char_table_item):
1179 * lread.c (load_unwind):
1180 * nsmenu.m (pop_down_menu):
1181 * print.c (print_object) [GC_MARK_STACK]:
1182 * xfns.c (clean_up_file_dialog):
1183 * xmenu.c (cleanup_widget_value_tree):
1184 Omit casts between XSAVE_POINTER and a pointer type.
1185
9d5a1260
DA
11862013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1187
1188 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1189 * eval.c (eval_sub): Protect `form' from being GCed before its
1190 car and cdr becomes protected with the backtrace entry.
1191
73ebd38f
DA
11922013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1193
1194 Make Lisp_Save_Value more versatile storage for up to four objects.
1195 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1196 (struct Lisp_Save_Value): New layout. Adjust comments.
1197 (XSAVE_POINTER): New macro.
1198 (XSAVE_INTEGER): Likewise.
1199 (allocate_misc): Add prototype.
1200 (free_misc): Likewise.
1201 * alloc.c (allocate_misc): Now global.
1202 (free_misc): Likewise. Adjust comment.
1203 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1204 (free_save_value): Likewise.
1205 (mark_object): Likewise.
1206 * editfns.c (save_excursion_save): Pack everything within
1207 Lisp_Save_Value and so avoid xmalloc.
1208 (save_excursion_restore): Adjust to match new layout. Use free_misc
1209 because we do not allocate extra memory any more. Add eassert.
1210 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1211 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1212 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1213 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1214 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1215
b826986f
JD
12162013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1217
1218 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1219 (nsfont_draw): Remove disabling of LCD smoothing.
1220 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 1221 Bug#11484 with LCD smoothing on.
b826986f 1222
c0511b57 12232013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 1224
b6f960a0
PE
1225 Fix SIGDANGER handlers, for AIX (Bug#13408).
1226 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1227 Move handlers here from emacs.c; they were out of place.
1228
616763d5
JD
12292013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1230
1231 * xterm.c (syms_of_xterm): Adjust documentation for
1232 scroll-bar-adjust-thumb-portion.
1233
0b59090b 12342012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
1235
1236 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1237 determine whether scroll bar thumb size should be adjusted or
1238 not. Use variable for MOTIF.
1239
1240 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1241 GTK.
1242
7bc916b4
JD
12432013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1244
eac4d08f
JD
1245 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1246 event is generated.
1247 (doCommandBySelector:): Set processingCompose to NO.
1248
7bc916b4
JD
1249 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1250 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1251 (nsfont_list_family): Add block/unblock_input calls.
1252 (nsfont_open): Move block_input earlier. Add unblock_input before early
1253 return.
1254 (nsfont_draw): Add block/unblock_input calls.
1255
bdc9b756
PE
12562013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1257
1258 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1259 for old_charpos and old_bytepos.
1260
ee56a6dc
PE
12612013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1262
1263 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1264 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1265 Clear tzvalbuf_in_environ if this workaround is in effect.
1266 Problem and fix reported by Kazuhiro Ito.
1267
9fc9a531
AH
12682013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1269
99d0d6dc
SM
1270 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1271 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
1272
1273 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1274 doc string cross-reference(s).
1275
1276 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1277 string cross-reference(s).
1278
6020559a
DA
12792013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1280
1281 Avoid unnecessary byte position calculation for the gap movement.
1282 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1283 anyway, all of them should use move_gap_both instead.
1284 * lisp.h (move_gap): Remove prototype.
1285 * insdel.c (move_gap): Remove.
1286 (move_gap_both): Add eassert.
1287 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1288 * xml.c (parse_region): Likewise.
1289
b8956427
PE
12902013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1291
1292 emacsclient -t should not suspend Emacs server (Bug#13387)
1293 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1294 New functions.
1295 * term.c (init_tty): Use them instead of rolling our own code.
1296 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1297 switches from 'signal' to 'pthread_sigmask', which is safer in
1298 multithreaded applications.
1299 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1300 which has already arranged for that.
1301 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1302 This is the main part of the bug fix.
1303
0b59090b 13042013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
1305
1306 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1307 x_last_font_name (Bug#13403).
1308
58cc0a01
DA
13092013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1310
1311 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1312 the type of per-buffer values where appropriate.
1313 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1314 predicate, which is how it's really used now. Adjust comment.
1315 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1316 * buffer.c (buffer_slot_type_mismatch): Remove.
1317 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1318 predicate. Adjust comment.
1319 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1320 fill-column, left-margin, tab-width, buffer-saved-size,
1321 left-margin-width, right-margin-width, left-fringe-width,
1322 right-fringe-width, scroll-bar-width and buffer-display-count.
1323 Use Qstringp for default-directory, buffer-file-name,
1324 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1325 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1326 line-spacing.
1327 * data.c (store_symval_forwarding): Adjust to call the predicate.
1328
5104861e
JB
13292013-01-09 Juanma Barranquero <lekktu@gmail.com>
1330
1331 * w32.c (get_name_and_id, acl_set_file):
1332 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1333
eefd7278
DA
13342013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1335
1336 * lisp.h (make_gap_1): New prototype.
1337 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1338 gap size values.
1339 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1340 naming convention.
1341 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 1342 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
1343 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1344 (make_gap_1): New function to adjust the gap of any buffer.
1345 * coding.c (coding_alloc_by_making_gap): Use it.
1346 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1347 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1348
073ca75b
JL
13492013-01-08 Juri Linkov <juri@jurta.org>
1350
1351 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1352 of (supports :underline (:style wave)). (Bug#13000)
1353
3bace969
AH
13542013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1355
1356 * undo.c (Fprimitive_undo): Move to simple.el.
1357 (syms_of_undo): Remove declarations for Sprimitive_undo.
1358
63a63bd4
SM
13592013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1360
1361 * keyboard.c (echo_add_key): Rename from echo_add_char.
1362
56ed110a
CY
13632013-01-06 Chong Yidong <cyd@gnu.org>
1364
1365 * keyboard.c (echo_add_char): New function, factored out from
1366 echo_char. Don't add a space if the previous echo string was
1367 empty (Bug#13255).
1368 (echo_char): Use it.
1369 (read_key_sequence): When echoing mock input, ensure that the
1370 trailing dash is properly added.
1371
b630991b
EZ
13722013-01-05 Eli Zaretskii <eliz@gnu.org>
1373
1374 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1375 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
1376 digits for buffer positions, before misalignment starts.
1377 Display "0" for integer "object" field.
b630991b
EZ
1378 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1379 Display the newline glyph more unambiguously.
1380
f032a318
YM
13812013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1382
1383 * nsterm.m (ns_draw_underwave):
1384 * w32term.c (w32_draw_underwave):
1385 * xterm.c (x_draw_underwave): Make underwave look more triangular
1386 and also degrade gracefully for small fonts. (Bug#13000)
1387
4240dd3c
YM
1388 * nsterm.m (ns_draw_text_decoration):
1389 * w32term.c (x_draw_glyph_string):
1390 * xterm.c (x_draw_glyph_string): Don't use previous underline
1391 thickness and position if previous underline type is underwave.
1392
553081a5
SM
13932013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1394
1395 * fileio.c (Ffile_acl): Undocument return format.
1396
9539d465 13972013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
1398
1399 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1400
71376d4b
PE
14012013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1402
1403 Simplify via eabs.
1404 * dired.c (file_name_completion):
1405 * doc.c (get_doc_string):
1406 * floatfns.c (round2):
1407 * font.c (font_score, font_delete_unmatched):
1408 * fringe.c (compute_fringe_widths):
1409 * lread.c (read_list):
1410 * minibuf.c (Ftry_completion):
1411 * term.c (tty_ins_del_lines):
1412 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1413 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1414
a7f11948
EZ
14152012-12-31 Eli Zaretskii <eliz@gnu.org>
1416
1417 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
1418 correctly.
1419 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
1420 for the bug this caused.
1421
84cc1ab6
PE
14222012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1423
1424 * coding.c (Qmac): Now static.
1425
5a1d858b
JD
14262012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1427
1428 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1429 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1430 handlebox_widget. Set toolbar_in_hbox to false/true, set
1431 toolbar_is_packed to true.
1432 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1433 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1434 Show all on TOOLBAR_TOP_WIDGET.
1435 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1436 by TOOLBAR_TOP_WIDGET.
1437 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1438 Check toolbar_is_packed.
8b745d92
JD
1439 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1440 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1441 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1442 false.
1443 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1444 (xg_update_menubar): Update title only if
1445 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1446 (xg_update_submenu): Skip tearoff only if
1447 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1448 (xg_initialize): Initialize xg_detached_menus only if
1449 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
1450
1451 * xterm.h (struct x_output): Surround handlebox_widget with
1452 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1453 toolbar_in_hbox is bool.
1454
d5e5e7b4 14552012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
1456
1457 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1458 (LIBS_GNUSTEP): Define.
1459 (LIBES): Add $(LIBS_GNUSTEP).
1460 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1461
d5e5e7b4 14622012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
1463
1464 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1465 continuation glyph on a TTY with an indication of an empty line.
1466 (Bug#13277)
1467
e7ae8039
EZ
14682012-12-29 Eli Zaretskii <eliz@gnu.org>
1469
ccad023b
EZ
1470 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1471 file's SELinux context or ACLs successfully set, nil otherwise.
1472 (Bug#13298)
8d23a331 1473 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 1474
e7ae8039
EZ
1475 * w32proc.c (reader_thread): Avoid passing NULL handles to
1476 SetEvent and WaitForSingleObject.
1477
7456e13f
PE
14782012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1479
1480 Port EXTERNALLY_VISIBLE to Clang 3.2.
1481 * conf_post.h (__has_attribute): New macro.
1482 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1483
1ab0c851
GM
14842012-12-27 Glenn Morris <rgm@gnu.org>
1485
1486 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1487 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1488
82e2a1f0 14892012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 1490
63a63bd4
SM
1491 * fileio.c (file_name_as_directory, directory_file_name):
1492 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
1493 came from a multibyte or a unibyte Lisp string; all callers
1494 adjusted. Don't assume the input string is always multibyte.
1495 (Bug#13262)
1496 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1497 don't ENCODE_FILE them, and return a unibyte string if the input
1498 was unibyte.
1499 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1500 don't assume the input strings will always be multibyte. If the
1501 input strings are multibyte, decode strings obtained from C
1502 library functions.
1503
8847a0de
DA
15042012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1505
1506 * lisp.h (toplevel): Add two notices to the comment about
1507 defining a new Lisp data type.
6cda572a
DA
1508 * print.c (print_object): If Lisp_Save_Value object's pointer
1509 is the address of a memory area containing Lisp_Objects, try
1510 to print them.
1511 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 1512
4b298d5a
DA
15132012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1514
1515 * keyboard.c (record_asynch_buffer_change): Initialize an event
1516 only if it's really needed.
1517 * frame.h (enum output_method): Remove output_mac member since
1518 it's a leftover from the deleted code.
1519 * frame.c (Fframep): Adjust user here ...
1520 * terminal.c (Fterminal_live_p): ... and here.
1521 * coding.c (Qmac): Now here because it's only used to denote
1522 end-of-line encoding type.
1523 (syms_of_coding): DEFSYM it.
1524 * frame.h (Qmac): Remove duplicated declaration.
1525
12384b01
PE
15262012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1527
1528 * window.c (select_window_1): Now static, since it's used only here.
1529
f1665bdc
EZ
15302012-12-25 Eli Zaretskii <eliz@gnu.org>
1531
1532 * window.c (window_body_cols): Subtract display margins from the
1533 window body width on TTYs as well. See
1534 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1535 for the original report.
1536
9a0d4f34
DA
15372012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1538
1539 * xdisp.c (redisplay_window): Remove inner local variable
1540 because the outer shadowed one has the same meaning.
cd78d9b1
DA
1541 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1542 set but never used.
1543 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1544 (xg_create_tool_bar): Adjust users.
9a0d4f34 1545
f9e7c67e
DA
15462012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1547
1548 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1549 * buffer.c (Fget_buffer_create): Use it to set compact field of
1550 struct buffer_text to avoid accessing an uninitialized value
1551 when compact_buffer is called for the first time.
1552 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
1553 (Fset_buffer_modified_p): Use buffer_window_count to check
1554 whether the buffer is displayed in some window.
1555 * xdisp.c (message_dolog): Likewise.
f9e7c67e 1556
299614f3
EZ
15572012-12-23 Eli Zaretskii <eliz@gnu.org>
1558
40ff07a5
EZ
1559 * w32.c (acl_set_file): If setting the file security descriptor
1560 fails, and the new DACL is identical to the existing one, silently
1561 return success. This fixes problems for users backing up their
1562 own files without having the necessary privileges for setting
1563 security descriptors.
1564
299614f3
EZ
1565 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1566 values.
1567 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1568 after WaitForSingleObject returns normally. This expedites reader
1569 thread shutdown when delete_child triggers it.
1570 (reap_subprocess): More accurate commentary for why we call
1571 delete_child only when cp->fd is negative.
1572
1573 * w32.c (sys_close): Do not call delete_child on a subprocess
1574 whose handle is not yet closed. Instead, set its file descriptor
1575 to a negative value, so that reap_subprocess will call
63a63bd4
SM
1576 delete_child on that subprocess when its SIGCHLD arrives.
1577 This avoids closing handles used for communications between sys_select
299614f3
EZ
1578 and reader_thread, which doesn't give sys_select a chance to
1579 notice that the process exited and invoke the SIGCHLD handler for
1580 it.
1581
cf162aee
JD
15822012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1583
1584 * nsfns.m (Fns_do_applescript): Run event loop until script has
1585 been executed (Bug#12969).
1586 (ns_run_ascript): Chech as_script for nil, set to nil after
1587 executing script.
1588
94900bfe
MR
15892012-12-22 Martin Rudalics <rudalics@gmx.at>
1590
1591 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1592
b2faf49c
EZ
15932012-12-22 Eli Zaretskii <eliz@gnu.org>
1594
1595 * w32term.c (w32fullscreen_hook): New function.
1596 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1597
7efa3fb3
EZ
15982012-12-21 Eli Zaretskii <eliz@gnu.org>
1599
bb085aed
EZ
1600 * fileio.c (Finsert_file_contents): Doc fix.
1601
7efa3fb3
EZ
1602 * w32proc.c (new_child, delete_child, find_child_pid): For a
1603 subprocess, consider its slot being in use as long as its process
1604 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1605 slot when a new process is started immediately after killing
1606 another one, without waiting enough time for the first process to
1607 be reaped and resources allocated for it be orderly freed.
1608 (Bug#13086)
1609 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1610
c1f02afa
CY
16112012-12-21 Chong Yidong <cyd@gnu.org>
1612
1613 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1614
5bec25eb
CY
1615 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1616
a4b0cca1 16172012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
1618
1619 * w32.c (get_name_and_id): Always pass NULL as the first argument
1620 of lookup_account_sid. Avoids crashes with UNC file names that
1621 refer to DFS domains, not to specific machine names. (Bug#12621)
1622 Remove now unused argument FNAME; all callers changed.
1623 (get_file_owner_and_group): Remove now unused argument FNAME; all
1624 callers changed.
1625
34b4b7eb
CY
16262012-12-21 Chong Yidong <cyd@gnu.org>
1627
1628 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1629 error for invalid chars, don't check for a nil return value.
1630
13002885
DA
16312012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1632
1633 Avoid calls to CHAR_TO_BYTE if byte position is known.
1634 * editfns.c (make_buffer_string_both): Use move_gap_both.
1635 (Fbuffer_string): Use make_buffer_string_both.
1636 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1637 Adjust comment.
1638 (buf_bytepos_to_charpos): Likewise.
1639 (charpos_to_bytepos): Remove.
1640 * fileio.c (Finsert_file_contents): Use move_gap_both.
1641 * search.c (Freplace_match): Likewise.
9a0d4f34 1642 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
1643 names for byte positions.
1644 * lisp.h (charpos_to_bytepos): Remove prototype.
1645 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1646 * insdel.c (move_gap): Likewise.
1647
99e9311c
PE
16482012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1649
1650 * xdisp.c (redisplay_internal): Remove now-unused local.
1651
e02230bf
SM
16522012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1653
1654 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1655 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 1656 proper value of frame-local variables (bug#13225).
e02230bf 1657
1687fb14
DA
16582012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1659
1660 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1661 Rename 4th argument since it may be buffer or string. Adjust comment.
1662 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1663
a2f07cd2
DA
16642012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1665
1666 * coding.c (Fdetect_coding_region): Do not check start and end with
1667 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1668 (code_convert_region): Likewise.
1669
474d441e
EZ
16702012-12-18 Eli Zaretskii <eliz@gnu.org>
1671
1672 * w32.c (acl_get_file, acl_set_file): Run the file name through
1673 map_w32_filename, and resolve any symlinks in the file name, like
1674 Posix platforms do.
1675 (acl_set_file): Call revert_to_self, if any privileges were
1676 enabled.
1677
8725c076
JB
16782012-12-17 Juanma Barranquero <lekktu@gmail.com>
1679
1680 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1681 ($(BLD)/w32.$(O)): Update dependencies.
1682
1e101a4b
SM
16832012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1684
1685 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1686 propagate redisplay's scrolling (if any) to the right window.
1687 (redisplay_internal): Use ensure_selected_frame.
1688 (display_mode_lines): Complete last fix.
1689 * window.c (select_window_1): New func, extracted from select_window.
1690 (select_window): Use it.
1691 * window.h (select_window_1): Declare.
1692
66447e07
EZ
16932012-12-17 Eli Zaretskii <eliz@gnu.org>
1694
1695 Emulate Posix ACL APIs on MS-Windows.
1696 * w32.c: Include sddl.h and sys/acl.h.
1697 (SDDL_REVISION_1): Define if not already defined.
1698 (g_b_init_get_security_descriptor_dacl)
1699 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1700 (g_b_init_is_valid_security_descriptor)
1701 (g_b_init_set_file_security): New static flags.
1702 (globals_of_w32): Initialize them to zero.
1703 (SetFileSecurity_Name): New string constant.
1704 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1705 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1706 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1707 (IsValidSecurityDescriptor_Proc): New typedefs.
1708 (get_file_security, get_security_descriptor_owner)
1709 (get_security_descriptor_group): Set errno to ENOTSUP.
1710 (set_file_security, get_security_descriptor_dacl)
1711 (is_valid_security_descriptor, convert_sd_to_sddl)
1712 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1713 (acl_free, acl_get_file, acl_set_file): New functions.
1714
1715 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1716
207a7ef0
PE
17172012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1718
1719 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1720 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1721 for some of that bug's symptoms can now cause Emacs to abort.
1722 Remove the workaround.
1723 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1724 The bug that caused SIGCHLD to get lost has been fixed, and the
1725 workaround for it can now cause Emacs to abort.
1726
17fdfc15
PE
17272012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1728
1729 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1730 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1731 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1732
7c3d167f
RF
17332012-12-16 Romain Francoise <romain@orebokech.com>
1734
1735 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1736 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 1737 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
1738 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1739
1740 * Makefile.in (LIBACL_LIBS): New macro.
1741 (LIBES): Use it.
1742
7d80ea23
PE
17432012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1744
1745 * fileio.c (internal_delete_file): Use bool for boolean.
1746
b0728617
EZ
17472012-12-15 Eli Zaretskii <eliz@gnu.org>
1748
1749 Fix bug #13079 on MS-Windows with temp files not being deleted.
1750 * w32.h (_child_process): New members input_file and
1751 pending_deletion.
1752 (register_child): First argument is now pid_t.
1753 (record_infile, record_pending_deletion): New prototypes.
1754
1755 * w32proc.c (new_child): Initialize input_file and
1756 pending_deletion members of the child.
1757 (delete_child): Delete the child's temporary input file, if any,
1758 that is pending deletion.
1759 (register_child): First argument is now pid_t.
1760 (record_infile, record_pending_deletion): New functions.
1761 (reap_subprocess): Fix a typo in DebPrint string.
1762 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
1763
1764 * fileio.c (internal_delete_file): Return an int again: non-zero
1765 if delete-file succeeds, zero otherwise.
1766
1767 * lisp.h (internal_delete_file): Adjust prototype.
1768
1769 * callproc.c (Fcall_process): Don't overwrite infile with result
1770 of DECODE_FILE.
1771 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
1772 asynchronous subprocess, record the name of the input file name,
1773 if any.
1774 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
1775 delete the file, record it as pending deletion when the subprocess
1776 exits.
1777
7e90af26
EZ
17782012-12-14 Eli Zaretskii <eliz@gnu.org>
1779
1780 * editfns.c [HAVE_PWD_H]: Include grp.h.
1781
1782 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
1783
97976f9f
PE
17842012-12-14 Paul Eggert <eggert@cs.ucla.edu>
1785
1786 Fix permissions bugs with setgid directories etc. (Bug#13125)
1787 * dired.c (Ffile_attributes): Return t as the 9th attribute,
1788 to mark it as a placeholder. The old value was often wrong.
1789 The only user of this attribute has been changed to use
1790 file-ownership-preserved-p instead, with its new group arg.
1791 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
1792
26ec1f49
SM
17932012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
1794
ad966fe7
SM
1795 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
1796 Keep selected_window and selected_frame in sync.
26ec1f49 1797
5c207910
EZ
17982012-12-14 Eli Zaretskii <eliz@gnu.org>
1799
1800 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
1801 try to get accurate owner and group information from NT file
1802 security APIs. This is to make most callers of 'stat' and
1803 'lstat', which don't need that information, much faster.
1804
26ec1f49
SM
1805 * dired.c (Ffile_attributes) [WINDOWSNT]:
1806 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
1807 owner and group information from 'lstat'.
1808
893f52d8
PE
18092012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1810
4c95c9a5
PE
1811 * fileio.c (Finsert_file_contents): Don't put tail into head area,
1812 as that confuses set-auto-coding, so insist on the head-read
1813 returning the full 1024 bytes. Let lseek compute the tail offset;
1814 less work for us. Do not ignore I/O errors when reading the tail.
1815
893f52d8
PE
1816 * xdisp.c: Minor style fixes.
1817 (init_iterator): Hoist assignment out of if-expression.
1818 (markpos_of_region): Callers now test for sign, not for -1.
1819
40d1e434
DA
18202012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
1821
1822 Minor redisplay optimization when the region length is zero.
1823 * xdisp.c (markpos_of_region): New function.
1824 (init_iterator): Do not highlight the region of zero length.
1825 (redisplay_window): Check whether the region is of non-zero length.
1826 (try_cursor_movement): Allow if the region length is zero.
1827 (try_window_reusing_current_matrix, try_window_id): Likewise.
1828
727f9739 18292012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
1830
1831 * search.c (search_buffer): Check the inverse translations of each
1832 character in pattern when the buffer being searched is unibyte.
1833 (Bug#13084)
1834
727f9739 18352012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
1836
1837 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
1838 files, fixing a regression from 24.2.
645c6a30 1839 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 1840
d20704ef
PE
18412012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1842
1843 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1844 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1845 Remove unnecessary S_ISLNK test, as (contra the comments) this
1846 function can't copy symlinks. Improve quality of error message
1847 when attempting to copy files that are neither regular files nor
1848 directories.
1849
2dd61a9b
DA
18502012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1851
1852 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1853 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1854 * window.c (Frecenter):
1855 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1856 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1857
cc98b684
DC
18582012-12-12 Daniel Colascione <dancol@dancol.org>
1859
1e101a4b 1860 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
1861 the dumped Emacs is not a sparse file, greatly improving Cygwin
1862 "make bootstrap" performance.
1863
38e791fd
MA
18642012-12-11 Michael Albinus <michael.albinus@gmx.de>
1865
1866 * inotify.c (inotify_callback): Generate an Emacs event for every
1867 incoming inotify event.
1868
f9d1448f
EZ
18692012-12-11 Eli Zaretskii <eliz@gnu.org>
1870
1871 * xdisp.c (handle_face_prop): Fix logic of computing
1872 it->start_of_box_run_p.
1873 (append_space_for_newline): If the glyph row is R2L, reset the
1874 iterator's end_of_box_run_p flag before prepending the space glyph.
1875 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1876 iterator's start_of_box_run_p flag before prepending the stretch.
1877 (append_glyph, produce_image_glyph, append_composite_glyph)
1878 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1879 left_box_line_p and right_box_line_p flags of the glyph for R2L
1880 glyph rows. (Bug#13011)
1881
c6afe371
DA
18822012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1883
1884 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1885 if changed buffer is not shown in a window.
1886 * insdel.c (prepare_to_modify_buffer): Likewise.
1887 * window.c (replace_buffer_in_windows_safely): Do nothing
1888 if buffer is not shown in a window.
1889 (Fforce_window_update): Likewise if string or buffer argument
1890 is passed.
1891
1b47babd
EZ
18922012-12-11 Eli Zaretskii <eliz@gnu.org>
1893
1894 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1895 encoded_file_name, which is what it is.
1896
4c1acb95
DA
18972012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1898
1899 Consistently use marker_position and marker_byte_position.
1900 * fringe.c (Ffringe_bitmaps_at_pos):
1901 * indent.c (Fvertical_motion):
1902 * insdel.c (prepare_to_modify_buffer):
1903 * keyboard.c (make_lispy_position):
1904 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
1905 (window_scroll_pixel_based, displayed_window_lines)
1906 (Fset_window_configuration):
1907 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
1908 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
1909 Replace direct access to marker fields with calls
1910 to marker_position and/or marker_byte_position.
1911
0eeb69fe
JB
19122012-12-11 Juanma Barranquero <lekktu@gmail.com>
1913
1914 * makefile.w32-in (SIG2STR_H): New macro.
1915 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
1916 ($(BLD)/w32notify.$(O)): Update dependencies.
1917
1cf1bbd5
DC
19182012-12-10 Daniel Colascione <dancol@dancol.org>
1919
8db4b52f
DC
1920 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
1921 Windows file notification functionality unless WINDOWSNT.
1922
1cf1bbd5
DC
1923 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
1924 declarations.
1925
1926 * w32fns.c (cache_system_info): Initialize the global hinst
1927 variable here so various initialization calls DTRT.
1928
1e101a4b 1929 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
1930 (hinst): Remove unneeded extern declaration.
1931 (_start): Remove initialization of above variables; remove
1932 initialization of hinst, as cache_system_info now does that.
1933
1934 * emacs.c (main): Call cache_system_info early in startup; we
1935 previously weren't calling it in Cygwin builds.
1936
26ec1f49
SM
1937 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
1938 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
1939 and link it to Emacs.
1940
98a07056
DA
19412012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
1942
1943 Per-buffer window counters.
1944 * buffer.h (struct buffer): New member window_count.
1945 (buffer_window_count): New function.
1946 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1947 Initialize window_count.
1948 (Fkill_buffer): Verify window_count for the buffer being killed.
1949 (modify_overlay): Do not force redisplay if buffer is not shown
1950 in any window.
1951 (init_buffer_once): Initialize window_count for buffer_defaults
1952 and buffer_local_symbols.
1953 * window.h (buffer_shared): Remove declaration.
1954 (wset_buffer): Convert from inline ...
1955 * window.c (wset_buffer): ... to an ordinary function.
1956 (adjust_window_count): New function.
1957 (make_parent_window): Use it.
1958 * xdisp.c (buffer_shared): Remove.
1959 (redisplay_internal, redisplay_window): Adjust users.
1960 (buffer_shared_and_changed): Use per-buffer window counter.
1961
2b8c9064
EZ
19622012-12-10 Eli Zaretskii <eliz@gnu.org>
1963
1964 Support for filesystem notifications on MS-Windows.
1965 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
1966 and this is a TTY frame, signal the caller that keyboard input is
1967 available.
1968
1969 * w32xfns.c (drain_message_queue): Now returns an int: an
1970 indication whether any WM_EMACS_FILENOTIFY messages were found in
1971 the queue.
1972
1973 * w32inevt.c (handle_file_notifications): New function.
1974 (w32_console_read_socket): Call it to process file notifications.
1975
1976 * w32console.c (initialize_w32_display): Record the main thread ID
1977 in dwMainThreadId.
1978
1979 * deps.mk (inotify.o): New dependency list.
1980
1981 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
1982
1983 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
1984 (WM_EMACS_END): Bump value by 1.
1985 (notification_buffer_in_use, file_notifications)
1986 (notifications_size, notifications_desc): Declare.
1987 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
1988 Add prototypes.
1989
1990 * w32term.c (lispy_file_action, queue_notifications): New functions.
1991 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
1992 <Qrenamed_to>: New symbols.
1993 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
1994
1995 * w32notify.c: New file, implements file event notifications for
1996 MS-Windows.
1997
1998 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
1999 by posting it to the w32_read_socket queue.
2000
1e101a4b 2001 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
2002
2003 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2004 (GLOBAL_SOURCES): Add w32notify.c
2005 ($(BLD)/w32notify.$(O)): New set of dependencies.
2006
2007 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2008
1e101a4b
SM
2009 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2010 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
2011 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2012 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2013 w32notify-handle-event by default.
2014
2015 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2016 syms_of_w32notify.
2017
81606b10
RS
20182012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2019
2b8c9064 2020 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 2021 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
2022
2023 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2024
2025 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2026 (syms_of_keyboard): DEFSYM it.
2027 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2028 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2029 Qfile_inotify events.
2030 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2031 special-event-map to inotify-handle-event.
2032
2033 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2034
2035 * Makefile.in (base_obj): Add inotify.o.
2036
2037 * inotify.c: New file.
2038
265c2fbf 20392012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
2040
2041 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2042
265c2fbf 20432012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
2044
2045 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2046 DWORD_PTR, for compatibility with 64-bit builds.
2047
a06ae17d 2048 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
2049 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2050 (system_process_attributes): Use SIZE_T rather than DWORD, for
2051 compatibility with 64-bit builds.
2052
265c2fbf 20532012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
2054
2055 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2056
265c2fbf 20572012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
2058
2059 * indent.c (Fvertical_motion): If a display string will be
2060 displayed on the left or the right margin, don't consider it as a
2061 factor in cursor positioning. (Bug#13108)
2062
265c2fbf 20632012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
2064
2065 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2066
5f460827
PE
20672012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2068
2069 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2070 for string length.
2071
a16e75cd
EZ
20722012-12-08 Eli Zaretskii <eliz@gnu.org>
2073
2074 * w32.c (unsetenv): Return 0 if the input string is too long.
2075
5745a7df
PE
20762012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2077
2078 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2079 * alloc.c (xputenv): New function.
2080 * dbusbind.c (Fdbus_init_bus):
2081 * emacs.c (main):
2082 * xterm.c (x_term_init):
2083 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2084 * editfns.c (initial_tz): Move static var decl up.
2085 (tzvalbuf_in_environ): New static var.
2086 (init_editfns): Initialize these two static vars.
2087 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2088 Save old TZ value on stack, if it's small.
2089 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2090 instead, use xputenv+unsetenv to set and restore TZ.
2091 (environbuf): Remove static var. All uses removed.
2092 (Fset_time_zone_rule): Do not save TZ and environ;
2093 no longer needed here.
2094 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2095 Move to inside set_time_zone_rule; they don't need file scope any more.
2096 (set_time_zone_rule): Maintain the TZ=value string separately.
2097 (syms_of_editfns): Don't initialize initial_tz;
2098 init_editfns now does it.
2099 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2100 * lisp.h (xputenv): New decl.
2101
c56efa40
FP
21022012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2103
2104 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2105
75ceee05
EZ
21062012-12-08 Eli Zaretskii <eliz@gnu.org>
2107
2108 * w32.c (unsetenv, sys_putenv): New functions.
2109
1b6dbfeb
CY
21102012-12-08 Chong Yidong <cyd@gnu.org>
2111
2112 * editfns.c (Finsert_char): Make the error message more
2113 informative (Bug#12992).
2114
d983a10b
PE
21152012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2116
7be78020
PE
2117 Simplify get_lim_data.
2118 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2119 Remove USG and vlimit methods; no longer used these days.
2120 Add #error catchall just in case.
2121
d983a10b
PE
2122 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2123 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2124 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2125 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2126 (deleted_pid_list, Fdelete_process, create_process)
2127 (record_child_status_change, handle_child_signal, deliver_child_signal)
2128 (init_process_emacs, syms_of_process):
2129 Assume SIGCHLD is defined.
2130 (parse_signal): Remove. All uses removed.
2131 (abbr_to_signal): New static function.
2132 (Fsignal_process): Use it to convert signal names to ints.
2133 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2134 kill (getpgrp (), ...).
2135 (emacs_sigaction_init): Assume SIGCHLD is defined.
2136 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2137 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2138 * syssignal.h (EMACS_KILLPG): Remove.
2139 All uses replaced by 'kill' with a negative pid.
2140 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2141 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2142
9cdde1e2
PE
21432012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2144
2145 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2146 This will cause a production Emacs to dump core instead of
2147 infinite-looping.
2148
822995f8
DA
21492012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2150
2151 * frame.c (make_frame): Do not set window's buffer to t.
2152 * window.c (Fsplit_window_internal): Likewise. Previously it was
2153 used to indicate that the window is being set up. Now we use
2154 set_window_buffer for all new windows, so the condition in ...
2155 (Fset_window_buffer): ... is always true and can be removed.
2156
ed08365b
DA
21572012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2158
2159 Convenient macro to check whether the buffer is hidden.
2160 * buffer.h (BUFFER_HIDDEN_P): New macro.
2161 * frame.c (make_frame): Use it. Adjust comment.
2162 * buffer.c (candidate_buffer): New function.
2163 (Fother_buffer, other_buffer_safely): Use it.
2164
e86f5134
EZ
21652012-12-06 Eli Zaretskii <eliz@gnu.org>
2166
2167 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2168 if the child process is still running. Instead, exit the wait
2169 loop and return zero. (Bug#13086)
2170
1700db3c
DA
21712012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2172
2173 * frame.h (x_char_width, x_char_height): Remove prototypes.
2174 * w32term.h (x_char_width, x_char_height): Likewise.
2175 * xfns.c (x_char_width, x_char_height): Remove.
2176 * w32fns.c (x_char_width, x_char_height): Likewise.
2177 * nsfns.c (x_char_width, x_char_height): Likewise.
2178 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2179 all window frames.
2180 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2181 * keyboard.c (command_loop_1): Remove prototype.
2182 (command_loop_2, top_level_1): Add static to match prototype.
2183
35fb8050
PE
21842012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2185
2186 Fix a recently-introduced delete-process race condition.
2187 * callproc.c, process.h (record_kill_process):
2188 New function, containing part of the old call_process_kill.
2189 (call_process_kill): Use it.
2190 This does not change call_process_kill's behavior.
2191 * process.c (Fdelete_process): Use record_kill_process to fix a
2192 race condition that could cause Emacs to lose track of a child.
2193
565212e5
DA
21942012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2195
2196 Avoid code duplication between prev_frame and next_frame.
2197 * frame.c (candidate_frame): New function. Add comment.
2198 (prev_frame, next_frame): Use it. Adjust comment.
2199
d8ad4d3f 22002012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
2201
2202 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2203 fails, signal an error instead of continuing with an empty
2204 string. (Bug#13079)
7c2fcf9b
EZ
2205 Encode expanded temp file pattern before passing it to mkstemp or
2206 mktemp.
d3cefd13 2207
2e7cddd3
EZ
2208 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2209 Encode the file name before passing it to dostounix_filename, in
2210 case it will downcase it (under w32-downcase-file-names).
2211 (Bug#12933)
2212
644d3f0d
PE
22132012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2214
2215 Minor call-process cleanups.
2216 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2217 at the same time as other platforms, to simplify analysis.
2218 No need for fd0_volatile since we have synch_process_fd.
2219 Avoid needless emacs_close; arg is always negative.
2220
396376f1
AS
22212012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2222
2223 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2224 processes.
2225
350f51ad
DA
22262012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2227
2228 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2229 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2230 and mouse_face_hidden members to a bitfields.
2231 * frame.h (struct frame): Remove set-but-not-used space_width member.
2232 (FRAME_SPACE_WIDTH): Remove.
2233 * nsterm.m, w32term.c, xterm.c: Adjust users.
2234 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2235 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2236 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2237 members to a bitfields.
2238
bc9dbce6
PE
22392012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2240
bb5f74ee
PE
2241 Don't let call-process be a zombie factory (Bug#12980).
2242 Fixing this bug required some cleanup of the signal-handling code.
2243 As a side effect, this change also fixes a longstanding rare race
2244 condition whereby Emacs could mistakenly kill unrelated processes,
2245 and it fixes a bug where a second C-g does not kill a recalcitrant
2246 synchronous process in GNU/Linux and similar platforms.
2247 The patch should also fix the last vestiges of Bug#9488,
2248 a bug which has mostly been fixed on the trunk by other changes.
2249 * callproc.c, process.h (synch_process_alive, synch_process_death)
2250 (synch_process_termsig, sync_process_retcode):
2251 Remove. All uses removed, to simplify analysis and so that
2252 less consing is done inside critical sections.
2253 * callproc.c (call_process_exited): Remove. All uses replaced
2254 with !synch_process_pid.
2255 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2256 These take the role of what used to be in unwind-protect arg.
2257 All uses changed.
2258 (block_child_signal, unblock_child_signal):
2259 New functions, to avoid races that could kill innocent-victim processes.
2260 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2261 (call_process_kill): Record killed processes as deleted, so that
2262 zombies do not clutter up the system. Do this inside a critical
2263 section, to avoid a race that would allow the clutter.
2264 (call_process_cleanup): Fix code so that the second C-g works again
2265 on common platforms such as GNU/Linux.
2266 (Fcall_process): Create the child process in a critical section,
2267 to fix a race condition. If creating an asynchronous process,
2268 record it as deleted so that zombies do not clutter up the system.
2269 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2270 light of these changes. Omit unnecessary call to emacs_close
2271 before failure, as the unwind-protect code does that.
2272 * callproc.c (call_process_cleanup):
2273 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2274 * process.c (record_deleted_pid): New function, containing
2275 code refactored out of Fdelete_process.
2276 (Fdelete_process): Use it.
2277 (process_status_retrieved): Remove. All callers changed to use
2278 child_status_change.
2279 (record_child_status_change): Remove, folding its contents into ...
2280 (handle_child_signal): ... this signal handler. Now, this
2281 function is purely a handler for SIGCHLD, and is not called after
2282 a synchronous waitpid returns; the synchronous code is moved to
2283 wait_for_termination. There is no need to worry about reaping
2284 more than one child now.
2285 * sysdep.c (get_child_status, child_status_changed): New functions.
2286 (wait_for_termination): Now takes int * status and bool
2287 interruptible arguments, too. Do not record child status change;
2288 that's now the caller's responsibility. All callers changed.
2289 Reimplement in terms of get_child_status.
2290 (wait_for_termination_1, interruptible_wait_for_termination):
2291 Remove. All callers changed to use wait_for_termination.
2292 * syswait.h: Include <stdbool.h>, for bool.
2293 (record_child_status_change, interruptible_wait_for_termination):
2294 Remove decls.
2295 (record_deleted_pid, child_status_changed): New decls.
2296 (wait_for_termination): Adjust to API changes noted above.
2297
bc9dbce6
PE
2298 * bytecode.c, lisp.h (Qbytecode): Remove.
2299 No longer needed after 2012-11-20 interactive-p changes.
2300
3cf3c607
EZ
23012012-12-03 Eli Zaretskii <eliz@gnu.org>
2302
2303 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2304 the scroll margin, move point outside the margin. (Bug#13055)
2305
005c8d13
JD
23062012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2307
2308 * gtkutil.c (my_log_handler): New function.
2309 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2310
20edc1c9
DA
23112012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2312
2313 * lisp.h (modify_region): Rename to...
2314 (modify_region_1): ...new prototype.
2315 * textprop.c (modify_region): Now static. Adjust users.
2316 * insdel.c (modify_region): Rename to...
2317 (modify_region_1): ...new function to work with current buffer.
2318 Adjust comment and users. Use true and false for booleans.
2319
62c2e5ed
DA
23202012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2321
2322 * alloc.c (free_save_value): New function.
2323 (safe_alloca_unwind): Use it.
2324 * lisp.h (free_save_value): New prototype.
2325 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2326 Add comment.
2327 (save_excursion_restore): Adjust to match saved data structure.
2328 Use free_save_value to offload some work from GC. Drop obsolete
2329 #if 0 code.
2330
c5bc2d1d 23312012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
2332
2333 * fileio.c (Vauto_save_list_file_name): Doc fix.
2334
c5bc2d1d 23352012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
2336
2337 * w32fns.c: Remove prototype of atof.
1e101a4b 2338 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 2339 builds.
1e101a4b 2340 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
2341
2342 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2343 with 64-bit builds.
2344
2345 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2346 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2347 defined.
2348
c5bc2d1d 23492012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 2350
a9de9f0c 2351 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 2352
21e54a94
PE
23532012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2354
2dd2e622
PE
2355 Fix xpalloc confusion after memory is exhausted.
2356 * alloc.c (xpalloc): Comment fix.
2357 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2358 and signals an error, do not clear charset_table_size, as
2359 charset_table is still valid.
2360 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2361
21e54a94
PE
2362 Use execve to avoid need to munge environ (Bug#13054).
2363 * callproc.c (Fcall_process):
2364 * process.c (create_process):
2365 Don't save and restore environ; no longer needed.
2366 * callproc.c (child_setup):
2367 Use execve, not execvp, to preserve environ.
2368
3e5490f7
PE
23692012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2370
2371 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2372
75b4f59c
YM
23732012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2374
2375 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2376 display for sliced images (Bug#10500).
2377
2378 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2379
f8aff4c6
JB
23802012-11-30 Juanma Barranquero <lekktu@gmail.com>
2381
2382 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2383 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2384
3940b924
DA
23852012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2386
2387 * xdisp.c (window_outdated): Remove eassert since it hits
2388 some suspicious corner cases (see Bug#13007 and Bug#13012).
2389 (mode_line_update_needed): New function.
2390 (redisplay_internal, redisplay_window): Use it.
2391 (ensure_selected_frame): New function.
2392 (redisplay_internal, unwind_redisplay): Use it.
2393 (redisplay_internal): Move comment about buffer_shared...
2394 (buffer_shared_and_changed): ...near to its real use.
2395
4a9204fe
PE
23962012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2397
2398 * callproc.c (Fcall_process): Don't misreport vfork failure.
2399
60aeceb8
PE
24002012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2401
2402 * callproc.c (Fcall_process): Fix vfork portability problems.
2403 Do not assume that fd[0], count, filefd, and save_environ survive
2404 vfork. Fix bug whereby wrong errno value could be reported for
2405 pipe failure. Some minor cleanups, too, as follows. Move buf and
2406 bufsize to the context where they're needed. Change new_argv to
2407 be of type char **, as this is more convenient and avoids casts.
2408 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2409 Now local constants, not macros.
2410
00dc3ead
KH
24112012-11-18 Kenichi Handa <handa@gnu.org>
2412
2413 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2414 for the variable "f".
2415
e1bf05c1
KH
24162012-11-13 Kenichi Handa <handa@gnu.org>
2417
2418 * font.c (font_unparse_xlfd): Exclude special characters from the
2419 generating XLFD name.
2420
22626a85
PE
24212012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2422
350e0088
PE
2423 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2424 * dired.c (stat_uname, stat_gname):
2425 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2426
22626a85
PE
2427 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2428 * dired.c (directory_files_internal, file_name_completion):
2429 Assume EAGAIN and EINTR are defined.
350e0088 2430
22626a85
PE
2431 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2432 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2433 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2434 * lread.c (readbyte_from_file): Assume EINTR is defined.
2435 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2436 Assume EIO and EAGAIN are defined.
2437 * unexcoff.c (write_segment): Assume EFAULT is defined.
2438
5c9cf0a3 24392012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
2440
2441 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2442 (Bug#11964)
2443
22294a56
EZ
2444 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2445 highlighting on the frame was cleared. Prevents assertion
2446 violations when repeatedly clicking on the "Top" link of the
2447 "bread-crumbs" in Info buffers.
2448
5fbab051
PE
24492012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2450
2451 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2452
bcd77a2b
KB
24532012-11-24 Ken Brown <kbrown@cornell.edu>
2454
2455 * keyboard.c (HAVE_MOUSE):
2456 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2457 were always defined.
2458
d125ca15 24592012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 2460
24becea4
EZ
2461 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2462 between bpos_covered and bpos_max. This fixes cursor display when
2463 several display strings follow each other.
2464
8654a41b
EZ
2465 * .gdbinit (pgx): If the glyph's object is a string, display the
2466 pointer to string data, rather than the value of the string object
2467 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2468
cb5867b1
EZ
2469 * indent.c (Fvertical_motion): If the starting position is covered
2470 by a display string, return to one position before that, to avoid
2471 overshooting it inside move_it_to. (Bug#12930)
2472
f418b22e
DA
24732012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2474
2475 * frame.h (struct frame): Remove display_preempted member
2476 since all users are dead long ago.
2477 * nsterm.h (struct x_output): Use the only dummy member.
2478 * w32menu.c (pending_menu_activation): Remove since not
2479 really used.
2480 (set_frame_menubar): Adjust user.
2481 * w32term.h (struct x_output): Drop outdated #if 0 code.
2482 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
2483 asked_for_visible and menubar_active members.
2484 Drop unused pending_menu_activation member.
f418b22e
DA
2485 * xterm.h (struct x_output): Drop outdated #if 0 code.
2486 Use bitfields for explicit_parent, asked_for_visible,
2487 has_been_visible and net_wm_state_hidden_seen members.
2488
a879f0ea
EZ
24892012-11-23 Eli Zaretskii <eliz@gnu.org>
2490
2491 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2492 of a literal "/". (Bug#12955)
2493 (gl-stamp): Invoke fc.exe directly, not through cmd.
2494
95ef7787
PE
24952012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2496
2497 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2498 * dired.c: Assume HAVE_DIRENT_H.
2499 (NAMLEN): Remove, replacing with ...
2500 (dirent_namelen): New function. All uses changed. Use the GNU macro
2501 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2502 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2503 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2504 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2505 $(NT_INC)/dirent.h.
2506 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2507 * ndir.h: Rename to ../nt/inc/dirent.h.
2508 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2509 Do not include <dirent.h>; no longer needed.
2510 * w32.c: Include <dirent.h> rather than "ndir.h".
2511
12645ae6
CY
25122012-11-23 Chong Yidong <cyd@gnu.org>
2513
2514 * xftfont.c (xftfont_open): Remove duplicate assignment.
2515
5c747675
DA
25162012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2517
2518 * alloc.c (Fgarbage_collect): Unblock input after clearing
2519 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2520 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2521 * msdos.c (IT_frame_up_to_date): Use it here...
2522 * w32term.c (w32_frame_up_to_date): ...here...
2523 * xterm.c (XTframe_up_to_date): ...and here...
2524 * nsterm.m (ns_frame_up_to_date): ...but not here.
2525 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2526 Adjust users.
2527 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2528 Do not check whether GC is in progress.
2529
6ceeb5f1
DA
25302012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2531
2532 * xdisp.c (window_buffer_changed): New function.
2533 (update_menu_bar, update_tool_bar): Use it to
2534 simplify large 'if' statements.
2535 (redisplay_internal): Generalize commonly used
2536 'tail' and 'frame' local variables.
2537
ec84768f
EZ
25382012-11-22 Eli Zaretskii <eliz@gnu.org>
2539
2540 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2541 with Windows system header.
2542
9239d970
PE
25432012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2544
2545 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2546 * alloc.c: Assume unistd.h exists.
2547 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2548 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2549 (getwd) [USG]: Remove; no longer needed.
2550 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2551 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2552 * w32.h (getcwd): Remove decl.
2553
954bba56
SM
25542012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2555
2556 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2557 Make it set selected_window as well.
2558 (update_tool_bar): Use it.
2559
6ef2e5ef 25602012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
2561
2562 * emacs.c (main): Set the G_SLICE environment variable for all
2563 Cygwin builds, not just GTK builds. See
2564 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2565
6ef2e5ef 25662012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
2567
2568 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2569 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2570 Define for the MSVC compiler.
2571
6ef2e5ef 2572 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
2573
2574 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2575 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2576 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
2577 dostounix_filename assumes it gets a unibyte string.
2578 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
2579 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2580
eadf1faa
SM
25812012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2582
2583 Conflate Qnil and Qunbound for `symbol-function'.
2584 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2585 * lread.c (init_obarray): Set `function' fields to Qnil.
2586 * eval.c (Fcommandp): Ignore Qunbound.
2587 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2588 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2589 Test NILP rather than Qunbound.
2590 (Ffmakunbound): Set to Qnil.
2591 (Fsymbol_function): Never signal an error.
2592 (Finteractive_form): Ignore Qunbound.
2593
b83fdfa9
PE
25942012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2595
2596 * eval.c (interactive_p): Remove no-longer-used decl.
2597
952580c5
DA
25982012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2599
2600 * xdisp.c (buffer_shared): Adjust comment.
2601 (buffer_shared_and_changed): New function.
2602 (prepare_menu_bars, redisplay_internal): Use it to
2603 decide whether all windows or frames should be updated.
ea6de9b1
DA
2604 (window_outdated): New function.
2605 (text_outside_line_unchanged_p, redisplay_window): Use it.
2606 (redisplay_internal): Likewise. Fix indentation.
952580c5 2607
23ba2705
SM
26082012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2609
2610 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2611 (syms_of_eval): Remove corresponding defsubr.
2612 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2613
6e9f7997
DC
26142012-11-19 Daniel Colascione <dancol@dancol.org>
2615
2616 * w32fns.c (Fx_file_dialog):
2617 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2618 cygwin_convert_file_name*.
2619
2620 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2621 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2622
552a1590
PE
26232012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2624
2625 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2626
2ac9538d 26272012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
2628
2629 * w32select.c: Include w32common.h before w32term.h, so that
2630 windows.h gets included before w32term.h uses some of its
2631 features, see below.
2632
23ba2705
SM
2633 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2634 New typedefs.
2635 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2636 New prototypes.
d8715cdf
EZ
2637 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2638
2ac9538d 26392012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
2640
2641 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2642 (ns_select): Return at once if events are held (Bug#12834).
2643
2ac9538d 26442012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 2645
2646 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2647 Needed following 2012-10-20 change. (Bug#12902)
2648
c1f7ba3a
JB
26492012-11-18 Juanma Barranquero <lekktu@gmail.com>
2650
2651 * w32proc.c (waitpid): Remove unused label get_result.
2652
a75ce9d3
JB
26532012-11-17 Juanma Barranquero <lekktu@gmail.com>
2654
2655 * makefile.w32-in (SYSWAIT_H): New macro.
2656 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2657 ($(BLD)/sysdep.$(O)): Update dependencies.
2658
49cdacda
PE
26592012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2660
2661 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2662 * callproc.c (relocate_fd): Assume F_DUPFD.
2663 * emacs.c, term.c (O_RDWR): Remove.
2664 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2665 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2666 * nsterm.m: Assume <fcntl.h> exists.
2667 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2668 (create_pty, Fmake_network_process, server_accept_connection)
2669 (wait_reading_process_output, init_process_emacs):
2670 Assume O_NONBLOCK.
2671 (wait_reading_process_output): Put in a special case for WINDOWSNT
2672 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2673 It's not clear this is needed, but it's a more-conservative change.
2674 (create_process): Assume FD_CLOEXEC.
2675 (create_process, create_pty): Assume O_NOCTTY.
2676 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2677 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2678 Omit if not DOS_NT, since F_GETFL is not defined there.
2679 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2680 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2681 (O_NOCTTY): Remove.
2682 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2683 lack it, since gnulib guarantees this.
2684 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2685
22bae83f
EZ
26862012-11-17 Eli Zaretskii <eliz@gnu.org>
2687
6ad30855
EZ
2688 * w32.c (faccessat): Pretend that directories have the execute bit
2689 set. Emacs expects that, e.g., in files.el:cd-absolute.
2690
22bae83f
EZ
2691 * w32proc.c (create_child): Don't clip the PID of the child
2692 process to fit into an Emacs integer, as this is no longer a
2693 restriction.
2694 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2695 reaping only the process specified by PID argument, if that is
2696 positive. Use PID instead of dead_child to know which process to
2697 reap. Wait for the child to die only if WNOHANG is not in
2698 OPTIONS.
2699 (sys_select): Don't set dead_child.
2700
2701 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2702 as it is no longer needed.
2703
2704 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2705 no longer needed.
2706 (record_child_status_change): Remove the setting of
2707 record_at_most_one_child for the !WNOHANG case.
2708
a631d0e0
PE
27092012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2710
2711 Fix problems in ns port found by static checking.
2712 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2713 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2714 not to process group.
2715 (ns_select): Use emacs_write, not write, as that's more robust
2716 in the presence of signals.
2717 (fd_handler:): Check for read errors.
2718
d56f2e49
GM
27192012-11-16 Glenn Morris <rgm@gnu.org>
2720
2721 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2722
96e05507 27232012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
2724
2725 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2726
96e05507 27272012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
2728
2729 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2730 use the same value of thread handle.
2731 (start_timer_thread): If the timer thread exited (due to error),
2732 clean up by closing the two handles it used. Duplicate the caller
2733 thread's handle here, so it gets duplicated only once, when
2734 launching the timer thread. Set priority of the timer thread, not
2735 the caller thread.
2736 (getitimer): Don't duplicate the caller thread's handle here.
2737 (Bug#12832)
2738
96e05507 27392012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
2740
2741 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2742 called (Bug#12834).
2743
3d082a26
PE
27442012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2745
2746 Remove no-longer-used pty_max_bytes variable.
2747 * process.c (pty_max_bytes): Remove; unused.
2748 (send_process): Do not set it.
2749
b72c161c
JB
27502012-11-15 Juanma Barranquero <lekktu@gmail.com>
2751
2752 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2753 Update dependencies.
2754
bf20ea80
PE
27552012-11-15 Paul Eggert <eggert@cs.ucla.edu>
2756
2757 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
2758 This follows up on the 2012-09-29 patch that removed indirection
2759 for the 'function' field. Reported by Sergey Vinokurov in
2760 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
2761
14f20728
EZ
27622012-11-14 Eli Zaretskii <eliz@gnu.org>
2763
2764 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
2765 different name, as the MS runtime does not have such a function,
2766 and probably never will.) All callers changed. Ignore DIRFD
2767 value if PATH is an absolute file name, to match Posix spec
2768 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
2769 symlinks.
2770
77731919
DA
27712012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
2772
2773 * xdisp.c (echo_area_display, redisplay_internal):
2774 Omit redundant check whether frame_garbaged is set.
2775
73dcdb9f
PE
27762012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2777
2778 Use faccessat, not access, when checking file permissions (Bug#12632).
2779 This fixes a bug that has been present in Emacs since its creation.
2780 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
2781 which must set some sort of record. (Torek's bug report was against
2782 a predecessor of GNU Emacs, but GNU Emacs happened to have the
2783 same common flaw.) See Torek's Usenet posting
2784 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
2785 Posted: Fri Apr 8 14:18:56 1983.
2786 * Makefile.in (LIB_EACCESS): New macro.
2787 (LIBES): Use it.
2788 * callproc.c (init_callproc):
2789 * charset.c (init_charset):
2790 * fileio.c (check_existing, check_executable, check_writable)
2791 (Ffile_readable_p):
2792 * lread.c (openp, load_path_check):
2793 * process.c (allocate_pty):
2794 * xrdb.c (file_p):
2795 Use effective UID when checking permissions, not real UID.
2796 * callproc.c (init_callproc):
2797 * charset.c (init_charset):
2798 * lread.c (load_path_check, init_lread):
2799 Test whether directories are accessible, not merely whether they exist.
2800 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
2801 * fileio.c (check_existing, check_executable, check_writable)
2802 (Ffile_readable_p):
2803 Use symbolic names instead of integers for the flags, as they're
2804 portable now.
2805 (check_writable): New arg AMODE. All uses changed.
2806 Set errno on failure.
2807 (Ffile_readable_p): Use faccessat, not stat + open + close.
2808 (Ffile_writable_p): No need to call check_existing + check_writable.
2809 Just call check_writable and then look at errno. This saves a syscall.
2810 dir should never be nil; replace an unnecessary runtime check
2811 with an eassert. When checking the parent directory of a nonexistent
2812 file, check that the directory is searchable as well as writable, as
2813 we can't create files in unsearchable directories.
2814 (file_directory_p): New function, which uses 'stat' on most platforms
2815 but faccessat with D_OK (for efficiency) if WINDOWSNT.
2816 (Ffile_directory_p, Fset_file_times): Use it.
2817 (file_accessible_directory_p): New function, which uses a single
2818 syscall for efficiency.
2819 (Ffile_accessible_directory_p): Use it.
2820 * xrdb.c (file_p): Use file_directory_p.
2821 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
2822 * lread.c (openp): When opening a file, use fstat rather than
2823 stat, as that avoids a permissions race. When not opening a file,
2824 use file_directory_p rather than stat.
2825 (dir_warning): First arg is now a usage string, not a format.
2826 Use errno. All uses changed.
2827 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
2828 that merely introduced a race.
2829 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
2830 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
2831 and similarly for the other O_* flags.
2832 * w32.c (sys_faccessat): Rename from sys_access and switch to
2833 faccessat's API. All uses changed.
2834 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
2835 (magic_db): Rename from magic_file_p.
2836 (magic_db, search_magic_path): Return an XrmDatabase rather than a
2837 char *, so that we don't have to test for file existence
2838 separately from opening the file for reading. This removes a race
2839 fixes a permission-checking problem, and simplifies the code.
2840 All uses changed.
2841 (file_p): Remove; no longer needed.
2842
2a14f83b
DA
28432012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2844
2845 Omit glyphs initialization at startup.
2846 * dispnew.c (glyphs_initialized_initially_p): Remove.
2847 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2848 (Fredraw_frame): Move actual code from here...
c7085245 2849 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
2850 (Fredraw_display): Use redraw_frame.
2851 * xdisp.c (clear_garbaged_frames): Likewise.
2852
f78ee6af 28532012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
2854
2855 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2856 passed to pint2str and pint2hrstr to be at most the size of the
2857 frame's decode_mode_spec_buffer. This avoids crashes with very
2858 large values of FIELD_WIDTH argument to decode_mode_spec.
2859 (Bug#12867)
2860
b95a9c0c
PE
28612012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2862
2863 Fix a race with verify-visited-file-modtime (Bug#12863).
2864 Since at least 1991 Emacs has ignored an mtime difference of no
2865 more than one second, but my guess is that this was to work around
2866 file system bugs that were fixed long ago. Since the race is
2867 causing problems now, let's remove that code.
2868 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2869 whose time stamp is off by no more than a second. Insist that the
2870 file time stamps match exactly.
2871
be49ba74
DA
28722012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2873
2874 * frame.h (struct frame): Convert external_tool_bar member to
2875 1-bit unsigned bitfield.
2876 * termhooks.h (struct terminal): Remove mouse_moved member since
2877 all users are long dead. Adjust comment on mouse_position_hook.
2878
5b04e9f9
DA
28792012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2880
2881 Simplify by using FOR_EACH_FRAME here and there.
2882 * frame.c (next_frame, prev_frame, other_visible_frames)
2883 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2884 * w32term.c (x_window_to_scroll_bar): Likewise.
2885 * window.c (window_list): Likewise.
2886 * xdisp.c (x_consider_frame_title): Likewise.
2887 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2888 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2889 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2890 * xmenu.c (menubar_id_to_frame): Likewise.
2891 * xselect.c (frame_for_x_selection): Likewise.
2892 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2893 (x_window_to_menu_bar): Likewise.
2894 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2895
76ae24d7
PE
28962012-11-12 Paul Eggert <eggert@cs.ucla.edu>
2897
12cc4337
PE
2898 * data.c (Qdefalias_fset_function): Now static.
2899
76ae24d7
PE
2900 Another tweak to vectorlike_header change.
2901 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
2902 Remove, and replace all uses with ...
2903 (next_in_free_list, set_next_in_free_list):
2904 New functions, which respect C's aliasing rules better.
2905
1479c557
PE
29062012-11-11 Paul Eggert <eggert@cs.ucla.edu>
2907
2908 * window.c (list4i): Rename from 'quad'. All uses changed.
2909 Needed because <sys/types.h> defines 'quad' on Solaris 10.
2910
11235c03
JB
29112012-11-11 Juanma Barranquero <lekktu@gmail.com>
2912
2913 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
2914 warning about mixing declarations and code in ISO C90.
2915
6baf66d5 29162012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
2917
2918 * window.c (Fsplit_window_internal): Set combination limit of
2919 new parent window to t iff Vwindow_combination_limit is t;
2920 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 2921 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 2922
6baf66d5 29232012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
2924
2925 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
2926 amount when the scroll margins are too large. When scrolling
2927 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
2928 scroll margin within a reasonable number of screen lines.
2929 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
2930 point is positioned many lines beyond the window top/bottom.
2931 (Bug#12811)
2932
508f51f5
EZ
2933 * ralloc.c (relinquish): If real_morecore fails to return memory
2934 to the system, don't crash; instead, leave the last heap
2935 unchanged and return. (Bug#12774)
2936
32e5c58c
SM
29372012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2938
2939 * lisp.h (AUTOLOADP): New macro.
2940 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
2941 * data.c (Ffset): Remove special ad-advice-info handling.
2942 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
2943 (Fsubr_arity): CSE.
2944 (Finteractive_form): Simplify.
2945 (Fquo): Don't insist on having at least 2 arguments.
2946 (Qdefalias_fset_function): New var.
2947
719b0aa5
JD
29482012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2949
4ab15c3e
JD
2950 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
2951
719b0aa5
JD
2952 * nsfont.m (Qcondensed, Qexpanded): New variables.
2953 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
2954 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
2955
535cc8e9
DA
29562012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2957
2958 Fix recently introduced crash on MS-Windows (Bug#12839).
2959 * w32term.h (struct scroll_bar): Use convenient header.
2960 (SCROLL_BAR_VEC_SIZE): Remove.
2961 * w32term.c (x_scroll_bar_create): Use VECSIZE.
2962
7d377c48
DA
29632012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2964
2965 Tweak last vectorlike_header change.
2966 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
2967 vectorlike object on the free list. This is introduced to avoid
2968 some (but not all) pointer casting and aliasing problems, see
2969 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
2970 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
2971 objects.
2972 (xvectype, xvecsize): Use them to examine Lisp_Object values.
2973
7ad27466
JD
29742012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2975
32e5c58c 2976 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
2977 been removed, so remove them here also.
2978
57618ecf
SM
29792012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2980
2981 * doc.c (Fdocumentation): Handle new property
2982 dynamic-docstring-function to replace the old ad-advice-info.
2983
53371430
PE
29842012-11-09 Paul Eggert <eggert@cs.ucla.edu>
2985
2986 * fns.c (Qeql, hashtest_eq): Now static.
2987
61ddb1b9
SM
29882012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2989
2990 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
2991 * fns.c (hashfn_eq, hashfn_eql, sxhash):
2992 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
2993 * buffer.c (compare_overlays): Use XLI rather than XHASH.
2994
04a2d0d3
PE
29952012-11-08 Paul Eggert <eggert@cs.ucla.edu>
2996
2997 Use same hash function for hashfn_profiler as for hash_string etc.
2998 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
2999 * lisp.h (sxhash_combine): New inline function, with the contents
3000 of the old SXHASH_COMBINE.
3001 * profiler.c (hashfn_profiler): Use it, instead of having a
3002 special hash function containing a comparison that always yields 1.
3003
de5ef41a
SM
30042012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3005
3006 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3007 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3008 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3009 Remove unused vars.
3010
a23c4171
JD
30112012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3012
3013 * image.c (xpm_make_color_table_h): Fix compiler error because
3014 make_hash_table changed.
3015
0b59090b 30162012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
3017
3018 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3019
b7432bb2
SM
30202012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3021
3022 Use ad-hoc comparison function for the profiler's hash-tables.
3023 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3024 (make_log): Use them.
3025 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3026 call Fequal any more.
3027 (Ffunction_equal): New function.
3028 (cmpfn_profiler, hashfn_profiler): New functions.
3029 (syms_of_profiler): Initialize them.
3030 * lisp.h (struct hash_table_test): New struct.
3031 (struct Lisp_Hash_Table): Use it.
3032 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3033 * fns.c (make_hash_table): Take a struct to describe the test.
3034 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3035 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3036 (hash_lookup, hash_remove_from_table): Move assertion checking of
3037 hashfn result here. Check hash-equality before calling cmpfn.
3038 (Fmake_hash_table): Adjust call to make_hash_table.
3039 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3040 (syms_of_fns): Initialize them.
3041 * emacs.c (main): Move syms_of_fns earlier.
3042 * xterm.c (syms_of_xterm):
3043 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3044 * print.c (print_object): Adjust to new hash-table struct.
3045 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3046
88002743
EZ
30472012-11-08 Eli Zaretskii <eliz@gnu.org>
3048
3049 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3050 value of w32-scroll-lock-modifier is neither nil nor one of the
3051 known key modifiers. (Bug#12806)
3052
914adc42
DA
30532012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3054
3055 Shrink struct vectorlike_header to the only size field.
3056 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3057 Adjust comment.
3058 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3059 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3060 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3061 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3062 information from the vector header. Adjust comment.
3063 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3064 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3065 layout.
3066 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3067 (struct vectorlike_header): Remove next member. Adjust comment.
3068 (struct Lisp_Subr): Add convenient header. Adjust comment.
3069 (allocate_pseudovector): Adjust prototype.
3070 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3071 (sweep_string, lisp_malloc): Remove useless prototypes.
3072 (enum mem_type): Adjust comment.
3073 (NEXT_IN_FREE_LIST): New macro.
3074 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3075 (Fmake_bool_vector): Likewise.
3076 (struct large_vector): New type to represent allocation unit for
3077 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3078 (large_vectors): Change type to struct large_vector.
3079 (allocate_vector_from_block): Simplify.
3080 (PSEUDOVECTOR_NBYTES): Replace with...
3081 (vector_nbytes): ...new function. Adjust users.
3082 (sweep_vectors): Adjust processing of large vectors.
3083 (allocate_vectorlike): Likewise.
3084 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3085 Add easserts. Adjust XSETPVECTYPESIZE usage.
3086 (allocate_buffer): Use BUFFER_PVEC_INIT.
3087 (live_vector_p): Adjust to match large vector.
3088 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3089 * buffer.h (struct buffer): Add next member.
3090 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3091 New macros.
3092 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3093 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3094 (copy_hash_table): Adjust to match vector header change.
3095 * lread.c (defsubr): Use XSETPVECTYPE.
3096 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3097 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3098 (xvecsize): New command.
3099
c66f21ea
DA
31002012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3101
3102 * keyboard.c (event_to_kboard): Do not dereference
3103 frame_or_window field of SELECTION_REQUEST_EVENT
3104 and SELECTION_CLEAR_EVENT events (Bug#12814).
3105 * xterm.h (struct selection_input_event): Adjust comment.
3106
eb147960
EZ
31072012-11-07 Eli Zaretskii <eliz@gnu.org>
3108
dab72075
EZ
3109 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3110 such as Scroll Lock, if the respective keys are treated as
3111 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 3112 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 3113
5890e400
DA
31142012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3115
3116 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3117
b6b3b294
PE
31182012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3119
3120 Restore some duplicate definitions (Bug#12814).
3121 This undoes part of the 2012-11-03 changes. Some people build
3122 with plain -g rather than with -g3, and they need the duplicate
3123 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3124 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3125 Define as macros, as well as as enums or as constants.
3126
e770aad5
JD
31272012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3128
3129 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3130 to keypad keys (Bug#12816).
3131
68f8f1c0
PE
31322012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3133
3134 Minor adjustments of recently-changed frame functions.
3135 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3136 known to be a frame (we're in the FRAMEP branch).
3137 * lisp.h (Qframep): Remove decl. frame.h declares this.
3138 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3139 since they're meant for Lisp fixnum values.
3140
72f94d4b
DA
31412012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3142
3143 * window.c (Fwindow_combination_limit): Revert to the only
3144 required argument and adjust docstring as suggested in
3145 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3146 by Martin Rudalics <rudalics@gmx.at>.
3147
d9f07150
DA
31482012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3149
3150 Widely used frame validity and checking functions.
3151 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3152 * frame.c (decode_live_frame, decode_any_frame): New functions.
3153 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3154 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3155 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3156 (Fframe_pointer_visible_p): Use decode_any_frame.
3157 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3158 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3159 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3160 (Fframe_focus): Likewise. Allow zero number of arguments.
3161 Adjust docstring.
3162 (frame_buffer_list, frame_buffer_predicate): Remove.
3163 * lisp.h (frame_buffer_predicate): Remove prototype.
3164 * buffer.c (Fother_buffer): Use decode_any_frame.
3165 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3166 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3167 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3168 (Fclose_font, Ffont_info): Use decode_live_frame.
3169 * fontset.c (check_fontset_name): Likewise.
3170 * terminal.c (Fframe_terminal): Likewise.
3171 * w32fns.c (check_x_frame): Likewise.
3172 * window.c (Fminibuffer_window, Fwindow_at)
3173 (Fcurrent_window_configuration): Likewise.
3174 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3175 Likewise. Allow zero number of arguments. Adjust docstring.
3176 * dispnew.c (Fredraw_frame): Likewise.
3177 * xfaces.c (frame_or_selected_frame): Remove.
3178 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3179 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3180 (Fframe_face_alist): Use decode_live_frame.
3181 * xfns.c (check_x_frame): Likewise.
3182
89bc0592
DA
31832012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3184
3185 * window.c (quad): New function.
3186 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3187 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3188 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3189 (Fwindow_line_height): Use it.
3190 (Fwindow_fringes): Use list3.
3191 (Fwindow_scroll_bars): Use list4.
3192 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3193 (Fwindow_combination_limit): Allow zero number of arguments.
3194
c8e3a9c3
EZ
31952012-11-05 Eli Zaretskii <eliz@gnu.org>
3196
3197 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3198
8e2417bf 3199 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 3200 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 3201 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 3202
209c6a58
CY
32032012-11-05 Chong Yidong <cyd@gnu.org>
3204
3205 * process.c (wait_reading_process_output): Revert previous change.
3206
8148369c
PE
32072012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3208
dd0333b6
PE
3209 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3210 This removes code that has been obsolete since around 1990.
3211 * callproc.c (Fcall_process):
3212 * emacs.c (main):
3213 * process.c (create_process):
3214 * term.c (dissociate_if_controlling_tty):
3215 Assume setsid exists.
3216 * callproc.c (child_setup): Assume setpgid exists and behaves as
3217 per POSIX.1-1988 or later.
3218 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3219 * emacs.c (shut_down_emacs):
3220 * sysdep.c (sys_suspend, init_foreground_group):
3221 Assume getpgrp behaves as per POSIX.1-1998 or later.
3222 * msdos.c (setpgrp): Remove.
3223 (tcgetpgrp, setpgid, setsid): New functions.
3224 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3225 * term.c (no_controlling_tty): Remove; unused.
3226 * w32proc.c (setpgrp): Remove.
3227 (setsid, tcgetpgrp): New functions.
3228
8148369c
PE
3229 Simplify by assuming __fpending.
3230 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3231 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3232 Do not assume that __fpending's result fits in int.
3233
76abf5e5
PE
32342012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3235
06b63c9b
PE
3236 Remove EMACS_OUTQSIZE+sleep hack.
3237 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
3238 than 2400 bps, which throttled Emacs by having it sleep.
3239 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
3240 was added, and anyway those old terminals are long dead.
3241 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3242 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3243
76abf5e5
PE
3244 Fix data-loss with --version (Bug#9574).
3245 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3246 as we can't assume that emacs_strerror is initialized, and strerror
3247 is good enough here.
3248 (main): Invoke atexit earlier, to catch earlier instances of
3249 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3250
8f31e74b
MM
32512012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3252
3253 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3254 (keyDown): Remap keypad keys to X11 virtual key codes.
3255
0d879dca
PE
32562012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3257
7ccfb720
PE
3258 Fix data-loss with --batch (Bug#9574).
3259 * emacs.c: Include <close-stream.h>.
3260 (close_output_streams): New function.
3261 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3262 and handles errors appropriately.
3263 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3264 does that now.
3265
0b3d4a47
PE
3266 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3267 The symptom is a diagnostic "GLib-WARNING **: In call to
3268 g_spawn_sync(), exit status of a child process was requested but
3269 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3270 waitpid(), so exit status can't be returned." The diagnostic
3271 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3272 The real bug is a race condition between Emacs and glib: Emacs
3273 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3274 so that glib can't find it. Work around the bug by invoking
3275 waitpid only on subprocesses that Emacs itself creates.
3276 * process.c (create_process, record_child_status_change):
3277 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
3278 know the pid rather than having the callee infer it.
3279 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
3280 (create_process): Set new 'alive' member if child is created.
3281 (process_status_retrieved): New function.
3282 (record_child_status_change): Use it.
3283 Accept negative 1st argument, which means to wait for the
3284 processes that Emacs already knows about. Move special-case code
3285 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3286 processes that have already been waited for, by testing and
3287 clearing new 'alive' member.
3288 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3289 now does this internally.
3290 (handle_child_signal): Let record_child_status_change do all
3291 the work, since we do not want to reap all exited child processes,
3292 only the child processes that Emacs itself created.
3293 * process.h (Lisp_Process): New boolean member 'alive'.
3294
0d879dca
PE
3295 Omit duplicate definitions no longer needed with gcc -g3.
3296 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3297 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3298 Define only as macros. There's no longer any need to also define
3299 these symbols as enums or as constants, since we now assume
3300 gcc -g3 when debugging.
3301
3478f4b5
EZ
33022012-11-03 Eli Zaretskii <eliz@gnu.org>
3303
3304 * lisp.mk: Adjust comments to the fact that term/internal is now
3305 loaded from loadup.el.
3306
3307 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3308 (msdos_fatal_signal): New function.
3309 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3310 its argument list.
3311
3312 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3313 for GCC versions before 4.
3314 (emacs_raise): Define to call msdos_fatal_signal.
3315
3316 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3317 iterator when starting in the middle of a display or overlay
3318 string. (Bug#12745)
3319
85fabcb7
CY
33202012-11-03 Chong Yidong <cyd@gnu.org>
3321
3322 * process.c (wait_reading_process_output): Clean up the last
3323 change.
3324
893cc455
CY
33252012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3326
3327 * process.c (wait_reading_process_output): Avoid a race condition
3328 with SIGIO delivery (Bug#11536).
3329
0f7b074f
CY
33302012-11-03 Chong Yidong <cyd@gnu.org>
3331
3332 * buffer.c (cursor_type): Untabify docstring.
3333
3737fee7
DA
33342012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3335
3336 * frame.h (struct frame): Drop can_have_scroll_bars member
3337 which is meaningless for a long time. Adjust comments.
3338 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3339 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3340
b6a9e8b1
DA
33412012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3342
3343 * window.c (decode_next_window_args): Update window arg after
3344 calling decode_live_window and so fix crash reported at
3345 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3346 by Juanma Barranquero <lekktu@gmail.com>.
3347 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3348 * font.c (Ffont_at): Likewise.
3349
600d4768
JD
33502012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3351
3352 * widget.c (resize_cb): New function.
3353 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3354 (EmacsFrameResize): Check if all is up to date before changing frame
3355 size.
3356
1005b4b9
EZ
33572012-11-02 Eli Zaretskii <eliz@gnu.org>
3358
3359 Implement backtrace output for fatal errors on MS-Windows.
3360 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3361 (BACKTRACE_LIMIT_MAX): New macro.
3362 (w32_backtrace): New function.
3363 (emacs_abort): Use w32_backtrace when the user chooses not to
3364 attach a debugger. Update the text of the abort dialog.
3365
b9e9df47
DA
33662012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3367
3368 Window-related stuff cleanup here and there.
3369 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3370 Use decode_any_window.
3371 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3372 * xdisp.c (Fformat_mode_line): Likewise.
3373 * font.c (Ffont_at): Use decode_live_window.
3374 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3375 * window.c (decode_next_window_args): Likewise.
3376 (decode_any_window): Remove static.
3377 * window.h (decode_any_window): Add prototype.
3378 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3379 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3380 respectively.
3381
2b371ff7
DA
33822012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3383
3384 Remove pad from struct input_event.
3385 * termhooks.h (struct input_event): Remove padding field.
3386 Adjust comment.
3387 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3388 member is never cons for a long time. Adjust comment.
3389 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3390 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3391 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3392 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3393
7e8b50d9
EZ
33942012-11-01 Eli Zaretskii <eliz@gnu.org>
3395
3396 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3397
322aea6d
PE
33982012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3399
3400 Fix crash when using Emacs as commit editor for git (Bug#12697).
3401 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3402 and it is configured in conf_post.h.
3403 (Fcall_process): Don't invoke both setsid and setpgid; the former
3404 is enough, if it exists.
3405 * callproc.c (Fcall_process, child_setup):
3406 * process.c (create_process): Use setpgid.
3407 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3408 for the real thing.
3409 * dispnew.c (init_display): Initialize the foreground group
3410 if we are running a tty display.
3411 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3412 * lisp.h (init_foreground_group): New decl.
3413 * sysdep.c (inherited_pgroup): New static var.
3414 (init_foreground_group, tcsetpgrp_without_stopping)
3415 (narrow_foreground_group, widen_foreground_group): New functions.
3416 (init_sys_modes): Narrow foreground group.
3417 (reset_sys_modes): Widen foreground group.
3418
220cb2bd
MA
34192012-10-31 Michael Albinus <michael.albinus@gmx.de>
3420
3421 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3422
218e997a
MR
34232012-10-31 Martin Rudalics <rudalics@gmx.at>
3424
3425 * minibuf.c (read_minibuf): Restore current buffer since
3426 choose_minibuf_frame calling Fset_frame_selected_window may
3427 change it (Bug#12766).
3428
02615da0
JD
34292012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3430
3431 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3432
aee5b18e
KH
34332012-10-30 Kenichi Handa <handa@gnu.org>
3434
3435 * font.c (Ffont_at): If WINDOW is specified and it is not
3436 displaying the current buffer, signal an error.
3437
ba116008
DC
34382012-10-29 Daniel Colascione <dancol@dancol.org>
3439
de5ef41a
SM
3440 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3441 In preparation for fixing bug#12739, move these functions from
ba116008
DC
3442 here...
3443
3444 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
3445 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3446 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 3447
640bf8ad
EZ
34482012-10-28 Eli Zaretskii <eliz@gnu.org>
3449
3450 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3451 (timer_loop, getitimer, setitimer): Use it instead of
3452 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3453 'clock'.
3454 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3455 literal 10000.
3456
64ccff5f
JD
34572012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3458
3459 * nsterm.m (NO_APPDEFINED_DATA): New define.
3460 (last_appdefined_event_data): New variable
3461 (last_appdefined_event): Remove.
3462 (ns_select): Initialize t from last_appdefined_event_data instead
3463 of [last_appdefined_event data1].
3464 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3465 remove last_appdefined_event (Bug#12698).
3466
e483264c
SM
34672012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3468
3469 * frame.c (x_set_font): Catch internal error.
3470
6c16c13e
EZ
34712012-10-27 Eli Zaretskii <eliz@gnu.org>
3472
e483264c
SM
3473 Avoid overflow in w32 implementation of interval timers.
3474 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
3475 actually executes.
3476 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
3477 'volatile ULONGLONG' types. All the other data which was
3478 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
3479 (GetThreadTimes_Proc): New typedef.
3480 (w32_get_timer_time): New function, returns a suitable time value
3481 for the timer.
3482 (timer_loop): Enter critical section when accessing ULONGLONG
3483 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
3484 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3485 Remove unused variable.
6c16c13e
EZ
3486 (init_timers): Initialize s_pfn_Get_Thread_Times.
3487 (start_timer_thread): Don't assign itimer->caller_thread here.
3488 (getitimer): Assign itimer->caller_thread here.
3489 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 3490 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 3491
ccc83f50
EZ
34922012-10-26 Eli Zaretskii <eliz@gnu.org>
3493
3494 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3495 mouse movement events if the menu bar is active. This avoids
3496 producing a busy "hour-glass" cursor by Windows if the mouse
3497 pointer is positioned over a tooltip shown for some menu item.
3498
69deda53
PE
34992012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3500
3501 Don't assume process IDs fit in int.
3502 * emacs.c (shut_down_emacs) [!DOS_NT]:
3503 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3504 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3505 Use pid_t, not int, to store process IDs, as 'int'
3506 is not wide enough on a few platforms (e.g., AIX and IRIX).
3507
7e70a152
KH
35082012-10-23 Kenichi Handa <handa@gnu.org>
3509
3510 The following change is to make face-font-rescale-alist work
3511 correctly for non-ASCII fonts.
3512
3513 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3514 (font_open_for_lface): Handle Vface_font_rescale_alist.
3515
49238e7f
CY
35162012-10-23 Chong Yidong <cyd@gnu.org>
3517
3518 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3519
5ec86886
JD
35202012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3521
ef446959
JD
3522 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3523 for screen font.
3524 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3525
5ec86886
JD
3526 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3527 event (Bug#12681).
3528
ee7a418d
GM
35292012-10-21 Glenn Morris <rgm@gnu.org>
3530
3531 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3532
4973679b
PE
35332012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3534
3535 Port to OpenBSD 5.1.
3536 * frame.c (Fmouse_position, Fmouse_pixel_position):
3537 * xdisp.c (produce_stretch_glyph):
3538 Declare local vars only when they're needed.
3539 This is clearer and avoids a warning on OpenBSD about unused vars.
3540 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3541 This is safer, and avoids OpenBSD warnings about unused vars.
3542 * keyboard.c (record_menu_key): Remove unnecessary decl.
3543 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3544 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3545 as our definition clashes with OpenBSD's.
3546 * xfaces.c (load_face_colors, check_lface_attrs)
3547 (get_lface_attributes_no_remap, get_lface_attributes)
3548 (lface_fully_specified_p, x_supports_face_attributes_p)
3549 (tty_supports_face_attributes_p, face_fontset, realize_face)
3550 (realize_x_face, realize_tty_face):
3551 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3552 merely Lisp_Object *. This is more informative and avoids
3553 a warning on OpenBSD about accessing beyond an object's size.
3554
c664f463
CY
35552012-10-20 Chong Yidong <cyd@gnu.org>
3556
3557 * lread.c (Fload): Doc fix (Bug#12592).
3558
6ec83f92 35592012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
3560
3561 * font.c (Ffont_at): Fix previous change.
3562
d2824928
EZ
35632012-10-19 Eli Zaretskii <eliz@gnu.org>
3564
e483264c
SM
3565 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3566 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
3567 for the reasons.
3568
d2824928
EZ
3569 * alloc.c (NSTATICS): Decrease to 0x800.
3570
f60d391f
SM
35712012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3572
4a0e1924 3573 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
3574 error (bug#12677).
3575
1a9327d5
JD
35762012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3577
3578 * nsterm.m (ns_select): Check writefds before call to
3579 FD_ISSET (Bug#12668).
3580
14145a1e
DC
35812012-10-18 Daniel Colascione <dancol@dancol.org>
3582
3583 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3584 (staticpro): If we run out of staticpro slots, die with an
3585 informative error instead of just calling emacs_abort.
3586
1f76f6f5
MR
35872012-10-18 Martin Rudalics <rudalics@gmx.at>
3588
3589 Fix two flaws reported by Dmitry Antipov.
3590 * window.c (Ftemp_output_buffer_show): Remove.
3591 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3592 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3593
fcf14875
EZ
35942012-10-17 Eli Zaretskii <eliz@gnu.org>
3595
1f76f6f5
MR
3596 * makefile.w32-in ($(BLD)/w32.$(O)):
3597 ($(BLD)/vm-limit.$(O)):
3598 ($(BLD)/term.$(O)):
3599 ($(BLD)/unexw32.$(O)):
3600 ($(BLD)/fileio.$(O)):
a68089e4
EZ
3601 ($(BLD)/dispnew.$(O)): Update dependencies.
3602
3603 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3604 Add prototypes.
3605
3606 * w32proc.c: Include ctype.h.
3607
3608 * w32.h (init_environment, check_windows_init_file)
3609 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3610 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3611 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3612 (sys_link): Add prototypes.
3613
3614 * w32.c: Include w32select.h.
3615 (sys_access, e_malloc, sys_select): Add prototypes.
3616 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3617
3618 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3619
3620 * unexw32.c: Include lisp.h and w32.h.
3621
3622 * term.c [WINDOWSNT]: Include w32term.h.
3623
3624 * process.c [WINDOWSNT]: Add prototype of sys_select.
3625
3626 * fileio.c [WINDOWSNT]: Include w32.h.
3627
3628 * dispnew.c [WINDOWSNT]: Include w32.h.
3629
fcf14875
EZ
3630 * cygw32.c (Fcygwin_convert_path_to_windows)
3631 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3632 Lisp_Object values. (Bug#12661)
3633
3634 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3635 to Lisp_Object. (Bug#12661)
3636
fe0b1ec4
KH
36372012-10-17 Kenichi Handa <handa@gnu.org>
3638
3639 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3640 invalidate.
3641
d556ebf9
DA
36422012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3643
3644 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 3645 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 3646
f0863a54
DA
36472012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3648
3649 Do not verify indirection counters of killed buffers (Bug#12579).
3650 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3651 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3652
12fbe755
DA
36532012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3654
3655 * alloc.c (Fmake_byte_code): Fix typo in comment.
3656 * print.c (print_interval): Define as static to match prototype.
3657 * indent.c (disptab_matches_widthtab, recompute_width_table):
3658 Convert to eassert.
3659
61655b89
DA
36602012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3661
3662 * editfns.c (get_system_name): Remove.
3663 * lisp.h (get_system_name): Remove prototype.
3664 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3665 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3666
9520f2f2
DC
36672012-10-15 Daniel Colascione <dancol@dancol.org>
3668
3669 * dbusbind.c: Add comment explaining reason for previous change.
3670
dca778d5
MR
36712012-10-15 Martin Rudalics <rudalics@gmx.at>
3672
3673 * window.c (Fwindow_end): Rewrite check whether cached position
3674 can be used (Bug#12600).
3675 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3676 Set windows_or_buffers_changed.
3677
3e0341b0
DC
36782012-10-15 Daniel Colascione <dancol@dancol.org>
3679
3680 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3681 enabled by undefining the symbol "interface", which the platform
3682 headers define to something incompatible.
3683
33d4113c
DC
36842012-10-14 Daniel Colascione <dancol@dancol.org>
3685
3686 * image.c (init_tiff_functions, init_imagemagick_functions)
3687 (init_svg_functions): Fix cygw32 build break by using these
3688 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3689
a36fb15e
JD
36902012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3691
3692 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3693
537f336d
JD
36942012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3695
3696 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3697
0ba06a77
KH
36982012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3699
3700 * coding.c (detect_coding): Set coding->id before calling
3701 this->detector.
3702
ce2fe65a
AS
37032012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3704
3705 * fileio.c: Formatting fixes.
3706
d6453ce4
PE
37072012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3708
3709 Fix some stat-related races.
3710 * fileio.c (Fwrite_region): Avoid race condition if a file is
3711 removed or renamed by some other process immediately after Emacs
3712 writes it but before Emacs stats it. Do not assume that stat (or
3713 fstat) succeeds.
3714 * image.c (slurp_file): Resolve the file name with fopen + fstat
3715 rather than stat + fopen.
3716 (pbm_read_file) [0]: Remove unused code with stat race.
3717 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3718 Remove ineffective code with stat race.
3719
06485aa8
SM
37202012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3721
3722 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3723
167e3640
JD
37242012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3725
3726 * nsterm.m (hold_event_q): New static variable.
3727 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3728 ! q_event_ptr.
3729 (hold_event): New function.
3730 (ns_read_socket): If hold_event_q have events, store them and
3731 return (Bug#12384).
3732 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3733 is zero (Bug#12384).
3734
c40239df
JB
37352012-10-12 Juanma Barranquero <lekktu@gmail.com>
3736
3737 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3738
bb385a92
EZ
37392012-10-12 Eli Zaretskii <eliz@gnu.org>
3740
2a9f1099
EZ
3741 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3742
bb385a92
EZ
3743 * fileio.c (check_existing): New function.
3744 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3745 instead of calling 'stat', when what's needed is to check whether
3746 a file exists. This avoids expensive system calls on MS-Windows.
3747 (Bug#12587)
3748
8599b23a 3749 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
3750
3751 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3752 determine whether a file exists and is not a directory.
3753
3754 * lisp.h (check_existing): Add prototype.
3755
2b9c2e68
JD
37562012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3757
3758 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
3759
81749a23
GM
37602012-10-12 Glenn Morris <rgm@gnu.org>
3761
3762 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
3763
5253a5fd
SM
37642012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3765
389a94a5
SM
3766 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
3767
5253a5fd
SM
3768 * eval.c (Fautoload): Remember previous autoload status in load-history.
3769
7cded46f
PE
37702012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3771
3772 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
3773 * lread.c (load_each_byte, new_backquote_flag, readchar)
3774 (read_filtered_event, lisp_file_lexically_bound_p)
3775 (safe_to_load_version, Fload, complete_filename_p, openp)
3776 (build_load_history, readevalloop, read_escape, read1)
3777 (string_to_number, read_vector, read_list):
3778 * macros.c (Fstart_kbd_macro):
3779 * marker.c (CONSIDER):
3780 * menu.c (parse_single_submenu, digest_single_submenu)
3781 (find_and_return_menu_selection, Fx_popup_menu):
3782 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
3783 (Ftry_completion):
3784 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
3785 (ns_menu_show):
3786 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
3787 (xmenu_show, xdialog_show):
3788 Use bool for booleans.
3789 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
3790 as it's not a predicate. All uses changed. Omit unnecessary
3791 buffer termination.
3792
549c3414
DA
37932012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
3794
3795 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
3796 (save_excursion_restore): Do not restore mark if it was not saved.
3797
e85aafe7
PE
37982012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3799
fd2f90cf
PE
3800 * marker.c (cached_modiff): EMACS_INT, not int.
3801
c1af190b
PE
3802 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
3803 instead of having a wrong decl.
e85aafe7
PE
3804 * nsmenu.m (waiting_for_input): Remove wrong decl.
3805
e738ca56
PE
38062012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3807
9fa1de30
PE
3808 keyboard.c, keymap.c: Use bool for booleans.
3809 * dispnew.c (sit_for): Distinguish between 3-way display_option
3810 and boolean do_display.
3811 * keyboard.c (single_kboard, this_command_key_count_reset)
3812 (waiting_for_input, echoing, immediate_quit, input_pending)
3813 (interrupt_input, interrupts_deferred, pop_kboard)
3814 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
3815 (command_loop_1, adjust_point_for_property)
3816 (safe_run_hooks_error, input_polling_used, read_char):
3817 (help_char_p, readable_events, kbd_buffer_events_waiting)
3818 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
3819 (lucid_event_type_list_p, get_input_pending):
3820 (gobble_input, menu_separator_name_p, menu_bar_item)
3821 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
3822 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
3823 (keyremap_step, test_undefined, read_key_sequence)
3824 (detect_input_pending, detect_input_pending_ignore_squeezables)
3825 (detect_input_pending_run_timers, requeued_events_pending_p)
3826 (quit_throw_to_read_char, Fset_input_interrupt_mode):
3827 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
3828 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
3829 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
3830 (accessible_keymaps_1, Fkey_description, push_key_description):
3831 (shadow_lookup, struct where_is_internal_data)
3832 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
3833 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
3834 (describe_map, describe_vector):
3835 * menu.c (single_menu_item):
3836 * nsmenu.m (ns_update_menubar):
3837 * process.c (wait_reading_process_output):
3838 * search.c (scan_buffer, scan_newline):
3839 Use bool for boolean.
3840 * keyboard.c (timers_run, swallow_events)
3841 (detect_input_pending_run_timers):
3842 * process.c (wait_reading_process_output):
3843 Use unsigned for counter where wraparound-on-overflow is desired,
3844 since unsigned is guaranteed to have that behavior and signed is not.
3845 (read_char): Use ptrdiff_t for string length.
3846 (get_input_pending): Remove first argument, since it was always
3847 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3848 and behave as if it had that value. Return new value of
3849 input_pending. All callers changed.
3850 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3851 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3852 a string length.
3853 * keymap.c (push_key_description): Omit last arg, which was always 1.
3854 All callers changed.
3855
e738ca56
PE
3856 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3857
29f21cdf
JB
38582012-10-10 Juanma Barranquero <lekktu@gmail.com>
3859
3860 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3861 ($(BLD)/term.$(O)): Update dependencies.
3862
6aea7528
DA
38632012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3864
3865 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3866 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3867 initializer for PVEC_NORMAL_VECTOR.
3868
5f3f57be
PE
38692012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3870
3871 Clean out old termopts cruft.
3872 * termopts.h (flow_control, meta_key): Remove unused decls.
3873 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3874 Don't include termopts.h.
3875
3e98c68e
DA
38762012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3877
3878 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3879
77e344e5
PE
38802012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3881
3882 * commands.h (immediate_quit): Remove duplicate decl.
3883
5683d7cd
JD
38842012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3885
3886 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3887 caching.
3888 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 3889 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 3890
cf5fc6db
EZ
38912012-10-09 Eli Zaretskii <eliz@gnu.org>
3892
b15736e6
EZ
3893 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3894 match what GetLastError returns. Explain why the function is
3895 needed.
3896
cf5fc6db
EZ
3897 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
3898 'is_tooltip_frame', to avoid confusion with its global namesake.
3899
f99714ce
DC
39002012-10-08 Daniel Colascione <dancol@dancol.org>
3901
3902 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
3903 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
3904 build that caused Emacs to display the hourglass cursor forever.
f99714ce 3905
fd59cb29
GM
3906 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
3907 which is broken under remote desktop, calculate the number of
3908 colors available for a display based on the display's number of
3909 planes and number of bits per pixel per plane. (bug#10397).
3910
62c480c9 39112012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 3912
62c480c9
JD
3913 * nsfont.m (Vfonts_in_cache): New variable.
3914 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
3915 are used. Add cached fonts to Vfonts_in_cache.
3916 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
3917
607446ba
JB
39182012-10-08 Juanma Barranquero <lekktu@gmail.com>
3919
fd5125ad
JB
3920 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
3921 in nt/config.nt.
46979e0b
JB
3922 (FONT_H): Define after FRAME_H.
3923 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
3924 Update dependencies.
fd5125ad 3925
607446ba
JB
3926 * w32term.c: Remove leftover declaration of keyboard_codepage.
3927
b6f4e300
EZ
39282012-10-08 Eli Zaretskii <eliz@gnu.org>
3929
c54ebba4
EZ
3930 * makefile.w32-in (FONT_H): Add $(FRAME_H).
3931 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
3932 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
3933 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
3934 ($(BLD)/unexw32.$(O)):
3935 ($(BLD)/w32.$(O)):
3936 ($(BLD)/w32console.$(O)):
3937 ($(BLD)/w32fns.$(O)):
3938 ($(BLD)/w32heap.$(O)):
3939 ($(BLD)/w32menu.$(O)):
15c720a3 3940 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 3941
b6f4e300
EZ
3942 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
3943 'const char *'.
3944 (x_to_w32_color): Don't modify the argument, modify a copy instead.
3945
501199a3
DC
39462012-10-08 Daniel Colascione <dancol@dancol.org>
3947
3948 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
3949 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
3950 accidental message numbering hole. Change other messages to
3951 match.
3952
3953 * w32select.h (HAVE_W32SELECT): Remove.
3954
3955 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 3956 w32common.h instead of w32heap.h.
501199a3
DC
3957
3958 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
3959 (get_allocation_unit, get_processor_type, get_w32_major_version)
3960 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3961 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3962 (OS_NT, os_subtype, cache_system_info): Move declarations to
3963 w32common.
3964
3965 * w32heap.c: Include w32common.h.
3966 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
3967 (w32_minor_version, w32_build_number, w32_subtype):
3968 Remove duplicate definitions.
501199a3
DC
3969
3970 * w32fns.c: Include w32common.h; include w32heap.h only in
3971 WINDOWSNT.
3972
3973 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
3974 Use `report_file_error' instead of `error' in order to better
3975 inform users of what went wrong. Increase NTGUI_UNICODE file
3976 dialog box file name length to 32k, the maximum allowed by the NT
3977 kernel.
3978
3979 * w32common.h: New file.
3980 (ROUND_UP, ROUND_DOWN, get_page_size)
3981 (get_allocation_unit, get_processor_type, get_w32_major_version)
3982 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3983 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3984 (OS_NT, os_subtype, cache_system_info): Move here.
3985
3986 * unexw32.c, unexcw.c: Include w32common.h.
3987
3988 * emacs.c (main): Use (defined (WINDOWSNT) || defined
3989 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
3990 to call syms_of_w32select.
3991
3992 * cygw32.h: Remove obsolete EXFUN declarations.
3993
3994 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
3995
3996 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
3997 of w32inevt.o from SOME_MACHINE_OBJECTS.
3998
93aa5c81
DC
39992012-10-08 Daniel Colascione <dancol@dancol.org>
4000
4001 * image.c: Permanent fix for JPEG compilation issue --- limit
4002 jpeglib `boolean' redefinition to Cygwin builds.
4003
d424f3d8
EZ
40042012-10-08 Eli Zaretskii <eliz@gnu.org>
4005
8ee4c6ce
EZ
4006 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4007
d424f3d8
EZ
4008 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4009 Cygwin.
4010
e08348a0
DC
40112012-10-08 Daniel Colascione <dancol@dancol.org>
4012
4013 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4014 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4015 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4016 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4017 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4018 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4019 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4020 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4021 now a supported configuration.
4022
4023 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 4024 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
4025
4026 * conf_post.h:
4027 (_DebPrint) declare tracing facility for W32 debugging. We need
4028 to unify tracing later.
4029
4030 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4031 unconditional use of W32 Unicode functions. Cygwin runs only on
4032 100% Unicode operating systems.
4033
4034 * cygw32.c: New file. Define Cygwin-specific facilities.
4035 (Fcygwin_convert_path_to_windows)
4036 (Fcygwin_convert_path_from_windows): New user functions for
4037 accessing Cygwin path-munging routines.
4038
4039 * cygw32.h: New file.
4040 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4041 UTF-16LE strings temporarily inside non-Lisp-visible string
4042 objects.
4043
4044 (w32_strerror): Just what it says on the tin.
4045
4046 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4047 also run for Cygwin; both systems have the same problem with using
4048 GUI facilities in a forked child. Also call syms_of_cygw32,
4049 syms_of_w32select in correct places.
4050
4051 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4052 needs fork-then-exec for daemon launching.
4053
4054 * font.h: Include frame.h.
4055
4056 * image.c: Use the image library cache machinery only when we're
4057 compiling for native WINDOWSNT; Cygwin can use shared libraries
4058 like any other Unixlike system.
4059
4060 * keyboard.c: Clarify a comment regarding the input loop.
4061
4062 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4063 functions directly instead of trying to detect at runtime that our
4064 host operating system supports them. We make this change for two
4065 reasons: Cygwin lacks support for the multibyte character
4066 conversion functions used by the legacy menu code, and Cygwin
4067 never needs to rely on non-Unicode APIs.
4068
4069 * unexw32.c (hinst): Declare extern.
4070
4071 * w32.c: Change header order;
4072 (w32_strerror): Move to w32fns.c because we need it for
4073 non-WINDOWSNT builds.
4074
4075 * w32.h: Add #error macro to make sure we don't include w32.h for
4076 Cygwin builds. Remove w32select declarations.
4077
4078 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 4079 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
4080
4081 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4082 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4083 POSIXy alternative.
4084 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4085 (w32_major_version, w32_minor_version, w32_build_number)
4086 (os_subtype, sound_type): Define here
4087 (w32_defined_color): Make color parameter const for consistency
4088 with other _defined_color functions.
4089 (w32_createwindow): Unconditionally call w32_init_class instead of
4090 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4091 through the code is complex and unnecessary because class
4092 registration is practically free.
4093 (w32_name_of_message): New EMACSDEBUG-only function.
4094 (Fset_message_beep): Move here
4095 (Fx_open_connection): Require that the display name for Windows be
4096 "w32" for consistency, emacsclient disambiguation, and maybe, one
4097 day, multi-window-system support.
4098 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4099 Cygwin files for W32 GUI facilities, since these clearly don't
4100 expect Cygwin names.
4101 (_DebPrint): Define.
4102 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4103 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4104 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4105 (w32_last_error): Remove.
4106
4107 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4108
4109 * w32heap.c (syspage_mask): Declare here.
4110 (cache_system_info): Remove.
4111
4112 * w32inevt.c (faked_key): Define globally, not statically.
4113 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4114 (w32_console_toggle_lock_key): Move to w32fns.c.
4115
4116 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4117
4118 * w32proc.c (_DebPrint): Move to w32fns.c.
4119 * w32select.c: Include string.h, stdio.h for Cygwin.
4120 * w32select.h: New File.
4121
4122 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4123 get_osfhandle.
4124 (w32_message_fd): New variable. Under Cygwin, holds the file
4125 descriptor the system used to tell us about pending thread
4126 messages.
4127
4128 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4129 that prevented compilation under non-WINDOWSNT systems.
4130
4131 (w32_initialize): Open /dev/windows and assign it to
4132 w32_message_fd. Provide w32 feature.
4133
4134 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4135 (WM_EMACS_INPUT_READY): add.
4136 (prepend_msg, w32_message_fd): Declare globally.
4137
4138 * w32xfns.c:
4139 (keyboard_handle): Use only when WINDOWSNT.
4140 (notify_msg_ready): New function. Posts a message to the main
4141 thread's message queue under CYGWIN, which wakes up the main
4142 thread from select(2) by making the /dev/windows file descriptor
4143 ready. Under WINDOWSNT, it sets an event the same way the old
4144 code did.
4145
4146 (post, prepend_msg): Actually call notify_msg_ready instead of
4147 setting the input event directly.
4148
98daa893
EZ
41492012-10-07 Eli Zaretskii <eliz@gnu.org>
4150
4151 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4152 but it still has blocs in it, don't return it to the system,
4153 instead of aborting. (Bug#12402)
4154
3bc0a2f7
JD
41552012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4156
8ad5b73b 4157 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 4158
335f5ae4
JD
4159 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4160 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
4161 (syms_of_nsterm): Remove comment about Panther and above for
4162 ns-antialias-text.
335f5ae4
JD
4163 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4164 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4165 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4166
4167 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4168 MAC_OS_X_VERSION_10_4.
4169
8ad5b73b
JD
4170 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4171 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
4172
4173 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4174
4175 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4176 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4177
3bc0a2f7
JD
4178 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4179 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
4180 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4181 Remove ns_in_resize check.
3bc0a2f7
JD
4182 (ns_clear_frame_area): Remove resize handle code.
4183
4184 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
4185 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4186 Remove ns_in_resize check.
3bc0a2f7 4187
c622b48f
PE
41882012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4189
4190 Improve sys_siglist detection.
4191 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4192 defined as a macro, as is done in Solaris.
4193 (sys_siglist_entries): New macro.
4194 (save_strsignal): Use it.
4195 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4196 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4197
04fafa46
JD
41982012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4199
4200 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4201 fullscreen/Fullscreen.
4202
4203 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4204 tobar_height is new.
4205
4206 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4207 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4208 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4209 (windowDidResize:): Check for correct window if old style fullscreen.
4210 Capitalize word in comment. Remove incorrect comment.
4211 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4212 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4213 error in drawing background.
1f9f395d 4214 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
4215 Set toolbar values to zero, save old height in tobar_height.
4216 Restore tool bar height when leaving fullscreen.
4217 (canBecomeMainWindow): New function.
4218
c6e21c03
PE
42192012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4220
4221 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4222
0d9f584b
EZ
42232012-10-05 Eli Zaretskii <eliz@gnu.org>
4224
a65fbb5f
EZ
4225 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4226
0d9f584b 4227 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
4228 that time stamps of directories could also be changed.
4229 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
4230 FILE_WRITE_ATTRIBUTES access rights.
4231
4232 * fileio.c (Fset_file_times): Special-case ignoring errors for
4233 directories only on MSDOS, not on MS-Windows.
4234
e8757f09 42352012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
4236
4237 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4238
7604f298
EZ
42392012-10-04 Eli Zaretskii <eliz@gnu.org>
4240
4241 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4242 see whether CreateFile failed.
4243
88d69b7d
PE
42442012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4245
4246 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4247 to avoid similar races.
4248 * keyboard.c (pending_signals): Now bool, not int.
4249
7509f454
PE
4250 Port timers to OpenBSD, plus check for timer failures.
4251 OpenBSD problem reported by Han Boetes.
4252 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4253 and/or setitimer.
4254 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4255 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4256 like OpenBSD, which has timer_settime but does not declare it.
4257 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4258 whether to use itimerspec-related primitives. All uses of
4259 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4260
a3c5c0c5
PE
42612012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4262
4263 * profiler.c (handle_profiler_signal): Fix a malloc race
4264 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4265
914e743b
JD
42662012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4267
4268 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4269
d8ab37a8
EZ
42702012-10-02 Eli Zaretskii <eliz@gnu.org>
4271
4272 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4273 consistent with the change in return value of 'safe_strsignal'.
4274
b3ecad33
PE
42752012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4276
0a99eee1
PE
4277 Prefer plain 'static' to 'static inline' (Bug#12541).
4278 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4279 (bidi_set_sor_type, bidi_push_embedding_level)
4280 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4281 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4282 (bidi_cache_search, bidi_cache_ensure_space)
4283 (bidi_cache_iterator_state, bidi_cache_find)
4284 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4285 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4286 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4287 Now 'static', not 'static inline'.
4288
b3ecad33
PE
4289 Count overruns when profiling; change units to ns.
4290 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4291 Give extra weight to samples after overruns, to attempt to count
4292 the time more accurately.
4293 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4294 the underlying primitives nominally do ns.
4295 (Fprofiler_cpu_start): Document the change. Mention that
4296 the sampling intervals are only approximate.
4297
090cf9db
SM
42982012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4299
4300 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4301
4302 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4303 case for the special 0 coding-system.
4304
4305 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4306 (Fmake_overlay): Remove redundant tests.
64edc777 4307 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 4308
81550bf4
JB
43092012-10-02 Juanma Barranquero <lekktu@gmail.com>
4310
4311 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4312 Update dependencies.
4313
aa1ba90e
PE
43142012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4315
4316 Fix a malloc race condition involving strsignal.
4317 A signal can arrive in the middle of a malloc, and Emacs's signal
4318 handler can invoke strsignal, which can invoke malloc, which is
4319 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4320 Fix it by altering the signal handler so that it does not invoke
4321 strsignal.
4322 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4323 * process.c (status_message): Use const pointer, in case strsignal
4324 is #defined to safe_strsignal.
4325 * sysdep.c (sys_siglist, init_signals): Always define and
4326 initialize a substitute sys_siglist if the system does not define
4327 one, even if HAVE_STRSIGNAL.
4328 (safe_strsignal): Rename from strsignal. Always define,
4329 using sys_siglist. Return a const pointer.
4330 * syssignal.h (safe_strsignal): New decl.
4331 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4332
ace917bd
EZ
43332012-10-01 Eli Zaretskii <eliz@gnu.org>
4334
4335 * w32proc.c (timer_loop): Fix code that waits for timer
4336 expiration, to avoid high CPU usage.
4337
9eb71b9c
SM
43382012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4339
4340 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4341 (sweep_weak_table): Remove redundant prototypes.
4342
b3317662
FP
43432012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4344
4345 * emacs.c: Move the inclusion of TERM_HEADER after including
4346 windows.h on WINDOWSNT. This avoids compilation problems with
4347 MSVC.
4348
f0e5f225
EZ
43492012-10-01 Eli Zaretskii <eliz@gnu.org>
4350
2d7d1608
EZ
4351 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4352 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4353 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4354 as the previous version used 'void *'.
4355
4356 * ralloc.c (ROUNDUP): Fix last change.
4357 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4358 'size_t'.
4359
f0e5f225
EZ
4360 * w32proc.c <disable_itimers>: New static flag.
4361 (init_timers): Initialize it to zero, after creating the critical
4362 sections used by the timer threads.
4363 (term_timers): Set to 1 before deleting the critical sections.
4364 (getitimer, setitimer): If disable_itimers is non-zero, return an
4365 error indication without doing anything. Reported by Fabrice
4366 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
4367 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4368 return results.
4369 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4370 support timers.
f0e5f225
EZ
4371
4372 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4373 term_ntproc after all the other bookkeeping, to get timers working
4374 as long as possible.
4375
82ef37c1
PE
43762012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4377
b3a4c387
PE
4378 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4379 Suggested by Juri Linkov in
4380 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4381
b0ab8123
PE
4382 Prefer plain 'static' to 'static inline' (Bug#12541).
4383 With static functions, modern compilers inline pretty well by
4384 themselves; advice from programmers often hurts as much as it helps.
4385 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4386 this change shrinks the text size of the Emacs executable by 1.1%
4387 without affecting CPU significantly in my benchmark.
4388 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4389 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4390 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4391 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4392 (bset_auto_fill_function, bset_auto_save_file_format)
4393 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4394 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4395 (bset_cache_long_line_scans, bset_case_fold_search)
4396 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4397 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4398 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4399 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4400 (bset_header_line_format, bset_indicate_buffer_boundaries)
4401 (bset_indicate_empty_lines, bset_invisibility_spec)
4402 (bset_left_fringe_width, bset_major_mode, bset_mark)
4403 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4404 (bset_name, bset_overwrite_mode, bset_pt_marker)
4405 (bset_right_fringe_width, bset_save_length)
4406 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4407 (bset_scroll_up_aggressively, bset_selective_display)
4408 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4409 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4410 (set_buffer_overlays_after):
4411 * category.c (bset_category_table):
4412 * charset.c (read_hex):
4413 * coding.c (produce_composition, produce_charset)
4414 (handle_composition_annotation, handle_charset_annotation)
4415 (char_encodable_p):
4416 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4417 (assign_row, set_frame_matrix_frame, make_current)
4418 (add_row_entry):
4419 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4420 * fns.c (maybe_resize_hash_table):
4421 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4422 * gmalloc.c (register_heapinfo):
4423 * image.c (lookup_image_type):
4424 * intervals.c (set_interval_object, set_interval_left)
4425 (set_interval_right, copy_interval_parent, rotate_right)
4426 (rotate_left, balance_possible_root_interval):
4427 * keyboard.c (kset_echo_string, kset_kbd_queue)
4428 (kset_keyboard_translate_table, kset_last_prefix_arg)
4429 (kset_last_repeatable_command, kset_local_function_key_map)
4430 (kset_overriding_terminal_local_map, kset_real_last_command)
4431 (kset_system_key_syms, clear_event, set_prop):
4432 * lread.c (digit_to_number):
4433 * marker.c (attach_marker, live_buffer, set_marker_internal):
4434 * nsterm.m (ns_compute_glyph_string_overhangs):
4435 * process.c (pset_buffer, pset_command)
4436 (pset_decode_coding_system, pset_decoding_buf)
4437 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4438 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4439 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4440 * syntax.c (bset_syntax_table, dec_bytepos):
4441 * terminal.c (tset_param_alist):
4442 * textprop.c (interval_has_some_properties)
4443 (interval_has_some_properties_list):
4444 * window.c (wset_combination_limit, wset_dedicated)
4445 (wset_display_table, wset_hchild, wset_left_fringe_width)
4446 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4447 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4448 (wset_right_fringe_width, wset_right_margin_cols)
4449 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4450 (wset_vertical_scroll_bar_type, wset_window_parameters):
4451 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4452 (wset_column_number_displayed, wset_region_showing)
4453 (window_box_edges, run_window_scroll_functions)
4454 (append_glyph_string_lists, prepend_glyph_string_lists)
4455 (append_glyph_string, set_glyph_string_background_width)
4456 (append_glyph, append_composite_glyph)
4457 (take_vertical_position_into_account):
4458 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4459 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4460 (lface_hash, lface_same_font_attributes_p, lookup_face):
4461 * xml.c (libxml2_loaded_p):
4462 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4463 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4464 Now 'static', not 'static inline'.
4465
05584c31
PE
4466 * bidi.c: Tune.
4467 (bidi_copy_it): Do the whole copy with a single memcpy.
4468 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4469
86ec63ba
PE
4470 Revert the FOLLOW-SYMLINKS change for file-attributes.
4471 Doing it right would require several changes to Tramp, and there's
4472 not enough time to get that tested before the freeze today.
4473 * dired.c (directory_files_internal, Ffile_attributes):
4474 Undo last change.
4475
82ef37c1
PE
4476 * frame.c (x_report_frame_params): Port better to wider ints.
4477 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4478 or that pointers can be printed in 15 decimal digits.
4479 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4480
62aba0d4
FP
44812012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4482
4483 Support x64 build on MS-Windows.
4484 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4485 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4486 compatibility with x64.
5e4daaf3 4487 (x_get_focus_frame): Add prototype.
62aba0d4
FP
4488
4489 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4490 defining an XRectangle structure.
4491
4492 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4493 arithmetics for compatibility with x64.
4494
4495 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4496 compatibility with x64.
4497
4498 * w32heap.h: Adjust prototypes and declarations.
4499
4500 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4501 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4502 DWORD, long, and unsigned long, for compatibility with x64.
4503 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4504 (sbrk): Argument is now of type ptrdiff_t.
4505
4506 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4507 less than 0x0500.
4508 (w32_msg_pump): Use WPARAM type for 'result'.
4509
4510 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4511 architecture.
4512 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4513 compatibility with x64.
4514
4515 * vm-limit.c (lim_data): Now size_t.
4516 (check_memory_limits): Adjust prototypes of real_morecore and
4517 __morecore to receive argument of type ptrdiff_t. Use size_t for
4518 five_percent and data_size.
4519
4520 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4521 variables, for compatibility with x64.
4522 (rva_to_section, offset_to_section, relocate_offset)
4523 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4524 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4525 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4526 for compatibility with x64.
4527
4528 * sysdep.c (STDERR_FILENO): Define if not already defined.
4529
4530 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4531 (__morecore): Argument type is now ptrdiff_t.
4532 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4533 (relinquish): Use ptrdiff_t type for 'excess'.
4534 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4535
4536 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4537 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4538 instead of a literal number.
4539
4540 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4541 (min): Define only if not already defined.
4542
4543 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4544 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4545 hosts.
4546
4547 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4548 'bitmaps' is a pointer.
4549
4550 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4551
4552 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4553
e7a2937b
PE
45542012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4555
4556 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4557 * dired.c (directory_files_internal, Ffile_attributes):
4558 New arg follow_symlinks. All uses changed.
4559
b43d62ae
SM
45602012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4561
4562 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4563
c06c382a
EZ
45642012-09-30 Eli Zaretskii <eliz@gnu.org>
4565
4566 Support atimers and CPU profiler via profile.c on MS-Windows.
4567 * w32proc.c (sig_mask, crit_sig): New static variables.
4568 (sys_signal): Support SIGALRM and SIGPROF.
4569 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 4570 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
4571 sigfillset, and sigprocmask are no longer no-ops.
4572 (sigismember): New function.
4573 (struct itimer_data): New definition.
4574 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4575 (crit_prof): New static variables.
4576 (MAX_SINGLE_SLEEP): New definition.
4577 (timer_loop, stop_timer_thread, term_timers, init_timers)
4578 (start_timer_thread, getitimer, setitimer): New functions.
4579 (alarm): No longer a no-op, calls setitimer.
4580
4581 * w32.c (term_ntproc): Call term_timers.
4582 (init_ntproc): Make sure all signals are unblocked at startup, to
4583 erase any traces of dumping. Call init_timers.
4584
4585 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4586 Windows-specific code to display the hourglass mouse pointer is no
4587 longer used.
4588 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4589 to hourglass timer expiration.
4590 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4591 Remove, no longer used.
b43d62ae
SM
4592 (w32_note_current_window, show_hourglass, hide_hourglass):
4593 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
4594 window systems.
4595 (syms_of_w32fns): Don't initialize hourglass_timer.
4596
4597 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4598 WINDOWSNT as well.
4599 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4600
4601 * w32.h (init_timers, term_timers): Add prototypes.
4602
95402d5f
KH
46032012-09-30 Kenichi Handa <handa@gnu.org>
4604
4605 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4606 to the buffer relocation which may be caused by ccl_driver.
4607
dd946752
JD
46082012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4609
d7e642cc
JD
4610 * xfns.c (Fx_file_dialog): Update comment.
4611
4612 * w32fns.c (Fx_file_dialog): Update comment.
4613
4614 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4615 Initialize panel name field if OSX >= 10.6.
4616
4617 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4618
dd946752
JD
4619 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4620
4621 * nsterm.m (NEW_STYLE_FS): New define.
4622 (ns_fullscreen_hook, windowWillEnterFullScreen)
4623 (windowDidEnterFullScreen, windowWillExitFullScreen)
4624 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4625 (setFSValue): New functions.
4626 (EmacsFSWindow): New implementation.
4627 (canBecomeKeyWindow): New function for EmacsFSWindow.
4628 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4629 (dealloc): Release nonfs_window if in fullscreen.
4630 (updateFrameSize:): Call windowDidMove to update top/left.
4631 (windowWillResize:toSize:): Check if frame is still maximized.
4632 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4633 next_maximized, maximized_width, maximized_height and nonfs_window.
4634 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4635 tbar_height.
4636 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 4637 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
4638
4639 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4640 (EmacsView): Add variables for fullscreen.
4641 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4642 (EmacsFSWindow): New interface for fullscreen.
4643
427730eb
JB
46442012-09-30 Juanma Barranquero <lekktu@gmail.com>
4645
4646 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4647
48de8b12
CY
46482012-09-30 Chong Yidong <cyd@gnu.org>
4649
4650 * fns.c (Frandom): Doc fix.
4651
5938d519
MR
46522012-09-30 Martin Rudalics <rudalics@gmx.at>
4653
4654 * window.c (Vwindow_combination_limit): New default value.
4655 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4656
cb5b0266
PE
46572012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4658
4659 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4660 Suggested by Eli Zaretskii in
4661 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4662
84f72efd
EZ
46632012-09-30 Eli Zaretskii <eliz@gnu.org>
4664
4665 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4666 HAVE_TIMER_SETTIME is defined.
4667
9d4dcdc9
PE
46682012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4669
d89460ed
PE
4670 Profiler improvements: more-accurate timers, overflow checks.
4671 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4672 signal.h, setjmp.h. Include systime.h instead.
4673 (saturated_add): New function.
4674 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4675 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4676 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4677 New static vars.
84f72efd 4678 (enum profiler_cpu_running): New enum.
d89460ed
PE
4679 (profiler_cpu_running): Now of that enum type, not bool.
4680 All uses changed to store the new value.
4681 (handle_profiler_signal): Rename from sigprof_handler_1,
4682 for consistency with other handlers. Do not check whether
4683 cpu_log is a hash-table if garbage collecting, since it
4684 doesn't matter in that case.
4685 (deliver_profiler_signal): Rename from sigprof_handler,
4686 for consistency with other handlers.
4687 (setup_cpu_timer): New function, with much of what used to be in
4688 Fprofiler_cpu_start. Check for out-of-range argument.
4689 Prefer timer_settime if available, and prefer
4690 thread cputime clocks, then process cputime clocks, then
4691 monotonic clocks, to the old realtime clock. Use make_timeval
4692 to round more-correctly when falling back to setitimer.
4693 (Fprofiler_cpu_start): Use it.
4694 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4695 Don't assume that passing NULL as the 2nd argument of setitimer
4696 is the same as passing a pointer to all-zero storage.
4697 Ignore SIGPROF afterwards.
4698 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4699 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4700 non-fatal signal handlers. Ignore SIGPROF on startup.
4701 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4702 in profiler.c, since sysdep.c now uses it.
4703
9d4dcdc9
PE
4704 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4705 Suggested by Eli Zaretskii in
4706 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4707
8e5691a0
JB
47082012-09-29 Juanma Barranquero <lekktu@gmail.com>
4709
4710 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4711
e7c1b6ef
SM
47122012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4713
4714 * lisp.h (struct backtrace): Remove indirection for `function' field.
4715 * xdisp.c (redisplay_internal):
4716 * profiler.c (record_backtrace, sigprof_handler_1):
4717 * alloc.c (Fgarbage_collect):
4718 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4719 (Fbacktrace_frame): Adjust accordingly.
4720
e61d39cd 47212012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
4722
4723 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4724 (Frun_hook_with_args_until_failure): Doc fixes.
4725
404043ea
EZ
47262012-09-28 Eli Zaretskii <eliz@gnu.org>
4727
4728 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4729 Qautomatic_redisplay and change the symbol name. All users changed.
4730
704d3f45
TM
47312012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4732
4733 * profiler.c (sigprof_handler): Fix race condition.
4734
757140ff
GM
47352012-09-28 Glenn Morris <rgm@gnu.org>
4736
4737 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4738
a615a3ae
PE
47392012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4740
4741 Check more robustly for timer_settime.
89d17fd0
PE
4742 * Makefile.in (LIB_TIMER_TIME): New macro.
4743 (LIBES): Add it.
a615a3ae
PE
4744 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4745 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4746 call timer_settime.
4747
3670daf7
TM
47482012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4749
4750 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4751
6a586b7f
JB
47522012-09-26 Juanma Barranquero <lekktu@gmail.com>
4753
4754 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4755
41c8bfcf
PE
47562012-09-26 Paul Eggert <eggert@cs.ucla.edu>
4757
4758 * character.h (MAYBE_UNIFY_CHAR): Remove.
4759 * charset.c, charset.h (maybe_unify_char): Now static.
4760 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
4761 Since this stuff is now private to charset.c, there's no need for
4762 a public macro and no need to inline by hand.
4763
3a880af4
SM
47642012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4765 Stefan Monnier <monnier@iro.umontreal.ca>
4766 Juanma Barranquero <lekktu@gmail.com>
611b7507 4767
3a880af4
SM
4768 * profiler.c: New file.
4769 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
4770 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
4771 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
4772 * emacs.c (main): Call syms_of_profiler.
4773 * alloc.c (Qautomatic_gc): New constant.
4774 (MALLOC_PROBE): New macro.
4775 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
4776 (total_bytes_of_live_objects): New function.
4777 (Fgarbage_collect): Use it. Record itself in backtrace_list.
4778 Call malloc_probe for the memory profiler.
4779 (syms_of_alloc): Define Qautomatic_gc.
4780 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
4781 race condition.
4782 (struct backtrace): Move definition...
4783 * lisp.h (struct backtrace): ..here.
4784 (Qautomatic_gc, profiler_memory_running): Declare vars.
4785 (malloc_probe, syms_of_profiler): Declare functions.
4786 * xdisp.c (Qautomatic_redisplay): New constant.
4787 (redisplay_internal): Record itself in backtrace_list.
4788 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 4789
5938d519 47902012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
47912012-09-25 Juanma Barranquero <lekktu@gmail.com>
4792
4793 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
4794
e26fd2e4
PE
47952012-09-25 Paul Eggert <eggert@cs.ucla.edu>
4796
4797 Prefer POSIX timers if available.
4798 They avoid a race if the timer is too close to the current time.
4799 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
4800 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 4801 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 4802
eedec3ee
EZ
48032012-09-25 Eli Zaretskii <eliz@gnu.org>
4804
4805 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
4806 CHAR_STRING_ADVANCE.
4807 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
4808 STRING_CHAR_ADVANCE.
4809
aa15c6bb
JB
48102012-09-25 Juanma Barranquero <lekktu@gmail.com>
4811
4812 Move Vlibrary_cache to emacs.c and reset before dumping.
4813
4814 * lisp.h (reset_image_types): Declare.
4815 [WINDOWSNT] (Vlibrary_cache): Declare.
4816
4817 * image.c (reset_image_types): New function.
4818
4819 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
4820 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
4821 (Fdump_emacs): Reset Vlibrary_cache and image_types.
4822
4823 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
4824 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
4825
4826 * w32.h (Vlibrary_cache): Do not declare.
4827
54d629be
EZ
48282012-09-25 Eli Zaretskii <eliz@gnu.org>
4829
16b22fef
EZ
4830 * w32proc.c (sys_signal): Handle all signals defined by the
4831 MS-Windows runtime, not just SIGCHLD. Actually install the signal
4832 handlers for signals supported by Windows. Don't override
4833 term_ntproc as the handler for SIGABRT.
4834 (sigaction): Rewrite to call sys_signal instead of duplicating its
4835 code.
4836 (sys_kill): Improve commentary.
4837
4838 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4839 consistency with a signature of a signal handler. All callers
4840 changed.
4841 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4842 install term_ntproc as a signal handler for SIGABRT, as that
4843 should be done by the dumped Emacs.
4844
4845 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4846
4847 * w32select.c (term_w32select): Protect against repeated
4848 invocation by setting clipboard_owner to NULL after calling
4849 DestroyWindow.
4850
4851 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4852 and term_ntproc to their modified signatures.
4853
54d629be
EZ
4854 * character.c (char_string, string_char): Remove calls to
4855 MAYBE_UNIFY_CHAR. See the discussion starting at
4856 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4857 for the details.
4858
59f7af81
CY
48592012-09-25 Chong Yidong <cyd@gnu.org>
4860
4861 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4862
22e8cf4a
SM
48632012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4864
4865 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4866 when encountering an unknown bytecode.
4867
578098f3
PE
48682012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4869
4870 image.c, indent.c: Use bool for booleans.
4871 * dispextern.h (struct image_type): Members valid_p, load, init
4872 now return bool, not int. All uses changed.
4873 * image.c: Omit unnecessary static decls.
4874 (x_create_bitmap_mask, x_build_heuristic_mask):
4875 Return void, not int, since callers don't care about the return value.
4876 (x_create_bitmap_mask, define_image_type, valid_image_p)
4877 (struct image_keyword, parse_image_spec, image_spec_value)
4878 (check_image_size, image_background)
4879 (image_background_transparent, x_clear_image_1)
4880 (postprocess_image, lookup_image, x_check_image_size)
4881 (x_create_x_image_and_pixmap, xbm_image_p)
4882 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4883 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4884 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4885 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4886 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4887 (png_image_p, init_png_functions, png_load_body, png_load)
4888 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4889 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4890 (init_gif_functions, gif_load, imagemagick_image_p)
4891 (imagemagick_load_image, imagemagick_load, svg_image_p)
4892 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4893 (gs_load):
4894 * nsimage.m (ns_load_image):
4895 * nsterm.m (ns_defined_color):
4896 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
4897 * xfns.c (x_defined_color):
4898 * xterm.c (x_alloc_lighter_color_for_widget)
4899 (x_alloc_nearest_color_1, x_alloc_nearest_color)
4900 (x_alloc_lighter_color):
4901 * indent.c (disptab_matches_widthtab, current_column)
4902 (scan_for_column, string_display_width, indented_beyond_p)
4903 (compute_motion, vmotion, Fvertical_motion):
4904 Use bool for booleans.
4905
a5f2b6ec
CY
49062012-09-24 Chong Yidong <cyd@gnu.org>
4907
4908 * chartab.c (Fset_char_table_default): Obsolete function removed.
4909
18e27ea8
PE
49102012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4911
afea8a8a
PE
4912 Move pid_t related decls out of lisp.h.
4913 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
4914 (interruptible_wait_for_termination):
4915 Move these decls from lisp.h to syswait.h, since they use pid_t.
4916 Needed on FreeBSD; see Herbert J. Skuhra in
4917 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
4918 * callproc.c: Include syswait.h.
4919
18e27ea8
PE
4920 gnutls.c, gtkutil.c: Use bool for boolean.
4921 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
4922 (emacs_gnutls_handle_error):
4923 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
4924 (xg_hide_tooltip, xg_create_frame_widgets)
4925 (create_dialog, xg_uses_old_file_dialog)
4926 (xg_get_file_with_chooser, xg_get_file_with_selection)
4927 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
4928 (xg_item_label_same_p, xg_update_menubar)
4929 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
4930 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
4931 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
4932 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
4933 (update_frame_tool_bar, free_frame_tool_bar):
4934 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
4935 * nsmenu.m (ns_update_menubar):
4936 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
4937 * xfns.c (Fx_show_tip) [USE_GTK]:
4938 Use bool for boolean.
4939 * gtkutil.c (xg_update_frame_menubar):
4940 * xmenu.c (update_frame_menubar):
4941 Return void, not int, since caller ignores return value.
4942 * gtkutil.c (xg_change_toolbar_position):
4943 Return void, not 1.
4944
af0e9f75
JB
49452012-09-23 Juanma Barranquero <lekktu@gmail.com>
4946
4947 * makefile.w32-in (BLOCKINPUT_H): Remove.
4948 (SYSSIGNAL_H): New macro.
4949 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
4950 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
4951 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
4952 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
4953 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
4954 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
4955 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
4956 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
4957 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
4958 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
4959 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
4960 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
4961 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
4962 ($(BLD)/w32xfns.$(O)): Update dependencies.
4963
5101529e
EZ
49642012-09-23 Eli Zaretskii <eliz@gnu.org>
4965
4966 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
4967 fatal_error_backtrace.
4968
4969 * w32proc.c (sys_kill): Undo last change: don't do anything when
4970 invoked to deliver SIGABRT to our own process. This is now
4971 handled by emacs_raise.
4972
2c3ee0ad
JB
49732012-09-23 Juanma Barranquero <lekktu@gmail.com>
4974
4975 * w32term.c (w32_read_socket): Remove leftover reference to
4976 interrupt_input_pending.
4977
62a1d661
PE
49782012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4979
4980 Do not use SA_NODEFER.
4981 Problem reported by Dani Moncayo in
4982 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
4983 * alloc.c (die):
4984 * sysdep.c (emacs_abort): Do not reset signal handler.
4985 * emacs.c (terminate_due_to_signal): Reset signal handler here.
4986 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
4987 wanted even on POSIXish hosts, and it doesn't work on Windows.
4988
a0942b9a
JD
49892012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4990
4991 * xterm.c (x_term_init): Call fixup_locale before and after calling
4992 gtk_init (Bug#12392).
4993
d07ff9db
CY
49942012-09-23 Chong Yidong <cyd@gnu.org>
4995
4996 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
4997 Vdynamic_library_alist.
4998
4999 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5000 (Fgnutls_available_p): Caller changed.
5001
5002 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5003 (Flibxml_parse_xml_region): Likewise.
5004
5005 * dispextern.h (struct image_type): Remove arg from init function.
5006
5007 * image.c (Finit_image_library, lookup_image_type)
5008 (define_image_type): Remove now-unneeded second arg.
5009 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5010 (init_tiff_functions, init_gif_functions, init_svg_functions):
5011 Arglist and w32_delayed_load calling convention changed.
5012 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 5013 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 5014
4d7e6e51
PE
50152012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5016
5017 Simplify and avoid signal-handling races (Bug#12471).
5018 * alloc.c (die):
5019 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5020 Avoid recursive loop if there's a fatal error in the function itself.
5021 * atimer.c (pending_atimers):
5022 * blockinput.h: Don't include "atimer.h"; no longer needed.
5023 (interrupt_input_pending): Remove. All uses removed.
5024 pending_signals now counts both atimers and ordinary interrupts.
5025 This is less racy than having three separate pending-signal flags.
5026 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5027 (input_blocked_p):
5028 Rename from their upper-case counterparts BLOCK_INPUT,
5029 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5030 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5031 This makes it easier to access volatile variables more accurately.
5032 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5033 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5034 that's more reliable if the code is buggy and sets
5035 interrupt_input_blocked to a negative value. All uses changed.
5036 * atimer.c (deliver_alarm_signal):
5037 Remove. No need to deliver this to the parent; any thread can
5038 handle this signal now. All uses replaced by underlying handler.
5039 * atimer.c (turn_on_atimers):
5040 * dispnew.c (handle_window_change_signal):
5041 * emacs.c (handle_danger_signal):
5042 * keyboard.c (kbd_buffer_get_event):
5043 Don't reestablish signal handler; not needed with sigaction.
5044 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5045 (UNBLOCK_INPUT_TO):
5046 Rework to avoid unnecessary accesses to volatile variables.
5047 (UNBLOCK_INPUT_TO): Now a function.
5048 (totally_unblock_input, unblock_input): New decls.
5049 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5050 (init_data): Remove. Necessary stuff now done in init_signal.
5051 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5052 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5053 (fatal_error_code): Remove; no longer needed.
5054 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5055 it doesn't always backtrace. All uses changed. No need to reset
5056 signal to default, since sigaction and/or die does that for us now.
5057 Use emacs_raise (FOO), not kill (getpid (), FOO).
5058 (main): Check more-accurately whether we're dumping.
5059 Move fatal-error setup to sysdep.c
5060 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5061 * gtkutil.c (xg_get_file_name, xg_get_font):
5062 Remove no-longer-needed signal-mask manipulation.
5063 * keyboard.c, process.c (POLL_FOR_INPUT):
5064 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5065 * keyboard.c (read_avail_input): Remove.
5066 All uses replaced by gobble_input.
5067 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5068 (kbd_buffer_store_event_hold, gobble_input):
5069 (record_asynch_buffer_change) [USABLE_SIGIO]:
5070 (store_user_signal_events):
5071 No need to mess with signal mask.
5072 (gobble_input): If blocking input and there are terminals, simply
5073 set pending_signals to 1 and return. All hooks changed to not
5074 worry about whether input is blocked.
5075 (process_pending_signals): Clear pending_signals before processing
5076 them, in case a signal comes in while we're processing.
5077 By convention callers now test pending_signals before calling us.
5078 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5079 New functions, to support changes to blockinput.h.
5080 (handle_input_available_signal): Now extern.
5081 (reinvoke_input_signal): Remove. All uses replaced by
5082 handle_async_input.
5083 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
5084 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5085 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
5086 Clear sigmask reliably, even if Fsignal returns, which it can.
5087 Omit unnecessary accesses to volatile var.
5088 (quit_throw_to_read_char): No need to restore sigmask.
5089 * keyboard.c (gobble_input, handle_user_signal):
5090 * process.c (wait_reading_process_output):
5091 Call signal-handling code rather than killing ourselves.
5092 * lisp.h: Include <float.h>, for...
5093 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5094 (pending_signals): Now volatile.
5095 (syms_of_data): Now const if IEEE floating point.
5096 (handle_input_available_signal) [USABLE_SIGIO]:
5097 (terminate_due_to_signal, record_child_status_change): New decls.
5098 * process.c (create_process): Avoid disaster if memory is exhausted
5099 while we're processing a vfork, by tightening the critical section
5100 around the vfork.
5101 (send_process_frame, process_sent_to, handle_pipe_signal)
5102 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5103 ignores SIGPIPE.
5104 (send_process): No need for setjmp/longjmp any more, since the
5105 SIGPIPE stuff is now gone. Instead, report an error if errno
5106 is EPIPE.
5107 (record_child_status_change): Now extern. PID and W are now args.
5108 Return void, not bool. All callers changed.
5109 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5110 Remove. All uses removed. This bug should be fixed now in a
5111 different way.
5112 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5113 and record the child status change directly. This avoids the
5114 need to futz with the signal mask.
5115 (process_fatal_action): Move here from emacs.c.
5116 (emacs_sigaction_flags): New function, containing
5117 much of what used to be in emacs_sigaction_init.
5118 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5119 caught by emacs, to make races less likely.
5120 (deliver_process_signal): Rename from handle_on_main_thread.
5121 All uses changed.
5122 (BACKTRACE_LIMIT_MAX): Now at top level.
5123 (thread_backtrace_buffer, threadback_backtrace_pointers):
5124 New static vars.
5125 (deliver_thread_signal, deliver_fatal_thread_signal):
5126 New functions, for more-accurate delivery of thread-specific signals.
5127 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5128 (deliver_arith_signal): Handle in this thread, not
5129 in the main thread, since it's triggered by this thread.
5130 (maybe_fatal_sig): New function.
5131 (init_signals): New arg DUMPING so that we can be more accurate
5132 about whether we're dumping. Caller changed.
5133 Treat thread-specific signals differently from process-general signals.
5134 Block all signals while handling fatal error; that's safer.
5135 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5136 on IEEE hosts.
5137 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5138 Ignore SIGPIPE unless batch.
5139 (emacs_backtrace): Output backtrace for the appropriate thread,
5140 which is not necessarily the main thread.
5141 * syssignal.h: Include <stdbool.h>.
5142 (emacs_raise): New macro.
5143 * xterm.c (x_connection_signal): Remove; no longer needed
5144 now that we use sigaction.
5145 (x_connection_closed): No need to mess with sigmask now.
5146 (x_initialize): No need to reset SIGPIPE handler here, since
5147 init_signals does this for us now.
5148
8f4635e9
JD
51492012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5150
5151 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 5152 background rect may be larger (Bug#12245).
8f4635e9 5153
3296976d
CY
51542012-09-23 Chong Yidong <cyd@gnu.org>
5155
5156 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5157
d41e491e
PE
51582012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5159
5160 * .gdbinit: Just stop at fatal_error_backtrace.
5161 See Stefan Monnier's request in
5162 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5163 Remove no-longer-used query of system type.
5164
c88b867f
CY
51652012-09-22 Chong Yidong <cyd@gnu.org>
5166
5167 * search.c (Freplace_match): Doc fix (Bug#12325).
5168
5169 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5170
5171 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5172 (Fline_end_position): Doc fix.
5173
5174 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5175
bb4d86b4
CY
51762012-09-22 Chong Yidong <cyd@gnu.org>
5177
5178 * dispextern.h (struct image_type): Add new slot, storing a type
5179 initialization function.
5180
5181 * image.c (define_image_type): Call the image initializer function
5182 if it is defined. Arguments and return value changed.
5183 (valid_image_p, make_image): Callers changed.
5184 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
5185 (gif_type, imagemagick_type, svg_type, gs_type):
5186 Add initialization functions.
bb4d86b4
CY
5187 (Finit_image_library): Call lookup_image_type.
5188 (CHECK_LIB_AVAILABLE): Macro deleted.
5189 (lookup_image_type): Call define_image_type here, rather than via
5190 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5191 (syms_of_image): Move define_image_type calls for xbm_type and
5192 pbm_type to lookup_image_type.
5193
df9685f3
EZ
51942012-09-22 Eli Zaretskii <eliz@gnu.org>
5195
5196 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5197 'idle_timers' from here ...
5198 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5199 lists, to avoid infloops when the timer does something stupid,
5200 like reinvoke itself with the same or smaller time-out.
5201 (Bug#12447)
5202
8e17c9ba
MR
52032012-09-22 Martin Rudalics <rudalics@gmx.at>
5204
5205 * window.c (Fsplit_window_internal): Handle only Qt value of
5206 Vwindow_combination_limit separately.
5207 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
5208 (Vwindow_combination_limit): New default value.
5209 Rewrite doc-string.
8e17c9ba 5210
589bd69b
EZ
52112012-09-22 Eli Zaretskii <eliz@gnu.org>
5212
5213 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5214 the new overlay string. (Bug#10159)
5215
01108e3f
PE
52162012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5217
5218 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5219 or that fprintf is async-signal-safe. POSIX doesn't require
5220 either assumption.
5221
82f8cd94
CY
52222012-09-22 Chong Yidong <cyd@gnu.org>
5223
5224 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5225 (Bug#8207).
5226
3cccbd87
KH
52272012-09-22 Kenichi Handa <handa@gnu.org>
5228
5229 * composite.c (composition_reseat_it): Handle the case that a
5230 grapheme cluster is not covered by a single font (Bug#12352).
5231
09c01941
CY
52322012-09-21 Chong Yidong <cyd@gnu.org>
5233
5234 * image.c (define_image_type): Avoid adding duplicate types to
5235 image_types (Bug#12463). Suggested by Jörg Walter.
5236
acfa068f 52372012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
5238
5239 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5240 (print_load_command_name): Add case LC_DATA_IN_CODE.
5241 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5242
acfa068f 52432012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
5244
5245 * eval.c (Frun_hook_with_args_until_success)
5246 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5247
acfa068f 52482012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
5249
5250 * fileio.c (Ffile_selinux_context): Only call freecon when
5251 lgetfilecon succeeded.
5252 (Fset_file_selinux_context): Likewise. (Bug#12444)
5253
acfa068f 52542012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
5255
5256 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5257 reordering, locate the cursor by calling set_cursor_from_row; if
5258 that fails, clear the desired glyph matrix before returning a
5259 failure indication to the caller. Fixes leaving garbled display
5260 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
5261 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5262 scrolling through multibyte text.
aa36e4d2 5263
e99f70c8
SM
52642012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5265
5266 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5267 calling mark_vectorlike since that's the one that marks the window.
5268 (mark_discard_killed_buffers): Mark the final cdr.
5269 * window.h (struct window): Move prev/next_buffers to the
5270 non-standard fields.
5271 * window.c (make_window): Initialize prev/next_buffers manually.
5272
f75beb47
PE
52732012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5274
5275 Omit unused arg EXPECTED from socket hooks.
5276 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5277 * nsterm.m (ns_term_init):
5278 * termhooks.h (struct terminal.read_socket_hook):
5279 * w32inevt.c (w32_console_read_socket):
5280 * w32term.c (w32_read_socket):
5281 * xterm.c (XTread_socket):
5282 Omit unused arg EXPECTED. All callers changed.
5283 (store_user_signal_events): Return void, not int, since callers no
5284 longer care about the return value. All uses changed.
5285
b019b76a
JB
52862012-09-20 Juanma Barranquero <lekktu@gmail.com>
5287
5288 * w32gui.h (XParseGeometry): Do not declare.
5289
05642592
PE
52902012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5291
e4bce92a 5292 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 5293 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
5294 <http://bugs.gnu.org/12471#8> (last line).
5295
05642592
PE
5296 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5297 (XParseGeometry): Now static. Substitute extremal values for
5298 values that are out of range.
5299
e543ae91
JD
53002012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5301
5302 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5303
5304 * nsfns.m (XParseGeometry): Remove.
5305 (Fx_create_frame): Call x_set_offset to correctly interpret
5306 top_pos in geometry.
5307
3a880af4 5308 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
5309 (Fx_parse_geometry): If there is a space in string, call
5310 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5311
45ba16c7
EZ
53122012-09-17 Eli Zaretskii <eliz@gnu.org>
5313
c8b9f1bc
EZ
5314 * search.c (scan_buffer): Use character positions in calls to
5315 region_cache_forward and region_cache_backward, not byte
5316 positions. (Bug#12196)
5317
b4c932a2
EZ
5318 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5319 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5320
45ba16c7
EZ
5321 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5322 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5323 emacs_blocked_malloc, now deleted.
5324
eeceac93
PE
53252012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5326
5327 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5328 The workaround was for improving performance on Solaris 2.4, but
5329 is getting in the way now. Emacs will still work if someone is
5330 still running Solaris 2.4 in a museum somewhere; Sun dropped
5331 support for Solaris 2.4 in 2003.
5332 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5333 * process.c (create_process) [HAVE_WORKING_VFORK]:
5334 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5335 since Emacs no longer uses vfork on that platform.
5336
78f83752
GM
53372012-09-17 Glenn Morris <rgm@gnu.org>
5338
5339 * emacs.c: Use COPYRIGHT.
5340
634b8cac
PE
53412012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5342
0caaedb1
PE
5343 Remove configure's --without-sync-input option (Bug#12450).
5344 When auditing signal-handling in preparation for cleaning it up,
5345 I found that SYNC_INPUT has race conditions and would be a real
5346 pain to fix. Since it's an undocumented and deprecated
5347 configure-time option, now seems like a good time to remove it.
5348 Also see <http://bugs.gnu.org/11080#16>.
5349 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5350 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5351 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5352 (malloc_hysteresis):
5353 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5354 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5355 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5356 (dont_register_blocks, bytes_used_when_reconsidered)
5357 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5358 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5359 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 5360 Remove. All uses removed.
0caaedb1
PE
5361 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5362 implementation, one that depends on whether the new macro
5363 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5364 is defined.
5365 * atimer.c (run_timers, handle_alarm_signal):
5366 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5367 (handle_async_input, process_pending_signals)
5368 (handle_input_available_signal, init_keyboard):
5369 * nsterm.m (ns_read_socket):
5370 * process.c (wait_reading_process_output):
5371 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5372 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5373 (emacs_write):
5374 * xterm.c (XTread_socket):
5375 Assume SYNC_INPUT.
5376 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5377 * eval.c (handling_signal): Remove. All uses removed.
5378 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5379 All uses replaced with the SYNC_INPUT version.
5380 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5381 Remove decls.
5382 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5383 Now static.
5384
634b8cac
PE
5385 * font.c (Ffont_shape_gstring): Remove unused local.
5386
83da1b55
GM
53872012-09-16 Glenn Morris <rgm@gnu.org>
5388
518650a5
GM
5389 * Makefile.in (clean): No longer run nextstep's clean.
5390
83da1b55
GM
5391 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5392 (ns_frag): Remove.
5393 (ns-app): Move here from ns.mk, and simplify.
5394 (clean): Simplify nextstep entry.
5395 * ns.mk: Remove file.
5396
85a43e2e
KH
53972012-09-17 Kenichi Handa <handa@gnu.org>
5398
5399 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5400 not covert the last few charactes.
5401
ba13e616 54022012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
5403
5404 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5405 here, but just check the validity of glyphs in the glyph-string.
5406
a8c729af
MR
54072012-09-16 Martin Rudalics <rudalics@gmx.at>
5408
3a880af4
SM
5409 * window.c (Fwindow_parameter, Fset_window_parameter):
5410 Accept any window as argument (Bug#12452).
a8c729af 5411
c077c059
JD
54122012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5413
5414 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5415 to ns_term_init to avoid memory leak.
5416
5417 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5418 explicit retain/release.
5419 (ns_term_init): Only allow one display. Initialize outerpool and
5420 ns_*_types.
5421
39a57ad0
PE
54222012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5423
5424 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5425 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5426 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5427 the Microsoft problem in a different way, by altering ../nt/config.nt.
5428
7105c8cb
EZ
54292012-09-15 Eli Zaretskii <eliz@gnu.org>
5430
5431 * w32xfns.c:
5432 * w32uniscribe.c:
5433 * w32term.c:
5434 * w32select.c:
5435 * w32reg.c:
5436 * w32proc.c:
5437 * w32menu.c:
5438 * w32inevt.c:
5439 * w32heap.c:
5440 * w32font.c:
5441 * w32fns.c:
5442 * w32console.c:
5443 * w32.c:
5444 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5445 by lisp.h. This completes removal of setjmp.h inclusion
5446 erroneously announced in the previous commit. (Bug#12446)
5447
5448 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5449 more accurate.
5450
5451 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5452 not defined as a macro. The latter happens on MS-Windows.
5453 (Bug#12446)
5454
0328b6de
PE
54552012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5456
5457 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5458 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 5459 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
5460 only reason for the instance was because "lisp.h" was included.
5461 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5462 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5463 and _longjmp with the new symbols. Emacs already uses _setjmp if
5464 available, so this change affects only POSIXish hosts that have
5465 sigsetjmp but not _setjmp, such as some versions of Solaris and
5466 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5467 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5468 (png_load_body) [HAVE_PNG]:
5469 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5470 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5471 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5472 since PNG requires jmp_buf. This is the only exception to the
5473 general rule that we now use sys_setjmp and sys_longjmp.
5474 This exception is OK since this code does not change the signal
5475 mask or longjmp out of a signal handler.
5476
2af03429
PE
54772012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5478
5479 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5480 Include "syssignal.h", for 'main_thread'.
5481
2f294edf
DA
54822012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5483
5484 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
5485 * insdel.c (replace_range, replace_range_2):
5486 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
5487 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5488 Remove redundant check before calling offset_intervals.
5489
6b533e9c
MR
54902012-09-14 Martin Rudalics <rudalics@gmx.at>
5491
5492 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5493 current buffer (Bug#12387).
5494
2a7931e3
JB
54952012-09-14 Juanma Barranquero <lekktu@gmail.com>
5496
5497 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5498
c18e885b
PE
54992012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5500
5501 Use a more backwards-compatible timer format (Bug#12430).
5502 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5503 vector element, not from the 4th, since PSECS is now at the end.
5504 (Fcurrent_idle_time): Doc fix.
5505
d59a1afb
DA
55062012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5507
5508 Function to mark objects and remove killed buffers at once.
5509 * alloc.c (discard_killed_buffers): Rename to ...
5510 (mark_discard_killed buffers) ... new name. Add marking
5511 of remaining objects. Fix comment. Adjust users.
5512 (mark_object): Do not touch frame buffer lists here.
5513 * frame.c (delete_frame): Reset frame buffer lists here.
5514
5f0cb45a
PE
55152012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5516
8ea47e3a
PE
5517 Better workaround for GNOME bug when --enable-gcc-warnings.
5518 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5519 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5520 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5521
4a4bbad2
PE
5522 Simplify SIGIO usage (Bug#12408).
5523 The code that dealt with SIGIO was crufty and confusing, e.g., it
5524 played tricks like "#undef SIGIO" but these tricks were not used
5525 consistently. Simplify mostly by not #undeffing standard symbols,
5526 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5527 or not as we please) rather than "defined SIGIO" (standard symbol
5528 that we probably shouldn't #undef).
5529 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5530 Modules that need it can include it.
5531 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5532 * dispextern.h (ignore_sigio): New decl.
5533 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5534 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5535 * emacs.c (shut_down_emacs):
5536 * keyboard.c (kbd_buffer_store_event_hold):
5537 Use ignore_sigio rather than invoking 'signal' directly.
5538 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5539 for FIONREAD.
5540 (FIONREAD, SIGIO): Do not #undef.
5541 (tty_read_avail_input): Use #error rather than a syntax error.
5542 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5543 for I_PIPE, used by SETUP_SLAVE_PTY.
5544 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5545 * sysdep.c (croak): Remove; no longer needed. This bit of
5546 temporary code, with Fred N. Fish's comment that it's temporary,
5547 has been in Emacs since at least 1992!
5548 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5549 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5550 * syssignal.h (croak): Remove decl.
5551 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5552 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5553 now that we're termios-only.
5554 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5555 * term.c (dissociate_if_controlling_tty): Use #error rather than
5556 a run-time error.
5557
5f0cb45a
PE
5558 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5559 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5560 to work around GNOME bug 683906.
5561 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5562 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5563 This works around GCC bug 54561.
5564
40bce90b
PE
55652012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5566
5567 More fixes for 'volatile' and setjmp/longjmp.
5568 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5569 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5570 (png_load_body) [HAVE_PNG]:
5571 (jpeg_load_body) [HAVE_JPEG]:
5572 New function, with most of the old parent function's body.
5573 (png_load) [HAVE_PNG]:
5574 (jpeg_load) [HAVE_JPEG]:
5575 Invoke the new function, to avoid longjmp munging our locals.
5576 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5577 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5578 longjmp is passed 2, as the C standard doesn't guarantee this.
5579 Instead, store the failure code into mgr->failure_code.
5580
bfeae2cf
SM
55812012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5582
5583 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5584 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5585 (syms_of_keyboard): Remove support for unread-command-char.
5586
8099e36b
EZ
55872012-09-12 Eli Zaretskii <eliz@gnu.org>
5588
5589 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5590 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5591 violation. (Bug#12426)
5592
92547ff9
PE
55932012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5594
5595 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5596
45b82ad0
SM
55972012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5598
5599 * eval.c: Add `inhibit-debugger'.
5600 (Qinhibit_debugger): New symbol.
5601 (call_debugger): Bind it instead of Qdebug_on_error.
5602 (maybe_call_debugger): Test Vinhibit_debugger.
5603 (syms_of_eval): Define inhibit-debugger.
5604 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5605 (syms_of_xdisp): Remove inhibit-debug-on-message.
5606
5779a1dc
PE
56072012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5608
50f2e553
PE
5609 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5610 If a nonvolatile local variable is written before a _longjmp to
5611 the frame containing the variable, and is read after the _longjmp,
5612 the value read is indeterminate. Some local variables of type
5613 'struct handler' and 'struct catchtag' are used in this way, so
5614 mark each of their slots as volatile if the slot can be set before
5615 _longjmp and read afterwards.
5616 * lisp.h (struct handler): var and chosen_clause are now volatile.
5617 (struct catchtag): val, next, and pdlcount are now volatile.
5618
ae1d87e2
PE
5619 * bidi.c (bidi_push_it, bidi_pop_it):
5620 * fns.c (copy_hash_table):
5621 * image.c (define_image_type):
5622 * keyboard.c (kbd_buffer_store_event_hold):
5623 * process.c (Fprocess_send_eof):
5624 * xfaces.c (x_create_gc) [HAVE_NS]:
5625 * xgselect.c (xg_select):
5626 Prefer assignment to memcpy when either will do.
5627
5779a1dc
PE
5628 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5629 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5630 time an item is removed. No need to mark this function 'inline';
5631 the compiler knows better than we do.
5632
c4c9756b
JD
56332012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5634
5635 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5636 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5637 to change_frame_size (Bug#12388).
5638 (windowDidResize:): Pass YES to updateFrameSize.
5639
5640 * nsterm.h: Add delay parameter to updateFrameSize.
5641
d73e321c
DA
56422012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5643
5644 Discard killed buffers from deleted window and frame objects.
5645 This reduces an amount of references to killed buffers and
5646 helps GC to reclaim them faster.
5647 * alloc.c (discard_killed_buffers): New function.
5648 (mark_object): Use it for deleted windows and frames.
5649 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 5650 or deleted frame, restore its global binding.
d73e321c
DA
5651 * data.c (swap_in_global_binding): Add GC notice.
5652 (swap_in_symval_forwarding): Use convenient set_blv_where.
5653 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5654 * window.h: ... to here.
5655
e578f381
DA
56562012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5657
5658 Convenient macro to check whether the buffer is live.
5659 * buffer.h (BUFFER_LIVE_P): New macro.
5660 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5661 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5662
3057e615
YM
56632012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5664
5665 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5666 composition cases (Bug#12364).
5667
5668 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5669 overhang of succeeding glyphs overlapping box cursor.
5670
5671 * w32term.c (x_draw_glyph_string): Likewise.
5672
6fda35f2
PE
56732012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5674
c990426a
PE
5675 Simplify, document, and port floating-point (Bug#12381).
5676 The porting part of this patch fixes bugs on non-IEEE platforms
5677 with frexp, ldexp, logb.
5678 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5679 Now static.
5680 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5681 support, by removing commented-out code and briefly listing the
5682 C89 functions excluded. The commented-out stuff was confusing
5683 maintenance, e.g., we thought we needed cbrt but it was commented out.
5684 (logb): Remove decl; no longer needed.
5685 (isfinite): New macro, if not already supplied.
5686 (isnan): Don't replace any existing macro.
5687 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5688 are present on all C89 platforms.
5689 (Ffrexp): Do not special-case zero, as frexp does the right thing
5690 for that case.
5691 (Flogb): Do not use logb, as it doesn't have the desired meaning
5692 on hosts that use non-base-2 floating point. Instead, stick with
5693 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5694 frexp, to avoid getting an unspecified result.
5695
6fda35f2
PE
5696 * xdisp.c (Qinhibit_debug_on_message): Now static.
5697
16130a58
JD
56982012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5699
5700 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5701 NSBezierPath (Bug#12131).
5702
d105a573
CY
57032012-09-10 Chong Yidong <cyd@gnu.org>
5704
5705 * fns.c (Fdelq, Fdelete): Doc fix.
5706
ff55dfe8
PE
57072012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5708
5709 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5710 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5711
e7032e7c
SM
57122012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5713
5714 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5715 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5716 Use it.
5717
e9957956
EZ
57182012-09-09 Eli Zaretskii <eliz@gnu.org>
5719
aba05ce9
EZ
5720 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5721 left fringe if the window has a left margin. This avoids leaving
5722 traces of the cursor because its leftmost pixel is not drawn over.
5723
e9957956
EZ
5724 * dispnew.c (update_window_line): When the left margin area of a
5725 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5726 that screen line. (Bug#12277)
5727
f6196b87
PE
57282012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5729
5730 Assume C89 or later for math functions (Bug#12381).
5731 This simplifies the code, and makes it a bit smaller and faster,
5732 and (most important) makes it easier to clean up signal handling
5733 since we can stop worring about floating-point exceptions in
5734 library code. That was a problem before C89, but the problem
5735 went away many years ago on all practical Emacs targets.
5736 * data.c, image.c, lread.c, print.c:
5737 Don't include <math.h>; no longer needed.
5738 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5739 might be autoconfigured, as that never happens.
5740 * data.c (fmod):
5741 * doprnt.c (DBL_MAX_10_EXP):
5742 * print.c (DBL_DIG):
5743 Remove. C89 or later always defines these.
5744 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5745 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5746 (arith_error, domain_error, domain_error2):
5747 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5748 no longer needed -- we simply return what C returns. All uses removed.
5749 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5750 the wrapped code.
5751 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5752 Remove. All uses expanded, as these macros are no longer used
5753 more than once and are now more trouble than they're worth.
5754 (Ftan): Use tan, not sin / cos.
5755 (Flogb): Assume C89 frexp.
5756 (fmod_float): Assume C89 fmod.
5757 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
5758 (init_floatfns): Remove. All uses removed.
5759
9d7f1863
JD
57602012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5761
5762 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
5763 compositeToPoint for OSX < 10.6 (Bug#12390).
5764
eabf0404
PE
57652012-09-08 Paul Eggert <eggert@cs.ucla.edu>
5766
5767 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
5768 This produces more-accurate results.
5769
0b3b1d23
JD
57702012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5771
5772 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
5773 changes (Bug#12088).
5774
6dcef6ec
CY
57752012-09-08 Chong Yidong <cyd@gnu.org>
5776
5777 * syntax.c (Fstring_to_syntax): Doc fix.
5778
aa7d57c5
JD
57792012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5780
5781 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
5782 in the internal border.
5783 (x_set_window_size): Remove static variables and their usage.
5784 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
5785 (ns_after_update_window_line, ns_draw_fringe_bitmap):
5786 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
5787 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
5788 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
5789 (ns_fix_rect_ibw): Remove.
5790 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
5791 (ns_dumpglyphs_box_or_relief): Ditto.
5792 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
5793 adjustment.
5794 (ns_dumpglyphs_image): Ditto.
fc0c31f8 5795 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
5796 border adjustment.
5797 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
5798 their usage. Add fringe_extended_p and its use as in other terms.
5799 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
5800 scroll bar was removed.
5801 (updateFrameSize): New function.
5802 (windowDidResize): Move code to updateFrameSize and call it.
5803
5804 * nsterm.h (EmacsView): Add updateFrameSize.
5805
1a5432bc
CY
58062012-09-07 Chong Yidong <cyd@gnu.org>
5807
b4f5313e
CY
5808 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
5809
1a5432bc
CY
5810 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
5811
1a4f1e9b
PE
58122012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5813
5814 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
5815 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
5816 Problem introduced when merging patches. Noted by Eli Zaretskii in
5817 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
5818 * floatfns.c: Comment fix.
5819 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
5820 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
5821 and anyway the declaration is harmless even if SIGDANGER is not defined.
5822 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
5823 defined BROKEN_FIONREAD). systty.h formerly did this, but other
5824 source files not surprisingly expected syssignal.h to define, or
5825 not define, SIGIO, and it's cleaner to do it that way, for consistency.
5826 Include <sys/ioctl.h>, for FIONREAD.
5827 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
5828 This eliminates a problem whereby other files mysteriously had
5829 to include "syssignal.h" before including "systty.h" if they
5830 wanted to use "#ifdef SIGIO".
5831
bc8000ff
EZ
58322012-09-07 Eli Zaretskii <eliz@gnu.org>
5833
3e6d6928
EZ
5834 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
5835
5836 * w32.c (sigemptyset): Empty the set.
5837 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
5838
bc8000ff
EZ
5839 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5840
b4fa72f2
DA
58412012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5842
5843 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5844 (mark_object): Likewise for frame objects.
5845
30730c93
PE
58462012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5847
5848 * syssignal.h (handle_on_main_thread): Always declare,
5849 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5850 This ports to platforms without HAVE_PTHREAD.
5851
2fe28299
PE
58522012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5853
5854 Signal-handler cleanup (Bug#12327).
5855 Emacs's signal handlers were written in the old 4.2BSD style with
5856 sigblock and sigmask and so forth, and this led to some
5857 inefficiencies and confusion. Rewrite these to use
5858 pthread_sigmask etc. without copying signal sets around. Also,
5859 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5860 'signal', and instead use functions that do not attempt to take
5861 over the system name space. This patch causes Emacs's text
5862 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5863 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5864 Do not include <signal.h> or "syssignal.h", as these
5865 modules do not use signals.
5866 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5867 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5868 Do not include <signal.h>, as "syssignal.h" does that for us now.
5869 * atimer.c (sigmask_atimers): New function.
5870 (block_atimers, unblock_atimers): New functions,
5871 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5872 All uses replaced.
5873 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5874 no longer needed here.
5875 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 5876 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
5877 * sysdep.c (struct save_signal): New member 'action', replacing
5878 old member 'handler'.
5879 (save_signal_handlers, restore_signal_handlers):
5880 Use sigaction instead of 'signal' to save and restore.
5881 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5882 New function. All users of 'signal' modified to use set_sighandler
5883 if they're writeonly, and to use sys_signal if they're read+write.
5884 (emacs_sigaction_init, forwarded_signal): New functions.
5885 (sys_signal): Remove. All uses replaced by calls to sigaction
5886 and emacs_sigaction_init, or by direct calls to 'signal'.
5887 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5888 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5889 all uses replaced by pthread_sigmask etc. calls.
5890 * syssignal.h: Include <signal.h>.
5891 (emacs_sigaction_init, forwarded_signal): New decls.
5892 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5893 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5894 (sigmask, sys_sigmask): Remove; no longer needed.
5895 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5896 (sigblock, sigunblock, sigfree):
5897 (sigsetmask) [!defined sigsetmask]:
5898 Remove. All uses replaced by pthread_sigmask.
5899 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
5900 no longer need to be replaced, and its typical old uses
5901 are now done via emacs_sigaction_init and sigaction.
5902 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
5903 (sys_sigdel): Remove; unused.
5904 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
5905
0216c128
EZ
59062012-09-06 Eli Zaretskii <eliz@gnu.org>
5907
5908 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
5909 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5910
c752cfa9
DA
59112012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5912
5913 Explicitly mark buffer_defaults and buffer_local_symbols.
5914 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5915 mark_local_symbols here.
5916 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
5917 since special buffers aren't marked here any more.
5918 (allocate_buffer): Chain new buffer with all_buffers here...
5919 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
5920 not here.
5921 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
5922 (syms_of_buffer): Remove staticpro of the above.
5923 (init_buffer_once): Set names for buffer_defaults and
5924 buffer_local_symbols.
5925
a864ef14
PE
59262012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5927
5928 Use bool for booleans in font-related modules.
5929 * font.c (font_intern_prop, font_style_to_value)
5930 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
5931 (generate_otf_features, font_check_otf_features, font_check_otf)
5932 (font_match_p, font_list_entities, font_at):
5933 * fontset.c (fontset_id_valid_p, reorder_font_vector
5934 (fontset_find_font, Fset_fontset_font)
5935 (face_suitable_for_char_p) [0]:
5936 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
5937 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
5938 (m17n_flt_initialized, ftfont_shape_by_flt):
5939 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
5940 * nsfont.m (nsfont_draw):
5941 * w32font.c (w32font_draw):
5942 * w32term.c (x_draw_glyphless_glyph_string_foreground):
5943 Use bool for booleans.
5944 * font.h: Adjust to above API changes.
5945 (struct font, struct font_driver, struct font_driver_list):
5946 Use bool for booleans.
5947 (struct font): Remove useless member encoding_type.
5948 All users removed.
5949 * fontset.c, xftfont.c: Omit unnecessary static decls.
5950
0699fc18
DA
59512012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5952
5953 * alloc.c (mark_object): Revert window marking code
5954 since it's unsafe for the Fset_window_configuration.
5955
20ef56db
PE
59562012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5957
2fe28299 5958 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
5959 Be more systematic about preserving errno whenever a signal
5960 handler returns, even if it's not in the main thread. Do this by
5961 renaming signal handlers to distinguish between signal delivery
5962 and signal handling. All uses changed.
5963 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
5964 * data.c (deliver_arith_signal): Rename from arith_error.
5965 * dispnew.c (deliver_window_change_signal): Rename from
5966 window_change_signal.
5967 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
5968 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
5969 * keyboard.c (deliver_input_available_signal): Rename from
5970 input_available_signal.
5971 (deliver_user_signal): Rename from handle_user_signal.
5972 (deliver_interrupt_signal): Rename from interrupt_signal.
5973 * process.c (deliver_pipe_signal): Rename from send_process_trap.
5974 (deliver_child_signal): Rename from sigchld_handler.
5975 * atimer.c (handle_alarm_signal):
5976 * data.c (handle_arith_signal):
5977 * dispnew.c (handle_window_change_signal):
5978 * emacs.c (handle_fatal_signal, handle_danger_signal):
5979 * keyboard.c (handle_input_available_signal):
5980 * keyboard.c (handle_user_signal, handle_interrupt_signal):
5981 * process.c (handle_pipe_signal, handle_child_signal):
5982 New functions, with the actual signal-handling code taken from the
5983 original respective signal handlers, sans the sporadic attempts to
5984 preserve errno, since that's now done by handle_on_main_thread.
5985 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
5986 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
5987 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5988 Move to sysdep.c.
5989 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5990 Move initialization of main_thread to sysdep.c's init_signals.
5991 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
5992 our usage, and simplifies the mainline code.
5993 (record_child_status_change): New static function, as a helper
5994 for handle_child_signal, and with most of the old child handler's
5995 contents.
5996 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
5997 (handle_child_signal): Use the above.
5998 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5999 Moved here from emacs.c.
6000 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6001 code moved here from emacs.c's main function.
6002 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
6003 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6004 This lets callers save and restore errno properly.
20ef56db 6005
e3ccf108
DA
60062012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6007
6008 Remove redundant or unused things here and there.
6009 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6010 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6011 * editfns.c (Fcompare_buffer_substrings): Likewise.
6012 * frame.h (struct terminal, struct font_driver_list):
6013 Remove redundant declarations.
6014 * window.h (Qleft, Qright): Likewise.
6015
697e1e39
DA
60162012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6017
6018 Do not mark objects from deleted buffers, windows and frames.
6019 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6020 (mark_object): Likewise for windows and frames.
6021
c1ca42ca
DA
60222012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6023
6024 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6025 buffer_defaults and buffer_local_symbols as valid objects.
6026 Return special value to denote them.
6027
014d93be
PE
60282012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6029
f75d7a91
PE
6030 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6031 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6032 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6033 (file_name_absolute_p, Fsubstitute_in_file_name):
6034 (check_executable, check_writable, Ffile_accessible_directory_p)
6035 (Fset_file_selinux_context, Fdefault_file_modes)
6036 (Finsert_file_contents, choose_write_coding_system)
6037 (Fwrite_region, build_annotations, a_write, e_write)
6038 (Fdo_auto_save):
6039 * filelock.c (boot_time_initialized, get_boot_time)
6040 (get_boot_time_1, lock_file_1, within_one_second):
6041 * floatfns.c (in_float):
6042 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6043 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6044 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6045 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6046 * window.c (compare_window_configurations):
6047 Use bool for booleans.
6048 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6049 (Fdefault_file_modes): Now mode_t, not int, for modes.
6050 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6051 (internal_delete_file): Now returns void, not a (boolean) int,
6052 since nobody was looking at the return value.
6053 * lisp.h, window.h: Adjust to above API changes.
6054
014d93be
PE
6055 * xdisp.c (set_message): Simplify and reindent last change.
6056
776f29e1
JB
60572012-09-05 Juanma Barranquero <lekktu@gmail.com>
6058
6059 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6060
7f7e0167
LI
60612012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6062
6063 * eval.c (call_debugger): Make the function non-static so that we
6064 can call it from set_message.
6065
6066 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6067 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6068
cf29dd84
PE
60692012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6070
6071 Give more-useful info on a fatal error (Bug#12328).
6072 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6073 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6074 of doing the work ourselves.
6075 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6076 do most of the work.
6077 (fatal_error_backtrace): New function, taken from the guts
6078 of the old fatal_error_signal, but with a new option to output
6079 a backtrace.
6080 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6081 info about the signal than just its number.
6082 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6083 * sysdep.c: Include <execinfo.h>
6084 (emacs_backtrace): New function, taken partly from the previous
6085 code of the 'die' function.
6086 (emacs_abort): Call fatal_error_backtrace rather than abort.
6087
972debf2
SM
60882012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6089
6090 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6091 eager (load-time) macro-expansion.
6092 * lisp.mk (lisp): Add macroexp.
6093
1088b922
PE
60942012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6095
6096 Simplify redefinition of 'abort' (Bug#12316).
6097 Do not try to redefine the 'abort' function. Instead, redo
6098 the code so that it calls 'emacs_abort' rather than 'abort'.
6099 This removes the need for the NO_ABORT configure-time macro
6100 and makes it easier to change the abort code to do a backtrace.
6101 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6102 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6103 Remove; sysdep.c's emacs_abort now takes its place.
6104 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6105 'abort' changed to use 'emacs_abort'.
6106 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6107 (abort) [!defined abort]: Rename to ...
6108 (emacs_abort): ... new name.
6109 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6110 the place of the old 'abort' in emacs.c.
6111 * w32.c, w32fns.c (abort): Do not #undef.
6112 * w32.c (emacs_abort): Rename from w32_abort.
6113
30934d33
EZ
61142012-09-04 Eli Zaretskii <eliz@gnu.org>
6115
6116 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6117 offsets[j].dv, since the y axis of the screen coordinates points
6118 down, while the y axis of the font definition coordinates points
6119 up. This fixes display of Arabic diacritics such as KASRA and
6120 KASRATAN. (Bug#11860)
6121
af26b72c
PE
61222012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6123
6124 Be more systematic about _setjmp vs setjmp.
6125 * alloc.c (test_setjmp, mark_stack):
6126 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6127 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6128 (png_load, my_error_exit, jpeg_load):
6129 * process.c (send_process_trap, send_process):
6130 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6131 The underscored versions are up to 30x faster on some hosts.
6132 Formerly, the code used setjmp+longjmp sometimes and
6133 _setjmp+_longjmp at other times, with no particular reason to
6134 prefer setjmp+longjmp.
6135
26d4541d
PE
61362012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6137
d42f4f0f 6138 Fix minor problem found by static checking.
26d4541d 6139 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 6140
c5e28e39
MR
61412012-09-03 Martin Rudalics <rudalics@gmx.at>
6142
6143 * buffer.c (Fdelete_all_overlays): New function.
6144
3eab3ca9
CY
61452012-09-03 Chong Yidong <cyd@gnu.org>
6146
6147 * gtkutil.c: Add extern decl for Qxft.
6148
c04889f8
PE
61492012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6150
1882aa38
PE
6151 * emacs.c, eval.c: Use bool for boolean.
6152 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6153 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6154 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6155 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6156 (main, decode_env_path, Fdaemon_initialized):
6157 * eval.c (call_debugger, Finteractive_p, interactive_p):
6158 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6159 (maybe_call_debugger, Fbacktrace):
6160 * process.c (read_process_output, exec_sentinel):
6161 Use bool for booleans.
6162 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6163 All callers changed.
6164 * eval.c (interactive_p): Omit always-true boolean argument
6165 EXCLUDE_SUBRS_P. All callers changed.
6166 * dispextern.h, lisp.h: Reflect above API changes.
6167 * firstfile.c (dummy): Use the address of 'main', whose signature
6168 won't change, instead of the address of 'initialize', whose
6169 signature just changed from int to bool.
6170 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6171 * msdos.c (fatal_error_in_progress): ... from here.
6172 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6173 of incrementing it.
6174 (redisplay_internal, unwind_redisplay): Simply clear
6175 REDISPLAYING_P when unwinding, instead of saving its previous,
6176 always-false value and then restoring it.
6177
a411ac43
PE
6178 Clean up some extern decls.
6179 Mostly, this hoists extern decls out of .c files and into .h files.
6180 That way, we're more likely to catch errors if the interfaces change.
6181 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6182 declare xg_mark_data.
6183 * dispextern.h (x_frame_parm_handlers):
6184 * font.h (Qxft):
6185 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6186 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6187 (Qultra_bold, Qoblique, Qitalic):
6188 Move extern decl here from .c file.
6189 * alloc.c (xg_mark_data) [USE_GTK]:
6190 * doc.c (Qclosure):
6191 * eval.c (Qlexical_binding):
6192 * fns.c (time) [!HAVE_UNISTD_H]:
6193 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6194 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6195 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6196 * lread.c (Qinternal_interpreter_environment):
6197 * minibuf.c (Qbuffer):
6198 * process.c (QCfamily, QCfilter):
6199 * widget.c (free_frame_faces):
6200 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6201 * xfont.c (x_clear_errors):
6202 * xterm.c (x_frame_parm_handlers):
6203 Remove now-redundant extern decls.
6204 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6205 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6206 Now static.
6207 * xfaces.c: Remove unnecessary static decls.
6208 * xterm.c (updating_frame): Remove decl of nonexistent object.
6209
c04889f8
PE
6210 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6211 when building globals.h, as the objects that are not built on
6212 this host are not needed to compile C files on this host.
6213
8b339673
JD
62142012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6215
6216 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6217
6218 * frame.h: Add missing prototype for x_wm_set_size_hint.
6219
a08d4ba7
PE
62202012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6221
6222 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6223 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6224 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6225 (Fsubstitute_command_keys):
6226 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6227 (save_excursion_save, save_excursion_restore)
6228 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6229 (format_time_string, general_insert_function)
6230 (make_buffer_string, make_buffer_string_both)
6231 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6232 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6233 (copy_text, insert_1, insert_1_both, insert_from_string)
6234 (insert_from_string_before_markers, insert_from_string_1)
6235 (insert_from_buffer, insert_from_buffer_1, replace_range)
6236 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6237 (del_range_2, modify_region):
6238 * intervals.c (intervals_equal, balance_possible_root_interval)
6239 (adjust_intervals_for_insertion, merge_properties_sticky)
6240 (graft_intervals_into_buffer, lookup_char_property)
6241 (adjust_for_invis_intang, set_point_both)
6242 (get_property_and_range, compare_string_intervals)
6243 (set_intervals_multibyte_1, set_intervals_multibyte):
6244 * keyboard.c (decode_timer):
6245 Use bool for boolean.
6246 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6247 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6248
48c948de
CY
62492012-09-02 Chong Yidong <cyd@gnu.org>
6250
6251 * keymap.c (push_key_description): Print M-TAB as C-M-i
6252 (Bug#11758).
6253
6c49a40b
JB
62542012-09-02 Juanma Barranquero <lekktu@gmail.com>
6255
6256 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6257 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6258 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6259 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6260 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6261 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6262 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6263
4dfbd238
EZ
62642012-09-01 Eli Zaretskii <eliz@gnu.org>
6265
7e510e28
EZ
6266 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6267 more than one grapheme cluster passed to the shaper: compute the
6268 offset adjustment values separately for each cluster. (Bug#11860)
6269
4dfbd238
EZ
6270 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6271 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6272 about implicit conversions from integer to pointer.
6273
86571ae0
DC
62742012-09-01 Daniel Colascione <dancol@dancol.org>
6275
6276 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6277 system used too early.
6278
0e23ef9d
PE
62792012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6280
6281 Better seed support for (random).
6282 * emacs.c (main): Call init_random.
6283 * fns.c (Frandom): Set the seed from a string argument, if given.
6284 Remove long-obsolete Gentzel cruft.
6285 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6286 (init_random): New function.
6287
17a2cbbd
DC
62882012-09-01 Daniel Colascione <dancol@dancol.org>
6289
6290 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6291 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6292 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6293 x_wm_set_size_hint, x_query_colors, x_real_positions,
6294 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6295 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6296 all of which have been moved to common code.
6297
6298 * xfaces.c: Include TERM_HEADER instead of listing all possible
6299 window-system headers.
6300
6301 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6302 to match header.
6303
6304 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6305 directly accessing frame internals.
6306
f18cbb28 6307 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
6308 globals_of_w32font.
6309
6310 * process.c: Include TERM_HEADER instead of listing all possible
6311 window-system headers.
6312
3a880af4
SM
6313 * nsterm.h: Remove declarations now in frame.h.
6314 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
6315
6316 * menu.c: Include TERM_HEADER instead of listing all possible
6317 window-system headers.
6318
6319 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6320 window system.
6321
6322 * keyboard.c: Include TERM_HEADER instead of listing all possible
6323 window-system headers.
6324
6325 * image.c: Include TERM_HEADER instead of listing all possible
6326 window-system headers. Declare Vlibrary_cache when compiling for
6327 Windows.
6328
6329 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6330 window system declarations.
6331
6332 * frame.h: Move common functions here: set_frame_menubar,
6333 x_set_window_size, x_sync, x_get_focus_frame,
6334 x_set_mouse_position, x_set_mouse_pixel_position,
6335 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6336 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6337 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6338 x_activate_menubar, x_real_positions, x_bitmap_icon,
6339 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6340 and x_query_colors.
6341
6342 * frame.c: Include TERM_HEADER instead of listing all possible
6343 window-system headers.
6344
6345 * font.c: Include TERM_HEADER instead of listing all possible
6346 window-system headers.
6347
6348 * emacs.c: Include TERM_HEADER.
6349
f18cbb28
EZ
6350 * dispnew.c: Include TERM_HEADER instead of listing all possible
6351 window-system headers.
17a2cbbd 6352
f18cbb28 6353 * ccl.h: Include character.h.
17a2cbbd
DC
6354
6355 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6356 the current window system; include in list of objects to link into
6357 Emacs.
6358
c650a5de
DA
63592012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6360
6361 Remove mark_ttys function and fix tty_display_info initialization.
6362 * lisp.h (mark_ttys): Remove prototype.
6363 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6364 to mark_ttys because all possible values of 'top_frame' slot are
6365 the frames which are reachable from Vframe_list.
6366 * term.c (mark_ttys): Remove.
6367 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6368
4e0f6479
DA
63692012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6370
6371 Change struct frame bitfields from unsigned char to unsigned.
6372 * frame.h (struct frame): Change type of 'display_preempted',
6373 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6374 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6375 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6376 bitfields from unsigned char to unsigned.
6377
8b96a52c
DA
63782012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6379
6380 Remove unused member of struct x_output and struct w32_output.
6381 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6382 * w32term.h (struct w32_output): Likewise.
6383
b4444c8a
JD
63842012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6385
6386 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6387 does not become zero (Bug#12234).
6388
b98521db
PE
63892012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6390
6391 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6392 for GCC 4.7.1 x86-64.
6393
31d02438
GM
63942012-08-30 Glenn Morris <rgm@gnu.org>
6395
6396 * lread.c (init_lread): For out-of-tree builds, only add the
6397 source directory's site-lisp dir to the load-path if it exists,
6398 consistent with in-tree builds. (Bug#12302)
6399
7f8941d8
JD
64002012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6401
6402 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 6403 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
6404 (windowShouldClose:): Set window_closed.
6405 (dealloc): New member, free button_values.
fc0c31f8
JB
6406 (process_dialog:): Make member function. Remove window argument,
6407 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
6408 in button_values.
6409 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 6410 with tag. Remove return self, declare return value as void.
7f8941d8
JD
6411 (addString:row:): Remove return self, declare return value as void.
6412 (addSplit): Remove return self, declare return value as void.
6413 (clicked:): Remove return self, declare return value as void.
fc0c31f8 6414 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
6415 (initFromContents:isQuestion:): Adjust call to process_dialog.
6416 Code formatting change.
6417 (timeout_handler:): Set timer_fired to YES.
6418 (runDialogAt:): Set timer_fired to NO.
6419 Handle click on close button as quit.
6420
6421 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6422 Add window_closed and button_values. Add void as return value for
6423 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6424 Add process_dialog as new member.
6425
eada0861 64262012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 6427
eada0861
GM
6428 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6429 is not one of the heaps we manage. (Bug#12242)
6430
64312012-08-28 Glenn Morris <rgm@gnu.org>
6432
6433 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6434
457294dd
MR
64352012-08-28 Martin Rudalics <rudalics@gmx.at>
6436
6437 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
6438 auto-buffer-name window parameter. Install revision of reverted
6439 fix.
457294dd 6440
4f2daf31
DA
64412012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6442
6443 Do not allow to set major mode for a dead buffer.
6444 * buffer.c (Fset_buffer_major_mode): Signal an error
6445 if the buffer is dead.
6446 (Fother_buffer, other_buffer_safely): Remove redundant
6447 nested declaration.
6448
66322887
DA
64492012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6450
6451 Always use set_buffer_if_live to restore original buffer at unwind.
6452 * buffer.h (record_unwind_current_buffer): New function.
6453 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6454 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6455 * undo.c, window.c: Adjust users.
6456 * buffer.c (set_buffer_if_live): Fix comment.
6457
a3d794a1
DA
64582012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6459
6460 Fix usage of set_buffer_internal.
6461 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6462 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6463 * coding.c (decode_coding): Omit redundant test.
6464 * fileio.c (decide_coding_unwind): Likewise.
6465 * fns.c (secure_hash): Likewise.
6466 * insdel.c (modify_region): Likewise.
6467 * keyboard.c (command_loop_1): Likewise.
6468 * print.c (PRINTFINISH): Likewise.
6469 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6470
59ea14cd
PE
64712012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6472
6473 * dispnew.c: Use bool for boolean.
6474 (frame_garbaged, display_completed, delayed_size_change)
6475 (fonts_changed_p, add_window_display_history)
6476 (add_frame_display_history, verify_row_hash)
6477 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6478 (row_equal_p, realloc_glyph_pool)
6479 (allocate_matrices_for_frame_redisplay)
6480 (showing_window_margins_p)
6481 (adjust_frame_glyphs_for_frame_redisplay)
6482 (build_frame_matrix_from_leaf_window, make_current)
6483 (mirrored_line_dance, mirror_line_dance, update_frame)
6484 (update_window_tree, update_single_window)
6485 (check_current_matrix_flags, update_window, update_text_area)
6486 (update_window_line, set_window_update_flags, scrolling_window)
6487 (update_frame_1, scrolling, buffer_posn_from_coords)
6488 (do_pending_window_change, change_frame_size)
6489 (change_frame_size_1, sit_for):
6490 Use bool for boolean.
6491 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6492 and remove last int (actually boolean) argument, which was always 0.
6493 All callers changed.
6494 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6495 * dispextern.h (struct composition_it): Use bool for boolean.
6496 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6497 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6498 * dired.c (file_name_completion):
6499 Use bool for boolean. (This was missed in an earlier change.)
6500
95072a94
MR
65012012-08-27 Martin Rudalics <rudalics@gmx.at>
6502
6503 * window.c (Fset_window_configuration): Revert first part of
6504 last change.
6505
0f19feff
JD
65062012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6507
6508 * nsterm.h (NSPanel): New class variable dialog_return.
6509
3a880af4
SM
6510 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6511 Initialize dialog_return.
0f19feff
JD
6512 (windowShouldClose:): Use stop instead of stopModalWithCode.
6513 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6514 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6515 event.
6516 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6517 modal loop returns.
6518
f10fe38f
PE
65192012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6520
de1339b0
PE
6521 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6522 * composite.c (find_composition, composition_gstring_p)
6523 (composition_reseat_it, find_automatic_composition):
6524 * data.c (let_shadows_buffer_binding_p)
6525 (let_shadows_global_binding_p, set_internal, make_blv)
6526 (Fmake_variable_buffer_local, Fmake_local_variable)
6527 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6528 (cons_to_signed, arith_driver):
6529 * dbusbind.c (xd_in_read_queued_messages):
6530 * dired.c (directory_files_internal, file_name_completion):
6531 Use bool for booleans.
6532 * dired.c (file_name_completion):
6533 * process.h (fd_callback):
6534 Omit int (actually boolean) argument. It wasn't being used.
6535 All uses changed.
6536 * composite.h, lisp.h: Reflect above API changes.
6537
f10fe38f
PE
6538 * cmds.c, coding.c: Use bool for booleans.
6539 * cmds.c (move_point, Fself_insert_command):
6540 * coding.h (struct composition status, struct coding_system):
6541 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6542 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6543 (emacs_mule_char, decode_coding_emacs_mule)
6544 (encode_coding_emacs_mule, detect_coding_iso_2022)
6545 (decode_coding_iso_2022, encode_invocation_designation)
6546 (encode_designation_at_bol, encode_coding_iso_2022)
6547 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6548 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6549 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6550 (encode_coding_raw_text, detect_coding_charset)
6551 (decode_coding_charset, encode_coding_charset, detect_eol)
6552 (detect_coding, get_translation_table, produce_chars)
6553 (consume_chars, reused_workbuf_in_use)
6554 (make_conversion_work_buffer, code_conversion_save)
6555 (decode_coding_object, encode_coding_object)
6556 (detect_coding_system, char_encodable_p)
6557 (Funencodable_char_position, code_convert_region)
6558 (code_convert_string, code_convert_string_norecord)
6559 (Fset_coding_system_priority):
6560 * fileio.c (Finsert_file_contents):
6561 Use bool for booleans.
6562 * coding.h, lisp.h: Reflect above API changes.
6563 * coding.c: Remove unnecessary static function decls.
6564 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6565 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6566 not a boolean 'int', since callers never look at the return value.
6567 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6568 * coding.h (decoding_buffer_size, encoding_buffer_size)
6569 (emacs_mule_string_char): Remove unused extern decls.
6570 (struct iso_2022_spec, struct coding_system):
6571 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6572 (struct emacs_mule_spec): Remove unused field 'full_support'.
6573 All initializations removed.
6574 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6575
5474c384
DA
65762012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6577
f10fe38f 6578 Fix spare memory change (Bug#12286).
5474c384
DA
6579 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6580 (valid_lisp_object_p): Likewise.
6581
c4b6914d
MR
65822012-08-27 Martin Rudalics <rudalics@gmx.at>
6583
6584 * window.c (Fset_window_configuration): Record any window's old
6585 buffer if it's replaced (see Bug#8789). If the new current
6586 buffer doesn't appear in the selected window, go to its old
6587 point (Bug#12208).
6588
35aaa1ea
DA
65892012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6590
6591 Special MEM_TYPE_SPARE to denote reserved memory.
6592 * alloc.c (enum mem_type): New memory type.
6593 (refill_memory_reserve): Use new type for spare memory.
6594 This prevents live_cons_p and live_string_p from incorrect
6595 detection of uninitialized objects from spare memory as live.
6596
6af64513
PE
65972012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6598
8b2e00a3
PE
6599 Spelling fixes.
6600 * Makefile.in (.PHONY): versioclean -> versionclean.
6601
b52d6985
PE
6602 Remove unused external symbols.
6603 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6604 * window.c (Qwindow_valid_p, decode_valid_window):
6605 Now static, not extern.
6606 * data.c (Qinterval): Remove; unused.
6607 (syms_of_data): Do not define 'interval'.
6608 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6609 * window.h (decode_valid_window):
6610 Remove decls.
6611
d5172d4f
PE
6612 * character.c, charset.c, chartab.c: Use bool for booleans.
6613 * character.c (lisp_string_width, string_count_byte8)
6614 (string_escape_byte8):
6615 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6616 (load_charset_map_from_file, map_charset_chars)
6617 (Fdefine_charset_internal, define_charset_internal)
6618 (Fdeclare_equiv_charset, find_charsets_in_text)
6619 (Ffind_charset_region, char_charset, Fiso_charset):
6620 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6621 (sub_char_table_set, sub_char_table_set_range)
6622 (char_table_set_range, optimize_sub_char_table)
6623 (map_sub_char_table):
6624 Use bool for boolean.
6625 * character.c (str_to_unibyte): Omit last boolean argument; it was
6626 always 0. All callers changed.
6627 * character.h, charset.h: Adjust to match previous changes.
6628 * character.h (char_printable_p): Remove decl of nonexistent function.
6629 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6630 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6631 are all boolean, so make them single-bit bitfields.
6632
6af64513
PE
6633 * lisp.h (ASET): Remove attempt to detect side effects.
6634 It was meant to be temporary and it often doesn't work,
6635 because when IDX has side effects the behavior of IDX==IDX
6636 is undefined. See Stefan Monnier in
6637 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6638
e1f29348
BR
66392012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6640
6641 * lisp.h (functionp): New function (extracted from Ffunctionp).
6642 (FUNCTIONP): Use it.
6643 * eval.c (Ffunctionp): Use it.
6644
17c05d74
PE
66452012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6646
0f46bc75
PE
6647 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6648 as that's faster and simpler than static storage. Don't bother
6649 with the g_main_context_query overhead if g_main_context_pending
6650 says no events are pending.
6651 (gfds, gfds_size): Remove these static vars.
6652 (xgselect_initialize): Remove; no longer needed.
6653 All uses and decls removed.
6654
ee4c0f69
PE
6655 * emacs.c (fatal_error_signal_hook): Remove.
6656 All uses removed. This leftover from old code was always 0.
6657
17c05d74
PE
6658 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6659 * casefiddle.c (casify_object, casify_region):
6660 * casetab.c (set_case_table):
6661 * category.c, category.h (word_boundary_p):
6662 * category.h (CHAR_HAS_CATEGORY):
6663 Use bool for booleans, instead of int.
6664
391ceac5
EZ
66652012-08-25 Eli Zaretskii <eliz@gnu.org>
6666
6667 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6668
2f221583
PE
66692012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6670
f4a681b0
PE
6671 On assertion failure, print backtrace if available.
6672 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6673 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6674 * Makefile.in (LIB_EXECINFO): New macro.
6675 (LIBES): Use it.
6676
2f221583
PE
6677 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6678 * bytecode.c (exec_byte_code):
6679 * callint.c (check_mark, Fcall_interactively):
6680 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6681 (getenv_internal, sync_process_alive, call_process_exited):
6682 * lisp.h (USE_SAFE_ALLOCA):
6683 Use bool for booleans, instead of int.
6684 * lisp.h, process.h: Adjust prototypes to match above changes.
6685 * callint.c (Fcall_interactively): Don't assume the mark's
6686 offset fits in 'int'.
6687
37ef52bb
PE
66882012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6689
6690 * buffer.c, buffer.h: Use bool for boolean.
6691 * buffer.c (reset_buffer_local_variables)
6692 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6693 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6694 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6695 (overlay_touches_p, overlay_strings, Foverlay_put)
6696 (report_overlay_modification, call_overlay_mod_hooks):
6697 (mmap_enlarge, mmap_set_vars):
6698 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6699 Use bool for booleans, instead of int.
6700 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6701 since the 1-or-0 return value is always ignored anyway.
6702 (mmap_initialized_p):
6703 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6704 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6705
2cc21167
PE
67062012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6707
6708 * bidi.c: Use bool for boolean.
6709 This is a bit more readable, and makes the text segment of bidi.o
6710 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6711 Presumably it's faster too.
6712 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6713 Now bool.
6714 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6715 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6716 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6717 (bidi_explicit_dir_char, bidi_level_of_next_char)
6718 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6719 Use bool for booleans, instead of int.
6720 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6721 (bidi_unshelve_cache): Adjust decls to match code.
6722
7db4ddf4
MR
67232012-08-23 Martin Rudalics <rudalics@gmx.at>
6724
6725 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6726 argument.
6727
b1bb8011
PE
67282012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6729
6730 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6731 * atimer.h: Include <stdbool.h>.
6732
ff687885
DN
67332012-08-22 Dan Nicolaescu <dann@gnu.org>
6734
6735 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6736 compile time tests instead of run time tests on systems that do
6737 not use them.
6738 (FRAME_MAC_P): Remove leftover from deleted code.
6739 * frame.c (syms_of_frame): Remove leftover from deleted code.
6740
4ce7a138
JD
67412012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6742
6743 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6744
d733ec6d
PE
67452012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6746
6747 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6748 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 6749 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
6750 (fontset_add): Return void, for FONTSET_ADD.
6751
d0d2d26f
PE
67522012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6753
fce31d69
PE
6754 * alloc.c: Use bool for booleans.
6755 (gc_in_progress, abort_on_gc)
6756 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6757 (dont_register_blocks) [GC_MALLOC_CHECK]:
6758 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
6759 (check_string_bytes, make_specified_string, memory_full)
6760 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
6761 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
6762 (mark_stack, valid_pointer_p, make_pure_string)
6763 (Fgarbage_collect, survives_gc_p, gc_sweep):
6764 Use bool for booleans, instead of int.
6765 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6766 Remove unused local.
6767 * alloc.c (PURE_POINTER_P):
6768 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
6769 * editfns.c (Fformat):
6770 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
6771 (Fdo_auto_save):
6772 * fns.c (sweep_weak_table):
6773 * lisp.h (suppress_checking, push_message, survives_gc_p)
6774 (make_pure_string, gc_in_progress, abort_on_gc):
6775 * lread.c (readchar, read1):
6776 * print.c (Fprin1_to_string):
6777 * xdisp.c (push_message):
6778 Use bool for booleans affected directly or indirectly by
6779 alloc.c's changes.
6780
d0d2d26f
PE
6781 Make recently-introduced setters macros.
6782 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
6783 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
6784 (set_fontset_default, set_fontset_fallback): Rename from their
6785 upper-case counterparts, and make them functions rather than macros.
6786 This is more consistent with the other recently-introduced setters.
6787 These don't need to be inline, since they're local.
6788
d18e2bb6
JD
67892012-08-21 Jan Djärv <jan.h.d@swipnet.se>
6790
6791 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
6792 the loop (Bug#12247).
6793
1b9d9d16
PE
67942012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6795
6796 * lisp.h (vcopy): Use memcpy rather than our own loop.
6797 This fixes a performance regression introduced by the recent
6798 addition of vcopy. This means 'vcopy' will need to be modified
6799 for a copying collector, but that's OK. Also, tighten the
6800 checking in the assertion.
6801
b2f09701
EZ
68022012-08-21 Eli Zaretskii <eliz@gnu.org>
6803
6804 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
6805 components for RTL text (Bug#11860). Adjust X-OFFSET of each
6806 non-base glyph for the width of the base character, according to
e1f29348
BR
6807 what x_draw_composite_glyph_string_foreground expects.
6808 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
6809 expectations, to produce correct width of the composed character.
6810 Reverse the sign of the DU offset produced by ScriptPlace.
6811
9b994fed
PE
68122012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6813
6814 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
6815
086ca913
DA
68162012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6817
6818 Avoid direct writes to contents member of struct Lisp_Vector.
6819 * lisp.h (vcopy): New function to copy data into vector.
6820 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
6821 * fns.c (Ffillarray): Use ASET.
6822 * keyboard.c (timer_check_2): Use AREF and ASET.
6823 (append_tool_bar_item, Frecent_keys): Use vcopy.
6824 * lread.c (read_vector): Use ASET.
6825 * msdos.c (Frecent_doskeys): Use vcopy.
6826 * xface.c (Finternal_copy_lisp_face): Use vcopy.
6827 (Finternal_merge_in_global_face): Use ASET and vcopy.
6828 * xfont.c (xfont_list_pattern): Likewise.
6829
5481664a
MR
68302012-08-21 Martin Rudalics <rudalics@gmx.at>
6831
6832 * window.c (Fwindow_point): For the selected window always return
6833 the position of its buffer's point.
6834 (Fset_window_point): For the selected window always go in its
6835 buffer to the specified position.
6836
6d470bdd
DA
68372012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6838
6839 Setter macros for fontsets.
6840 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6841 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6842 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6843 Adjust users.
6844
24564fe1
GM
68452012-08-20 Glenn Morris <rgm@gnu.org>
6846
6847 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6848 Don't assume that `ln -f' works.
6849
0a05a035
EZ
68502012-08-20 Eli Zaretskii <eliz@gnu.org>
6851
6852 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6853 and later about non-assignments with no effect. See discussion at
6854 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6855 details.
6856
e46f2325
DA
68572012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6858
6859 Inline setter functions for Lisp_Objects slots of struct specbinding.
6860 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6861 Adjust users.
6862
734fbd86
MR
68632012-08-20 Martin Rudalics <rudalics@gmx.at>
6864
6865 * window.c (select_window): Always make selected window's buffer
6866 current.
6867
f1a95992
DA
68682012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6869
6870 Use AREF and ASET for docstrings of category tables.
6871 * category.h (CATEGORY_DOCSTRING): Use AREF.
6872 (SET_CATEGORY_DOCSTRING): Use ASET.
6873 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6874
e83064be
DA
68752012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6876
6877 Inline setter functions for hash table members.
6878 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6879 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6880 (set_hash_key_and_value, set_hash_index, set_hash_next)
6881 (set_hash_hash): New functions.
6882 * charset.c, fns.c: Adjust users.
6883
4ce60d2e
DA
68842012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6885
6886 Inline getter and setter functions for per-buffer values.
6887 * buffer.h (per_buffer_default, set_per_buffer_default)
6888 (per_buffer_value, set_per_buffer_value): New functions.
6889 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6890 * buffer.c, data.c: Adjust users.
6891
c06c9690
JB
68922012-08-20 Juanma Barranquero <lekktu@gmail.com>
6893
6894 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6895
32bd4250
PE
68962012-08-19 Paul Eggert <eggert@cs.ucla.edu>
6897
bad03192 6898 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
6899 as gnulib does this if the system doesn't.
6900 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
6901 Remove declaration. MS-Windows declares it on stdlib.h which is
6902 included by conf_post.h.
b69a6d22
PE
6903 * emacs.c (environ) [DOUG_LEA_MALLOC]:
6904 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
6905 * vm-limit.c: Include <unistd.h>, for 'environ'.
6906
22d7feb2
PE
6907 * unexaix.c, unexcoff.c: Include "mem-limits.h".
6908 (start_of_data): Remove decl; mem-limits.h provides it.
6909
32bd4250
PE
6910 * xdisp.c (handle_invisible_prop): Make it a bit faster
6911 and avoid a gcc -Wmaybe-uninitialized diagnostic.
6912
450809af
CY
69132012-08-19 Chong Yidong <cyd@gnu.org>
6914
6915 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
6916 ends (Bug#3874).
6917
9e677988
AS
69182012-08-19 Andreas Schwab <schwab@linux-m68k.org>
6919
6b1319ce
AS
6920 * .gdbinit: Use call instead of set when calling a function in the
6921 inferior.
6922
9e677988
AS
6923 * data.c (set_internal): Don't use set_blv_found.
6924 (Fkill_local_variable): Likewise.
6925
d7191076
AA
69262012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
6927
6928 * nsfont.m (ns_ascii_average_width): Ensure the string
6929 ascii_printable is initialized with a null-terminated character
6930 array. Otherwise, it can contain undesired extra characters.
6931
e757f1c6
PE
69322012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6933
6934 port new setting code to Sun C 5.8 2005/10/13
6935 * chartab.c, lisp.h (char_table_set, char_table_set_range):
6936 Return void, not Lisp_Object. Otherwise, the compiler
6937 complains about (A?B:C) where B is void and C is Lisp_Object
6938 when compiling CHAR_TABLE_SET, due to the recent change to
6939 the API of sub_char_table_set_contents.
6940
a999ce26
CY
69412012-08-18 Chong Yidong <cyd@gnu.org>
6942
6943 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
6944 for the string case (Bug#3874).
6945
3f22b86f
PE
69462012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6947
39eb03f1
PE
6948 * buffer.h (BSET): Remove (Bug#12215).
6949 Replace all uses with calls to new setter functions.
6950 (bset_bidi_paragraph_direction, bset_case_canon_table)
6951 (bset_case_eqv_table, bset_directory, bset_display_count)
6952 (bset_display_time, bset_downcase_table)
6953 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
6954 (bset_last_selected_window, bset_local_var_alist)
6955 (bset_mark_active, bset_point_before_scroll, bset_read_only)
6956 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
6957 (bset_width_table):
6958 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6959 (bset_auto_fill_function, bset_auto_save_file_format)
6960 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6961 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6962 (bset_cache_long_line_scans, bset_case_fold_search)
6963 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6964 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6965 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6966 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6967 (bset_header_line_format, bset_indicate_buffer_boundaries)
6968 (bset_indicate_empty_lines, bset_invisibility_spec)
6969 (bset_left_fringe_width, bset_major_mode, bset_mark)
6970 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6971 (bset_name, bset_overwrite_mode, bset_pt_marker)
6972 (bset_right_fringe_width, bset_save_length)
6973 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6974 (bset_scroll_up_aggressively, bset_selective_display)
6975 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6976 (bset_word_wrap, bset_zv_marker):
6977 * category.c (bset_category_table):
6978 * syntax.c (bset_syntax_table):
6979 New setter functions.
6980
6a09a33b
PE
6981 * process.h (PSET): Remove (Bug#12215).
6982 Replace all uses with calls to new setter functions.
6983 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6984 (PROCESS_INLINE): New macro.
6985 (pset_childp): New setter function.
6986 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
6987 * process.c (PROCESS_INLINE):
6988 Define to EXTERN_INLINE, so that the corresponding functions
6989 are compiled into code.
6990 (pset_buffer, pset_command, pset_decode_coding_system)
6991 (pset_decoding_buf, pset_encode_coding_system)
6992 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
6993 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
6994 (pset_type, pset_write_queue): New setter functions.
6995
e8c17b81
PE
6996 * window.h (WSET): Remove (Bug#12215).
6997 Replace all uses with calls to new setter functions.
6998 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6999 (WINDOW_INLINE): New macro.
7000 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7001 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7002 (wset_total_lines, wset_vertical_scroll_bar)
7003 (wset_window_end_pos, wset_window_end_valid)
7004 (wset_window_end_vpos): New setter functions.
7005 * window.c (WINDOW_INLINE):
7006 Define to EXTERN_INLINE, so that the corresponding functions
7007 are compiled into code.
7008 (wset_combination_limit, wset_dedicated, wset_display_table)
7009 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7010 (wset_new_normal, wset_new_total, wset_next_buffers)
7011 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7012 (wset_prev_buffers, wset_right_fringe_width)
7013 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7014 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7015 (wset_window_parameters):
7016 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7017 (wset_column_number_displayed, wset_region_showing):
7018 New setter functions.
7019
3f22b86f
PE
7020 * termhooks.h (TSET): Remove (Bug#12215).
7021 Replace all uses with calls to new setter functions.
7022 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7023 (TERMHOOKS_INLINE): New macro.
7024 (tset_charset_list, tset_selection_alist): New setter functions.
7025 * terminal.c (TERMHOOKS_INLINE):
7026 Define to EXTERN_INLINE, so that the corresponding functions
7027 are compiled into code.
7028 (tset_param_alist): New setter function.
7029
742af32f
PE
70302012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7031
15dbb4d6
PE
7032 * keyboard.h (KSET): Remove (Bug#12215).
7033 Replace all uses with calls to new setter functions.
7034 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7035 (KEYBOARD_INLINE): New macro.
7036 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7037 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7038 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7039 New setter functions.
7040 * keyboard.c (KEYBOARD_INLINE):
7041 Define to EXTERN_INLINE, so that the corresponding functions
7042 are compiled into code.
7043 (kset_echo_string, kset_kbd_queue)
7044 (kset_keyboard_translate_table, kset_last_prefix_arg)
7045 (kset_last_repeatable_command, kset_local_function_key_map)
7046 (kset_overriding_terminal_local_map, kset_real_last_command)
7047 (kset_system_key_syms): New setter functions.
7048
f00af5b1
PE
7049 * frame.h (FSET): Remove (Bug#12215).
7050 Replace all uses with calls to new setter functions.
7051 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7052 (FRAME_INLINE): New macro.
7053 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7054 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7055 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7056 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7057 (fset_param_alist, fset_root_window, fset_scroll_bars)
7058 (fset_selected_window, fset_title, fset_tool_bar_items)
7059 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7060 * frame.c (FRAME_INLINE):
7061 Define to EXTERN_INLINE, so that the corresponding functions
7062 are compiled into code.
7063 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7064
0c94c8d6
PE
7065 A few more naming-convention fixes for getters and setters.
7066 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7067 and rename from buffer_overlays_set_before.
7068 (set_buffer_overlays_after): Move here from buffer.h, and rename
7069 from buffer_overlays_set_after.
7070 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7071 All uses changed.
7072 (set_buffer_intervals): Rename from buffer_set_intervals.
7073 * intervals.c (set_interval_object): Move here from intervals.h,
7074 and rename from interval_set_object.
7075 (set_interval_left): Move here from intervals.h, and rename from
7076 interval_set_left.
7077 (set_interval_right): Move here from intervals.h, and rename from
7078 interval_set_right.
7079 (copy_interval_parent): Move here from intervals.h, and rename from
7080 interval_copy_parent.
7081 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7082 (set_interval_plist): Rename from interval_set_plist.
7083 Return void, not Lisp_Object, since no caller uses the result.
7084 * lisp.h (string_intervals): Rename from string_get_intervals.
7085 (set_string_intervals): Rename from string_set_intervals.
7086
34dabdb7
PE
7087 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7088 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 7089 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
7090 All uses changed. See the end of
7091 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7092
742af32f
PE
7093 * lisp.h (CSET): Remove (Bug#12215).
7094 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7095 (set_char_table_purpose): New functions,
7096 replacing CSET. All uses changed. For example, replace
7097 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 7098 "set_char_table_parent (char_table, parent);".
742af32f
PE
7099 The old version was confusing because it used the same name
7100 'parent' for two different things.
7101
a04e2c62
DA
71022012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7103
7104 Functions to get and set Lisp_Object fields of buffer-local variables.
7105 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7106 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7107 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7108 * data.c, eval.c, frame.c: Adjust users.
7109
383dcbf9
CY
71102012-08-17 Chong Yidong <cyd@gnu.org>
7111
7112 * xfaces.c (merge_face_vectors): If the target font specfies a
7113 font spec, make the font's attributes take precedence over
7114 directly-specified attributes.
7115 (merge_face_ref): Recognize :font.
7116
44386687
DA
71172012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7118
7119 Do not use memcpy for copying intervals.
7120 * intervals.c (reproduce_interval): New function.
7121 (reproduce_tree, reproduce_tree_obj): Use it.
7122 (reproduce_tree_obj): Remove prototype.
7123
927c7216
PE
71242012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7125
7126 * lisp.h (duration_to_sec_usec): Remove unused decl.
7127
93044f7b
AA
71282012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7129
7130 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7131 to an allocated instance of NSString, not to the class itself.
7132
9851e4a5
JB
71332012-08-17 Juanma Barranquero <lekktu@gmail.com>
7134
7135 * makefile.w32-in (C_CTYPE_H): New macro.
7136 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7137 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7138 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7139
620f13b0
PE
71402012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7141
7142 Use ASCII tests for character types.
7143 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7144 * xfns.c, xterm.c:
7145 Don't include <ctype.h>; was not needed.
7146 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7147 * sysdep.c, xfaces.c:
7148 Include <c-ctype.h> instead of <ctype.h>.
7149 * nsterm.m: Include <c-ctype.h>.
7150 * charset.c (read_hex):
7151 * doc.c (Fsnarf_documentation):
7152 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7153 (DRIVE_LETTER) [DOS_NT]:
7154 (Ffile_name_directory, Fexpand_file_name)
7155 (Fsubstitute_in_file_name):
7156 * font.c (font_parse_xlfd, font_parse_fcname):
7157 * frame.c (x_set_font_backend):
7158 * gtkutil.c (xg_get_font):
7159 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7160 * nsimage.m (hexchar):
7161 * nsterm.m (ns_xlfd_to_fontname):
7162 * sysdep.c (system_process_attributes):
7163 * xfaces.c (hash_string_case_insensitive):
7164 Use C-locale tests instead of locale-specific tests for character
7165 types, since we want the ASCII interpretation here, not the
7166 interpretation suitable for whatever happens to be the current locale.
7167
52162052
MR
71682012-08-16 Martin Rudalics <rudalics@gmx.at>
7169
7170 Consistently check windows for validity/liveness
7171 (Bug#11984, Bug#12025, Bug#12026).
7172 * lisp.h (CHECK_VALID_WINDOW): New macro.
7173 * window.c (decode_window): Rename to decode_live_window.
7174 (decode_valid_window, Fwindow_valid_p): New functions.
7175 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7176 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7177 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7178 (Fwindow_prev_sibling, Fwindow_combination_limit)
7179 (Fset_window_combination_limit, Fwindow_use_time)
7180 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7181 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7182 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7183 (Fwindow_hscroll, Fset_window_hscroll)
7184 (Fwindow_redisplay_end_trigger)
7185 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7186 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7187 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7188 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7189 (Fwindow_end, Fset_window_point, Fset_window_start)
7190 (Fpos_visible_in_window_p, Fwindow_line_height)
7191 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7192 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7193 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7194 (Fset_window_parameter, Fwindow_display_table)
7195 (Fset_window_display_table, Fdelete_other_windows_internal)
7196 (Fset_window_buffer, Fset_window_new_total)
7197 (Fset_window_new_normal, Fdelete_window_internal)
7198 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7199 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7200 (Fwindow_scroll_bars): Check whether argument window is a valid or
7201 live window. Update doc-strings.
7202 (syms_of_window): New symbol Qwindow_valid_p.
7203 * keyboard.c (Fposn_at_x_y): Check whether argument
7204 frame_or_window denotes a valid window.
7205
2751c80f
DA
72062012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7207
7208 Fix previous char table change.
7209 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7210 * chartab.c (optimize_sub_char_table): Likewise.
7211
032a42c8
CY
72122012-08-16 Chong Yidong <cyd@gnu.org>
7213
a2d19368
CY
7214 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7215
032a42c8
CY
7216 * xfont.c (xfont_open):
7217 * xftfont.c (xftfont_open): Set the font's max_width field.
7218
7219 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7220 min_width to space_width and average_width to the average over
7221 printable ASCII characters.
7222 (ns_char_width): Code cleanup.
7223 (ns_ascii_average_width): New utility function.
7224
7225 * font.h (struct font): Update comments.
7226
a098c930
DA
72272012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7228
032a42c8 7229 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
7230 * lisp.h (CSET): New macro.
7231 (char_table_set_extras, char_table_set_contents)
7232 (sub_char_table_set_contents): New function.
7233 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7234 * syntax.c: Adjust users.
7235
8be3a09c
SM
72362012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7237
7238 * eval.c (eval_sub): Bind lexical-binding.
7239 * lread.c (Qlexical_binding): Make non-static.
7240
ac4845a6
JD
72412012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7242
ddee6515
JD
7243 * nsmenu.m (popupSession): Remove.
7244 (pop_down_menu): Remove endModalSession.
7245 (timeout_handler:): New method.
7246 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7247 Call runModalForWindow. Check timer_fired when it returns.
7248 If not set, cancel timer and break out of loop.
7249 Otherwise loop again, with a new timeout.
7250
7251 * nsterm.m: Include fcntl.h if present.
7252 (fd_entry, t_readfds, inNsSelect): Remove.
7253 (select_writefds, select_valid, select_timeout, selfds)
7254 (select_mutex, apploopnr): Add.
7255 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7256 Otherwise call kbd_buffer_store_event.
7257 (ns_send_appdefined): Remove release of fd_entry.
7258 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7259 Increment and decrement apploopnr.
7260 (ns_select): If no file descriptors, just do a NSTimer.
7261 Otherwise copy read/write masks and start select thread (fd_handler).
7262 Start main loop and wait for application defined event.
7263 Inform select thread to stop selecting after main loop is exited.
7264 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 7265 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
7266 (fd_handler:): Loop forever, wait for info from the main thread
7267 to either start or stop selecting. When select returns, send
7268 and appdefined event.
7269 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7270 If not call kbd_buffer_store_event.
7271
7272 * nsterm.h (EmacsApp): fd_handler takes id argument.
7273 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7274
ac4845a6
JD
7275 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7276
eb424fe3
EZ
72772012-08-15 Eli Zaretskii <eliz@gnu.org>
7278
7279 * region-cache.c (move_cache_gap): Update gap_len using the actual
7280 growth of the boundaries array. Do not change cache_len.
7281 (Bug#12196)
7282
4e6a86c6
DA
72832012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7284
7285 Generalize and cleanup font subsystem checks.
7286 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
7287 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7288 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 7289
5bf192ca
DA
72902012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7291
7292 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7293
f2045622
CY
72942012-08-15 Chong Yidong <cyd@gnu.org>
7295
8be3a09c
SM
7296 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7297 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7298 extract the font descriptor instead of just the font name.
7299 In that case, return a font spec instead of a string.
f2045622
CY
7300 (x_last_font_name): Move to this file from xfns.c.
7301
7302 * xfns.c (Fx_select_font): The return value can also be a font
7303 spec. Move x_last_font_name management to gtkutil.c.
7304
7305 * xfaces.c: Make font weight and style symbols non-static.
7306
7f6feb56
SM
73072012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7308
7309 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7310 (bug#12117).
7311
fecbd8ff
SM
73122012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7313
7314 * alloc.c (Fgarbage_collect): Use plural form consistently.
7315
9b8d5165
EZ
73162012-08-14 Eli Zaretskii <eliz@gnu.org>
7317
7318 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7319 iteration through the command loop. Fixes a problem whereby mouse
7320 movements are ignored until the first mouse click.
7321
f5d9e83a
PE
73222012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7323
7324 Use bool, not int, for Lisp booleans.
7325 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7326 makes Emacs a bit smaller and presumably a bit faster.
7327 * lisp.h: Include <stdbool.h>.
7328 (struct Lisp_Boolfwd, defvar_bool):
7329 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7330 * regex.c [!emacs]: Include <stdbool.h>.
7331 (false, true): Remove; <stdbool.h> does this for us now.
7332
55802e4a
CY
73332012-08-14 Chong Yidong <cyd@gnu.org>
7334
4abcdac8
CY
7335 * character.c (Fcharacterp): Doc fix (Bug#12076).
7336
7337 * data.c (Findirect_variable): Doc fix (Bug#11040).
7338
55802e4a
CY
7339 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7340
7341 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 7342 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 7343
8e99d072
BR
73442012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7345
7346 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7347 (bug#12022).
7348
08908aca
MR
73492012-08-14 Martin Rudalics <rudalics@gmx.at>
7350
7351 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7352 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7353 * minibuf.c (choose_minibuf_frame, read_minibuf):
7354 * w32fns.c (x_create_tip_frame):
7355 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7356 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7357
56120d6f
PE
73582012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7359
7360 * intervals.c (offset_intervals): Remove obsolete comment.
7361
67b77c0b
AS
73622012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7363
7364 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7365
f48b82fd
GR
73662012-08-14 Gergely Risko <gergely@risko.hu>
7367
7368 * coding.c (decode_coding): Record buffer modification before
7369 disabling undo_list (Bug#11773).
7370
fd318b54
DA
73712012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7372
7373 Revert and cleanup some recent overlay changes.
7374 * buffer.h (enum overlay_type): Remove.
7375 (buffer_get_overlays, buffer_set_overlays): Likewise.
7376 (buffer_set_overlays_before, buffer_set_overlays_after):
7377 New function. Adjust users.
7378 (unchain_both): Add eassert.
7379
41a62dd9
DA
73802012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7381
7382 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7383
5884c324
PE
73842012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7385
7386 * gtkutil.c (xg_mark_data): Don't assume C99.
7387
ca06f160
JD
73882012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7389
7390 * gtkutil.c (xg_frame_tb_info): New struct.
7391 (TB_INFO_KEY): New define.
7392 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7393 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7394 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7395 if not present.
7396 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 7397 is up to date. Otherwise store new data.
ca06f160
JD
7398 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7399
7864a3f7
DA
74002012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7401
7402 Use KSET for write access to Lisp_Object members of struct kboard.
7403 * keyboard.h (KSET): New macro.
7404 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7405 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7406 * xterm.c: Adjust users.
7407
4c31be61
DA
74082012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7409
7410 Use BSET for write access to Lisp_Object members of struct buffer.
7411 * buffer.h (BSET): New macro.
7412 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7413 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7414 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7415 * window.c, xdisp.c, xfns.c: Adjust users.
7416
14ae4239
BT
74172012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7418
7419 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7420
32bcadb4
JD
74212012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7422
3d29b2ce 7423 * nsterm.m (not_in_argv): New function.
fc0c31f8 7424 (application:openFile, application:openTempFile:):
3d29b2ce
JD
7425 (application:openFileWithoutUI:, application:openFiles:): Open file
7426 if not_in_argv returns non-zero (bug#12171).
7427
32bcadb4 7428 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
7429 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7430 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
7431 (xg_get_font_name): Use those functions/macros here.
7432 Reported by Frans Oilinki <moilinki@gmail.com>.
7433
9ff9402d 74342012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
7435
7436 * unexmacosx.c (copy_data_segment): Copy initialized data in
7437 statically linked libraries from input file rather than memory.
7438
db74a5fc
YM
7439 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7440 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7441 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7442
25e65510
GM
74432012-08-10 Glenn Morris <rgm@gnu.org>
7444
7445 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7446 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7447
7961135c
DA
74482012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7449
7450 Fix last change to allow compilation with low optimization levels.
7451 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7452 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7453
42b3a444
DA
74542012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7455
7456 Use common inline syntax in intervals.h.
7457 * intervals.h (INTERVALS_INLINE): New macro.
7458 Change all users from LISP_INLINE.
7459
9fb0c957
DA
74602012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7461
7462 Define Qnone once for all platforms.
7463 * frame.c (Qnone): Define here.
7464 (syms_of_frame): DEFSYM it.
7465 * lisp.h (Qnone): New declaration.
7466 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7467 * xfns.c: Remove duplication. Adjust users.
7468
65e8ee52
DA
74692012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7470
7471 Remove unused macros from intervals.h.
7472 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7473 * intervals.c: Adjust comment.
7474
9b855fd6
EZ
74752012-08-10 Eli Zaretskii <eliz@gnu.org>
7476
7477 * w32fns.c <w32_unicode_gui>: New static variable.
7478 (globals_of_w32fns): Initialize it according to os_subtype.
7479 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7480 testing os_subtype.
7481
39cb9e56 74822012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
7483 Eli Zaretskii <eliz@gnu.org>
7484
7485 Fix bug #10299 with Unicode characters sent by customized
7486 keyboards created by MSKLC.
7487 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7488 (w32_init_class): Use it to initialize the Emacs class with either
7489 ANSI or Unicode API calls.
7490 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7491 later.
7492 (w32_wnd_proc): If the character code sent by WM_CHAR or
7493 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7494 original message. Call DefWindowProcW on NT and later.
7495
9374581a
GM
74962012-08-10 Glenn Morris <rgm@gnu.org>
7497
4b94e8cf
GM
7498 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7499
9374581a
GM
7500 * lisp.h (DIRECTORY_SEP): Let configure set it.
7501
a2752828
DA
75022012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7503
7504 Use TSET for write access to Lisp_Object slots of struct terminal.
7505 * termhooks.h (TSET): New macro.
7506 * coding.c, terminal.c, xselect.c: Adjust users.
7507
cc92c454
SM
75082012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7509
7510 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7511 the failing expression, include them in the error message.
7512 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7513 * lisp.h (internal_condition_case_n): Update declaration.
7514
4cb3e6b3
DA
75152012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7516
7517 Inline functions to examine and change buffer overlays.
7518 * buffer.c (unchain_both): New function.
7519 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7520 (buffer_has_overlays): New function.
7521 (enum overlay_type): New enum.
7522 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7523 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7524
8707c1e5
DA
75252012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7526
7527 Inline functions to examine and change buffer intervals.
7528 * alloc.c (mark_interval_tree): Remove.
7529 (MARK_INTERVAL_TREE): Simplify.
7530 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7531 * intervals.c (buffer_balance_intervals): New function.
7532 (graft_intervals_into_buffer): Adjust indentation.
7533 (set_intervals_multibyte): Simplify.
7534 * buffer.h (BUF_INTERVALS): Remove.
7535 (buffer_get_intervals, buffer_set_intervals): New function.
7536 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7537 * intervals.c, textprop.c: Adjust users.
7538
ad8c997f
DA
75392012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7540
7541 Inline functions to examine and change string intervals.
7542 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7543 (string_get_intervals, string_set_intervals): New function.
7544 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7545 * lread.c, print.c, textprop.c: Adjust users.
7546
32ac3a6b
GM
75472012-08-08 Glenn Morris <rgm@gnu.org>
7548
7549 * lisp.mk (lisp): Remove language/persian.elc.
7550
77c7bcb1
DA
75512012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7552
7553 Cleanup intervals.
7554 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7555 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
7556 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7557 Adjust comment. Move under #if 0.
77c7bcb1
DA
7558 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7559 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7560
9c08a8d4
DA
75612012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7562
7563 Check total length of intervals with eassert.
7564 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7565 * intervals.c: Change all users to eassert.
7566
26d16b35
EZ
75672012-08-07 Eli Zaretskii <eliz@gnu.org>
7568
14ae4239
BT
7569 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7570 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
7571 INTERNAL_FIELD in Lisp_Cons.
7572
c644523b
DA
75732012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7574
7575 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7576 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7577 name since all xname users are fixed long time ago. Do not
7578 use INTERNAL_FIELD.
7579 (set_symbol_name, set_symbol_function, set_symbol_plist):
7580 (set_symbol_next, set_overlay_plist): New function.
7581 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7582 (struct Lisp_Overlay): Likewise.
7583 (CVAR, MVAR, SVAR): Remove.
7584 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7585 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7586 * xterm.c: Adjust users.
7587 * .gdbinit: Change to use name field of struct Lisp_Symbol
7588 where appropriate.
7589
6a3d20cc
DA
75902012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7591
7592 Basic functions to set Lisp_Object and pointer slots of intervals.
7593 * intervals.h (interval_set_parent, interval_set_object):
7594 (interval_set_left, interval_set_right, interval_set_plist):
7595 (interval_copy_parent): New function.
7596 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
7597 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7598 Adjust indentation.
6a3d20cc
DA
7599 (INTERVAL_SIZE): Remove. Adjust users.
7600 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7601
4d2b044c
DA
76022012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7603
7604 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7605 * process.h (PGET): Remove.
7606 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7607 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7608
d3d50620
DA
76092012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7610
7611 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7612 * window.h (WGET): Remove.
7613 (struct window): Do not use INTERNAL_FIELD.
7614 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7615 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7616 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7617 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7618 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7619 Adjust users.
7620
d10a51dc
CY
76212012-08-07 Chong Yidong <cyd@gnu.org>
7622
7623 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7624 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7625 (Fdelete_window_internal): Signal an error if the window is not on
7626 a live frame (Bug#12025).
7627
e69b0960
DA
76282012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7629
7630 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7631 * frame.h (FGET): Remove.
7632 (struct frame): Do not use INTERNAL_FIELD.
7633 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7634 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7635 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7636 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7637
25a20a3a
JB
76382012-08-06 Juanma Barranquero <lekktu@gmail.com>
7639
7640 * w32.c: Silence compiler warnings.
7641 (map_w32_filename): Remove unused variable `is_fat'.
7642 (chase_symlinks): Add parentheses around expression.
7643
1c6f11f4
GM
76442012-08-06 Glenn Morris <rgm@gnu.org>
7645
1db4583a
GM
7646 * sysdep.c: Respect BROKEN_GETWD.
7647
1c6f11f4
GM
7648 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7649 Let configure handle it.
7650 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7651
2b90362b
DA
76522012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7653
7654 Use GCALIGNMENT where appropriate.
7655 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7656 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7657 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7658
5f50daf2
EZ
76592012-08-06 Eli Zaretskii <eliz@gnu.org>
7660
14ae4239
BT
7661 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7662 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 7663
cbcc7007
SM
76642012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7665
7666 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7667 that should be sufficient for everyone.
7668
4d365fa4
JD
76692012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7670
7671 * keyboard.c (timer_check_2): Add break so timer_check returns next
7672 timeout.
7673
dd86bd82
DA
76742012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7675
7676 Fix Windows build errors introduced after converting to WGET and WSET.
7677 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7678 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7679
054e1668
JD
76802012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7681
7682 * nsterm.m (ns_frame_rehighlight): Use FSET.
7683
7684 * nsmenu.m (ns_update_menubar): Use FSET.
7685
21238f11
DA
76862012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7687
7688 Separate read and write access to Lisp_Object slots of Lisp_Process.
7689 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7690 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7691
077288cf
DA
76922012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7693
7694 Separate read and write access to Lisp_Object slots of struct window.
7695 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7696 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7697 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7698 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7699 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7700 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7701 Adjust users.
7702
71688bd7
DA
77032012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7704
7705 Fix Windows build errors introduced after converting to FGET and FSET.
7706 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7707 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7708 (w32_judge_scroll_bars): Change to use FSET.
7709 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7710
f99bac93
DA
77112012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7712
7713 Fix replacement typo.
7714 * window.c (replace_window): Set root_window instead of
7715 selected_window. This fixes a total window subsystem
7716 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7717
8c2a0f2d
GM
77182012-08-06 Glenn Morris <rgm@gnu.org>
7719
7720 * lisp.mk (lisp): Add language/persian.elc.
7721
edd74c35
DA
77222012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7723
7724 Separate read and write access to Lisp_Object slots of struct frame.
7725 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7726 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7727 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7728 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7729 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7730
8671676c
AS
77312012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7732
7733 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7734
663e2b3f
DA
77352012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7736
7737 Generalize common compile-time constants.
7738 * lisp.h (header_size, bool_header_size, word_size): Now here.
7739 (struct Lisp_Vector): Add comment.
7740 (struct Lisp_Bool_Vector): Move up to define handy constants.
7741 (VECSIZE, PSEUDOVECSIZE): Simplify.
7742 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7743 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7744 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7745 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7746 * xfont.c, xmenu.c: Use word_size where appropriate.
7747
d32e47af
LM
77482012-08-05 Lawrence Mitchell <wence@gmx.li>
7749
7750 * search.c (Freplace_match): Treat \? in the replacement text
7751 literally (Bug#8161).
7752
e5d9c0d1
CY
77532012-08-05 Chong Yidong <cyd@gnu.org>
7754
7755 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
7756 * frame.c (Vdelete_frame_functions):
7757 * emacs.c (Vkill_emacs_hook): Doc fix.
7758
8da0576b
EZ
77592012-08-04 Eli Zaretskii <eliz@gnu.org>
7760
7761 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
7762 --with-x-toolkit=no builds.
7763 Reported by Carsten Mattner <carstenmattner@gmail.com>.
7764
02676e5d
CY
77652012-08-04 Chong Yidong <cyd@gnu.org>
7766
7767 * syntax.c (Fmodify_syntax_entry): Doc fix.
7768
97147da9
EZ
77692012-08-04 Eli Zaretskii <eliz@gnu.org>
7770
76151e2c
EZ
7771 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
7772 * w32.c (init_environment): Change the default values of many
7773 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
7774 them into environment when they were not already defined.
7775 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 7776 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
7777 (check_windows_init_file): Now external, not static.
7778 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
7779 called when Vload_path is already set up.
7780
7781 * w32.h (check_windows_init_file): Add prototype.
7782
7783 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
7784 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
7785 compatibility with Posix platforms.
7786 (main): Move the call to check_windows_init_file to here from
7787 w32.c.
7788 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
7789 any, in the DEFALT argument into the root of the Emacs build or
7790 installation tree, as appropriate.
7791
7792 * callproc.c (init_callproc_1): Call decode_env_path instead of
7793 doing its equivalent by hand.
7794 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
7795 the code that sets Vexec_path run on MS-Windows.
7796
7797 * lread.c (init_lread): Add comments to #ifdef's.
7798
97147da9
EZ
7799 * msdos.c (dos_set_window_size, IT_update_begin)
7800 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
7801 instead of direct references.
7802
185ee146
PE
78032012-08-04 Paul Eggert <eggert@cs.ucla.edu>
7804
7805 Export DEFAULT_REHASH_* to GDB.
7806 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
7807 Now constants, not macros.
7808
8834c57a
PE
78092012-08-03 Paul Eggert <eggert@cs.ucla.edu>
7810
98c6f1e3
PE
7811 Remove unnecessary casts involving pointers.
7812 These casts are no longer needed now that we assume C89 or later,
7813 since they involve casting to or from void *.
7814 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
7815 (make_pure_float, make_pure_vector):
7816 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
7817 * macros.c (Fstart_kbd_macro):
7818 * menu.c (find_and_return_menu_selection):
7819 * minibuf.c (read_minibuf_noninteractive):
7820 * sysdep.c (closedir):
7821 * xdisp.c (x_produce_glyphs):
7822 * xfaces.c (compare_fonts_by_sort_order):
7823 * xfns.c (x_real_positions, select_visual):
7824 * xselect.c (x_stop_queuing_selection_requests)
7825 (x_get_window_property, x_get_window_property_as_lisp_data):
7826 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
7827 Remove unnecessary pointer casts.
7828 * alloc.c (record_xmalloc): New function.
7829 * lisp.h (record_xmalloc): New decl.
7830 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
7831 more like a function. This is because the pointer cast is not
7832 needed. All uses changed.
7833 * print.c (print_string, print_error_message): Avoid length recalc.
7834
8834c57a
PE
7835 Improve fix for macroexp crash with debugging (Bug#12118).
7836 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
7837 ARRAY_MARK_FLAG when checking subscripts, because ASET is
7838 not supposed to be invoked from the garbage collector.
7839 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7840 (gc_aset): New function, which is like ASET but can be
7841 used in the garbage collector.
7842 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7843 (set_hash_index): Use it instead of ASET.
7844
6dad7178
EZ
78452012-08-03 Eli Zaretskii <eliz@gnu.org>
7846
7847 Support symlinks on latest versions of MS-Windows.
7848 * w32.c: Include winioctl.h and aclapi.h.
7849 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7850 (revert_to_self): Forward declarations of static functions.
7851 <static BOOL g_b_init_get_security_info>:
7852 <g_b_init_create_symbolic_link>: New static flags.
7853 (globals_of_w32): Initialize them to zero.
7854 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7855 (map_w32_filename): Improve commentary. Simplify switch.
7856 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7857 headers (most versions of MinGW w32api don't).
7858 (get_security_info, create_symbolic_link)
7859 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7860 New functions.
7861 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7862 in the argument file name.
7863 (sys_access): Call unc_volume_file_attributes only if
7864 GetFileAttributes fails with network-related error codes.
7865 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7866 have the required privileges.
14ae4239 7867 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
7868 get_file_security_desc.
7869 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
7870 with addition of handling of symlinks and support for 'lstat'.
7871 If possible, get file's attributes and security information by
6dad7178
EZ
7872 handle, not by name. Produce S_IFLNK bit for symlinks, when
7873 called from 'lstat'.
7874 (stat, lstat): New functions, call 'stat_worker'.
7875 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7876 symlinks when the underlying filesystem supports them.
7877
f162bcc3
PE
78782012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7879
79ea6c20
PE
7880 Fix macroexp crash on Windows with debugging (Bug#12118).
7881 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7882 checking subscripts; problem introduced with the recent
7883 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7884 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7885 since it's used in non-static inline functions now.
7886
c0ce93fd
PE
7887 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7888 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 7889
f162bcc3
PE
7890 Use C99-style 'extern inline' if available.
7891 * buffer.h (BUFFER_INLINE):
7892 * category.h (CATEGORY_INLINE):
7893 * character.h (CHARACTER_INLINE):
7894 * charset.h (CHARSET_INLINE):
7895 * composite.h (COMPOSITE_INLINE):
7896 * dispextern.h (DISPEXTERN_INLINE):
7897 * lisp.h (LISP_INLINE):
7898 * systime.h (SYSTIME_INLINE):
7899 New macro, replacing 'static inline' in this header.
7900 * buffer.h, category.h, character.h, charset.h, composite.h:
7901 * dispextern.h, lisp.h, systime.h:
7902 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7903 * alloc.c (LISP_INLINE):
7904 * buffer.c (BUFFER_INLINE):
7905 * category.c (CATEGORY_INLINE):
7906 * character.c (CHARACTER_INLINE):
7907 * charset.c (CHARSET_INLINE):
7908 * composite.c (COMPOSITE_INLINE):
7909 * dispnew.c (DISPEXTERN_INLINE):
7910 * sysdep.c (SYSTIME_INLINE):
7911 Define to EXTERN_INLINE, so that the corresponding functions
7912 are compiled into code.
7913 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
7914 (INLINE_HEADER_END): New macros.
7915 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
7916 since it's used in non-static inline functions now.
a8333d03 7917 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 7918
837b365b
GM
79192012-08-02 Glenn Morris <rgm@gnu.org>
7920
d66b744d
GM
7921 * s/: Remove empty directory.
7922
837b365b
GM
7923 * s/ms-w32.h: Move to ../nt/inc.
7924 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
7925 Update for new ms-w32.h location.
7926
13294f95
PE
79272012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7928
7929 Port to Solaris 8.
7930 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
7931
90df0db3
GM
79322012-08-02 Glenn Morris <rgm@gnu.org>
7933
7934 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
7935 hard-coding the path separator.
7936
4939150c
PE
79372012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7938
7939 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
7940 This how ASET and AREF are supposed to work, and makes
7941 it easier to think about future improvements. See
7942 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
7943 * charset.h (set_charset_attr): New function.
7944 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
7945 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
7946 (aref_addr): New function. All uses of &AREF(...) changed.
7947 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7948 (set_hash_index): New functions. All lvalue-style uses of
7949 HASH_KEY etc. changed.
7950 * keyboard.c (set_prop): New function. All lvalue-style uses
7951 of PROP changed.
7952
947b2afd
AA
79532012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
7954
7955 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
7956 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 7957 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
7958 * nsfns.m (ns_set_name_as_filename): Likewise.
7959 * nsmenu.m (ns_update_menubar): Likewise.
7960 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
7961
4f5d0325
EZ
79622012-08-01 Eli Zaretskii <eliz@gnu.org>
7963
2008beae
EZ
7964 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
7965 Adapt to latest changes in field names of the corresponding Lisp
288479f6 7966 objects.
2008beae 7967
4f5d0325
EZ
7968 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
7969
fe3cc771
GM
79702012-08-01 Glenn Morris <rgm@gnu.org>
7971
7972 * s/msdos.h: Remove file.
7973 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
7974 * Makefile.in (S_FILE): Remove.
7975 (config_h): Remove S_FILE.
7976
c90acc54
JB
79772012-08-01 Juanma Barranquero <lekktu@gmail.com>
7978
7979 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
7980 Remove; moved to nt/config.nt.
7981
d8a05828
DA
79822012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7983
7984 Use INTERNAL_FIELD for conses and overlays.
7985 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
7986 Remove obsolete comment.
7987 (MVAR): New macro.
7988 (struct Lisp_Overlay): Use INTERNAL_FIELD.
7989 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
7990
8271d590
DA
79912012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7992
7993 Use INTERNAL_FIELD for symbols.
7994 * lisp.h (SVAR): New macro. Adjust users.
7995 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
7996 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
7997
3193acd2
DA
79982012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7999
8000 Use INTERNAL_FIELD for processes.
8001 * process.h (PVAR): New macro. Adjust style.
8002 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8003 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8004
3a45383a
DA
80052012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8006
8007 Use INTERNAL_FIELD for windows.
8008 * window.h (WVAR): New macro.
8009 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8010 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8011 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8012 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8013 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8014 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8015
c1dbc63c
PE
80162012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8017
8018 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8019
5c0c0e8a
GM
80202012-08-01 Glenn Morris <rgm@gnu.org>
8021
8022 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8023 Move to configure.ac.
8024
552a99b4
JB
80252012-08-01 Juanma Barranquero <lekktu@gmail.com>
8026
8027 * makefile.w32-in (CONFIG_H): Update dependencies.
8028 (CONF_POST_H): New macro.
8029
8030 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8031
8d8e2dfe
GM
80322012-07-31 Glenn Morris <rgm@gnu.org>
8033
bc96620a
GM
8034 * Makefile.in (S_FILE): No longer set by configure.
8035
476b1b2d
GM
8036 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8037 is available.
8038 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8039
b2c7a106
GM
8040 * process.h (NULL_DEVICE):
8041 * emacs.c (SEPCHAR):
8042 * editfns.c (USER_FULL_NAME): Let configure set them.
8043
d53d062a
GM
8044 * s/README, s/template.h: Remove files.
8045
4515017f
GM
8046 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8047
8d8e2dfe
GM
8048 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8049 Move to configure.ac.
8050
5b20b3cc
EZ
80512012-07-31 Eli Zaretskii <eliz@gnu.org>
8052
1e0afd9a
EZ
8053 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8054 resulting renaming of 'struct frame' members.
8055
5b20b3cc
EZ
8056 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8057
8058 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8059 after introduction of FVAR.
8060
f1310128
JD
80612012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8062
79e721e0
JD
8063 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8064
8065 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8066 instead of compositeToPoint.
8067 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8068
8d7c7eed 8069 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 8070
e34f7f79
DA
80712012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8072
8073 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8074 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 8075 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
8076 (BVAR): Change to use INTERNAL_FIELD.
8077 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8078 (KVAR): Change to use INTERNAL_FIELD.
8079 * frame.h (FVAR): New macro.
8080 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
8081 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8082 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8083 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
8084 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8085
c09bfb2f
DA
80862012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8087
8088 Miscellaneous fixes for non-default X toolkits.
8089 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8090 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8091 Move under #ifdef USE_LUCID.
8092 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8093 definition and usage to avoid warnings.
8094
14c114ae
JD
80952012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8096
8097 * nsterm.m (openFiles): Fix previous checkin.
8098
3bd21e82
PE
80992012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8100
8101 * indent.c (compute_motion): Remove unused local.
8102
c1529ded
GM
81032012-07-31 Glenn Morris <rgm@gnu.org>
8104
400d5621
GM
8105 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8106
268e2432
GM
8107 * conf_post.h [USG5_4]:
8108 Move remaining contents of s/usg5-4-common.h here.
8109 * s/usg5-4-common.h: Remove file.
8110
7552f3ee
GM
8111 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8112 * s/irix6-5.h: Remove file.
8113
6a381852
GM
8114 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8115 * s/darwin.h: Remove file.
8116
c1529ded
GM
8117 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8118 * s/hpux10-20.h: Remove file, which is now empty.
8119
b429a4ee
GM
81202012-07-30 Glenn Morris <rgm@gnu.org>
8121
8122 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8123 * Makefile.in (config_h): Add conf_post.h.
8124 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8125
adff3182
JD
81262012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8127
8128 * nsterm.m (ns_do_open_file): New variable.
b9031d69 8129 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
8130 (openFile, openTempFile, openFileWithoutUI, openFiles):
8131 Open files only if ns_do_open_file.
adff3182 8132
c32af1e4
PE
81332012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8134
7393bcbb
PE
8135 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8136 This no-op macro hasn't been needed for many years.
8137 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8138
c32af1e4
PE
8139 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8140 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8141 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8142 gdb_make_enums_visible.
8143 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8144 (DIRECTORY_SEP): Now a constant, not a macro.
8145
302fc036
EZ
81462012-07-30 Eli Zaretskii <eliz@gnu.org>
8147
8148 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8149 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8150
8151 * w32term.c <w32_keyboard_codepage>: Renamed from
8152 keyboard_codepage and now external. All users changed.
8153
8154 * w32term.h: Add declaration of w32_keyboard_codepage.
8155
8156 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8157 the codepage to translate keys to Unicode. If this argument is
8158 -1, use the value returned by GetConsoleCP. All callers changed.
8159
88fb40b4
PE
81602012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8161
0aee6912
PE
8162 Update .PHONY listings in makefiles.
8163 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8164 bootstrap-clean, distclean, maintainer-clean, versioclean,
8165 extraclean, frc.
8166
88fb40b4
PE
8167 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8168 This is a bit clearer. Fix some commentary typos.
8169
0a763bd1
GM
81702012-07-30 Glenn Morris <rgm@gnu.org>
8171
32bac6d6
GM
8172 * s/netbsd.h: Let configure include signal.h if needed.
8173 Remove file, which is now empty.
8174
b65e7c46
GM
8175 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8176 Let configure set them.
8177 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8178 No more need to undefine.
0a763bd1 8179
169304bd
AS
81802012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8181
8182 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8183 non-single-byte char when adding meta modifier. (Bug#12090)
8184
6cd7a139
DA
81852012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8186
8187 Convert safe_call to use variable number of arguments.
8188 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8189 (safe_call2): Fix comment.
8190 * lisp.h (safe_call): Adjust prototype.
8191 * coding.c (encode_coding_object): Change to use safe_call2.
8192 * xfaces.c (merge_face_heights): Change to use safe_call1.
8193
d34d6ffc
GM
81942012-07-30 Glenn Morris <rgm@gnu.org>
8195
7b8a48e4 8196 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 8197 does that unconditionally. Remove file, which is now empty.
7b8a48e4 8198
d34d6ffc
GM
8199 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8200 Remove empty files.
8201
03a660a6
PE
82022012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8203
8204 Export to GDB most of lisp.h's remaining object-like macros.
8205 * lisp.h (min, max): Move earlier, because they're used earlier now.
8206 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8207 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8208 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8209 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8210 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8211 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8212 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8213 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8214 Now constants, for GDB. They need not be macros.
8215 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8216 Now constants, for GDB, as well as macros, for static initializers.
8217 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8218 Move to after the definition of struct Lisp_Char_Table,
8219 since the former now needs that type defined.
8220 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8221 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8222 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8223 New enums, for gdb_make_enums_visible.
8224 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 8225 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
8226 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8227 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8228 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8229 enum maxargs, enum MAX_ALLOCA.
8230 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8231 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8232 no longer needed, now that they are done in lisp.h.
8233
e499d0ee
DA
82342012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8235
8236 Cleanup string bytes checking.
8237 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8238 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8239 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8240 (check_sblock, compact_small_strings): Simplify.
8241
d5040d2d
PE
82422012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8243
8244 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8245 These macros are confusing and no longer need to be defined, as
8246 the enum values now suffice. All uses replaced with definiens.
8247 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8248
7f259ae6
JB
82492012-07-29 Juanma Barranquero <lekktu@gmail.com>
8250
8251 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8252 ($(BLD)/w32console.$(O)): Update dependencies.
8253
7e63e0c3
DA
82542012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8255
8256 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8257 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8258 time. Adjust users.
8259 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8260
ffd817eb
JD
82612012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8262
8263 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8264 setting sitelisp (Bug#12010).
8265
417a7a0e
EZ
82662012-07-29 Eli Zaretskii <eliz@gnu.org>
8267
14ae4239 8268 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
8269
8270 * w32heap.c (cache_system_info):
8271 * w32.c (sys_rename):
8272 * w32proc.c (find_child_console, sys_kill): All users changed.
8273
387d4d92
PE
82742012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8275
8276 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8277
55a6cca6
EZ
82782012-07-29 Eli Zaretskii <eliz@gnu.org>
8279
8280 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8281
dbcf001c
DA
82822012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8283
8284 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
8285 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8286 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 8287
e2688e4a
DA
82882012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8289
8290 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8291 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8292 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8293 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8294 (replace_range, replace_range_2, del_range_2): Change to eassert.
8295 * marker.c (byte_char_debug_check): Adjust style.
8296
b46a6a83
PE
82972012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8298
8299 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8300 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8301 long-ago-commented-out code that talks about "WIN32".
8302 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8303 All uses changed.
8304
e32a5799
PE
83052012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8308 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8309 Simplify by using alignof.
8310 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8311 * lisp.h: Include <stdalign.h>.
8312 (GCALIGNMENT): New macro and constant.
8313 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8314 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8315 (stdalign): New macro, if not already defined.
8316
df81cd29
EZ
83172012-07-28 Eli Zaretskii <eliz@gnu.org>
8318
01bd1b0d
EZ
8319 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8320 * w32inevt.c: Include w32inevt.h.
8321 (w32_read_console_input): New inline function, calls either
8322 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8323 w32_console_unicode_input.
8324 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8325 (w32_kbd_patch_key, key_event): Use the codepage returned by
8326 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8327 (key_event): use uChar.UnicodeChar only if
8328 w32_console_unicode_input is non-zero.
8329
8330 * w32console.c: Include w32heap.h.
8331 <w32_console_unicode_input>: New global variable.
8332 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8333 family of Windows, zero otherwise.
8334
8335 * w32inevt.h: Declare w32_console_unicode_input.
8336
df81cd29
EZ
8337 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8338 --without-x. (Bug#11742)
8339
c20fdd9e
PE
83402012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8341
8342 Adjust GDB to reflect pvec_type changes (Bug#12036).
8343 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
8344 2012-07-04 changes to pseudovector representation.
8345 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 8346
32770973 83472012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
8348
8349 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8350 bus address.
8351 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8352
3438fe21
EZ
83532012-07-27 Eli Zaretskii <eliz@gnu.org>
8354
bcfbc9de
EZ
8355 * alloc.c (listn): Fix the order the arguments are consed onto the
8356 list.
8357
3438fe21
EZ
8358 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8359 enumeration constants, as PURE and HEAP are too general, and clash
8360 with other headers and sources, such as gmalloc.c and the
8361 MS-Windows system headers. All users changed.
8362
eeaea515
DA
83632012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8364
8365 Revert last save_excursion_save and save_excursion_restore changes.
8366 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8367 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8368
073c88c2
DA
83692012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8370
8371 Fix recently-introduced typos in Windows port.
8372 Reported by Martin Rudalics <rudalics@gmx.at>.
8373 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 8374 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 8375
4706125e
PE
83762012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8377
8378 Improve GDB symbol export (Bug#12036).
8379 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8380 arms of an 'if', not using conditional expressions; otherwise GDB
8381 complains about the types in the unevaluated arm when the argument
8382 is an integer literal.
8383 (xgetint): Simplify expression.
8384 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8385 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8386 Zaretskii in <http://bugs.gnu.org/12036#13>.
8387 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8388 needed now that we have gdb_make_enums_visible.
8389 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8390 (enum enum_USE_LSB_TAG):
8391 New enum types, packaging up enums that need to be exported to GDB.
8392
694b6c97
DA
83932012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8394
8395 Utility function to make a list from specified amount of objects.
8396 * lisp.h (enum constype): New datatype.
8397 (listn): New prototype.
8398 * alloc.c (listn): New function.
8399 (Fmemory_use_count, syms_of_alloc): Use it.
8400 * buffer.c (syms_of_buffer): Likewise.
8401 * callint.c (syms_of_callint): Likewise.
8402 * charset.c (define_charset_internal): Likewise.
8403 * coding.c (syms_of_coding): Likewise.
8404 * keymap.c (syms_of_keymap): Likewise.
8405 * search.c (syms_of_search): Likewise.
8406 * syntax.c (syms_of_syntax): Likewise.
8407 * w32.c (init_environment): Likewise.
8408 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8409 * xdisp.c (syms_of_xdisp): Likewise.
8410 * xfns.c (syms_of_xfns): Likewise.
8411
6195f384
DA
84122012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8413
8414 Fast save_excursion_save and save_excursion_restore.
8415 * lisp.h (struct Lisp_Excursion): New data type.
8416 (PVEC_EXCURSION): New pseudovector type.
8417 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8418 to deal with it. Adjust comments.
8419 (init_marker, attach_marker): New prototype.
8420 (unchain_marker): Adjust prototype.
8421 * marker.c (attach_marker): Change to global.
8422 (init_marker): New function.
8423 * alloc.c (Fmake_marker, build_marker): Use it.
8424 (build_marker): More easserts.
8425 (mark_object): Handle struct Lisp_Excursion.
8426 * editfns.c (save_excursion_save, save_excursion_restore):
8427 Reimplement to use struct Lisp_Excursion. Add comments.
8428
5eceb8fb
PE
84292012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8430
8431 Fix export of symbols to GDB (Bug#12036).
8432 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8433 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8434 emacs.c, as this is a more-suitable home. Had this been done earlier
8435 the fix for 12036 would have avoided some of the problems noted in
8436 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8437 would have been more obvious.
562157c8
PE
8438 * emacs.c: Do not include <verify.h>; no longer needed.
8439 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
8440 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8441 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8442 Remove; now done in lisp.h.
8443 * lisp.h (PUBLISH_TO_GDB): New macro.
8444 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8445 (DATA_SEG_BITS): Use it.
8446 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8447 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8448 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8449 not be usable in #if. This simplifies things.
8450
d6749401
JB
84512012-07-26 Juanma Barranquero <lekktu@gmail.com>
8452
8453 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8454
1781b9e9
PE
84552012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8456
d89518db 8457 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
8458 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8459 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8460 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8461 Adjust to changes in lisp.h and emacs.c, by using
8462 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8463 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8464 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8465 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8466 instead of gdb_valbits.
8467 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8468 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8469 instead of gdb_array_mark_flag.
8470 (xboolvector): Get size from $->size, not $->header.size.
8471 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8472 (xreload, hook-run, hookpost-run): Remove.
8473 * emacs.c: Include <verify.h>.
8474 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8475 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8476 Remove.
8477 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8478 (gdb_USE_LSB_TAG): New enum constants.
8479 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8480 Also define these as enum constants, so they're visible to GDB.
8481 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8482 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8483 as constants, so they're visible to GDB.
8484 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8485 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8486 Now enum constants, not macros, so they're visible to GDB.
8487 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8488 more convenient now. All uses changed.
8489 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8490 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8491
3628596a
DA
84922012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8493
8494 Explicitly free restriction data that are not needed anymore.
8495 * editfns.c (save_restriction_restore): Free restriction data.
8496
7abaf5cc
SM
84972012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8498
8499 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8500 add argument, tune behavior, and adjust all callers.
8501
71f88e00
PE
85022012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8503
8504 Use typedef for EMACS_INT, EMACS_UINT.
8505 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8506 than macros. This simplifies debugging in the usual case, since
8507 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8508 and it allows expressions involving EMACS_INT casts.
8509 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8510
57ec3034
JD
85112012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8512
8513 * nsterm.m (ns_read_socket): Return early if there is a modal
8514 window (Bug#12043).
8515
8137e7b3
MR
85162012-07-25 Martin Rudalics <rudalics@gmx.at>
8517
8518 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8519 that FOCUS-FRAME can be omitted.
8520
04e9897c
DA
85212012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8522
8523 Adjust buffer text indirection counters at the end of Fkill_buffer.
8524 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8525 buffer is definitely dead. This should really fix an issue reported
8526 by Christoph Scholtes again. (Bug#12007).
8527 (init_buffer_once): Initialize indirection counters of
8528 buffer_defaults and buffer_local_symbols (for sanity and safety).
8529
8a0484e1
EZ
85302012-07-24 Eli Zaretskii <eliz@gnu.org>
8531
8532 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8533 and continuation glyphs on tooltip frames, leave them at zero.
8534 Avoids continued lines in tooltips. (Bug#11832)
8535
fa691a83
DA
85362012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8537
8538 Simplify copy_overlay.
04e9897c 8539 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
8540 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8541
436bc8e0
EZ
85422012-07-23 Eli Zaretskii <eliz@gnu.org>
8543
8544 * print.c (print_object): Don't crash when a frame's name is nil
8545 or invalid. (Bug#12025)
8546
8547 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8548 it signals an error when a tooltip frame is being created.
8549
d7a7fda3
DA
85502012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8551
8552 Cleanup miscellaneous objects allocation and initialization.
8553 * alloc.c (allocate_misc): Change to static. Add argument to
8554 specify the subtype. Adjust comment and users.
8555 (build_overlay): New function.
8556 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8557 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8558 (allocate_misc): Remove prototype.
8559 (build_overlay): Add prototype.
8560
85612012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
8562
8563 Swap buffer text indirection counters in Fbuffer_swap_text.
8564 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8565 This avoids crash reported by Christoph Scholtes at
8566 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8567
9d7fa573
JD
85682012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8569
8570 * nsmenu.m (Popdown_data): New struct.
8571 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8572 free Popdown_data.
8573 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8574 (initWithContentRect): Make imgView and contentView non-static
8575 and autorelease them. Also autorelease img and matrix (Bug#12005).
8576 (dealloc): Remove (Bug#12005).
8577
0dd6d66d
DA
85782012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8579
8580 Adjust consing_since_gc when objects are explicitly freed.
8581 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8582 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8583 (free_cons, free_misc): Subtract object size from consing_since_gc.
8584
d36d71df
DA
85852012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8586
8587 Simplify and cleanup markers positioning code.
8588 * marker.c (attach_marker): More useful eassert.
8589 (live_buffer, set_marker_internal): New function.
8590 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8591 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8592
fb9ea40f
PE
85932012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8594
8595 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8596 as it's limited by the amount of memory, not by INT_MAX.
8597
2d5c5f7d
EZ
85982012-07-21 Eli Zaretskii <eliz@gnu.org>
8599
07fb592e
EZ
8600 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8601 in special-event-map. See the discussion at
8602 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8603 for the reasons.
8604
37a9eac8 8605 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
8606 info.dwItemData. Fixes crashes on 64-bit Windows.
8607 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 8608
c4328746
JD
86092012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8610
fc0c31f8 8611 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 8612 (conversationIdentifier): Return value is NSInteger.
784051c4 8613 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 8614
6e5d1c12
CY
86152012-07-21 Chong Yidong <cyd@gnu.org>
8616
8617 * window.c (decode_any_window): Signal an error if the window is
8618 on a dead frame (Bug#11984).
8619
9928463d
DA
86202012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8621
8622 Add indirection counting to speed up Fkill_buffer.
8623 * buffer.h (struct buffer): New member.
8624 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8625 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8626 base buffer indirection counter.
8627 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8628 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8629 through buffer list if indirection counter is 0.
8630
f8643a6b
DA
86312012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8632
8633 Extend the value returned by Fgarbage_collect with heap statistics.
8634 * alloc.c (Qheap): New symbol.
8635 (syms_of_alloc): DEFSYM it.
8636 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8637 (Fmemory_free): Remove.
8638 (syms_of_alloc): Don't defsubr it.
8639 * buffer.c (Fcompact_buffer): Remove.
8640 (syms_of_buffer): Don't defsubr it.
8641
dac616ff
DA
86422012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8643
8644 Make maybe_gc inline.
8645 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8646 * lisp.h (consing_since_gc, gc_relative_threshold)
8647 (memory_full_cons_threshold): Revert declaration.
8648 (maybe_gc): Remove prototype, define as inline.
8649 * alloc.c: Remove old commented-out code.
8650 (consing_since_gc, gc_relative_threshold)
8651 (memory_full_cons_threshold): Revert to global.
8652 (maybe_gc): Remove.
8653
d7ea76b4
DA
86542012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8655
8656 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8657 * lisp.h (build_unibyte_string): New function.
8658 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8659 * sysdep.c, w32fns.c, xfns.c: Use it.
8660 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8661 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8662 Adjust users accordingly.
8663 * font.h (font_open_by_name): Adjust prototype.
8664
765e61e3
DA
86652012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8666
8667 Cleanup calls to Fgarbage_collect.
8668 * lisp.h (maybe_gc): New prototype.
8669 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8670 Remove declarations.
8671 * alloc.c (maybe_gc): New function.
8672 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8673 Make them static.
8674 * bytecode.c (MAYBE_GC): Use maybe_gc.
8675 * eval.c (eval_sub, Ffuncall): Likewise.
8676 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8677 to avoid dependency from auto-save feature.
8678
52b852c7
PE
86792012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8680
8681 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8682 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8683 'for_each_per_buffer_object_at'.
8684 All uses changed. It's better to use upper-case for macros that
8685 cannot be implemented as functions, to give the reader a clue
8686 that they're special.
8687
5db81e33
SM
86882012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8689
8690 * alloc.c (Fgarbage_collect): Tweak docstring.
8691
5b835e1d
DA
86922012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8693
8694 Tweak the value returned from Fgarbage_collect again.
8695 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8696 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8697 Adjust documentation.
8698 (total_vector_bytes): Rename to total_vector_slots, adjust
8699 accounting.
8700 (total_free_vector_bytes): Rename to total_free_vector_slots,
8701 adjust accounting.
8702 (Qstring_bytes, Qvector_slots): New symbols.
8703 (syms_of_alloc): DEFSYM them.
8704
9cd47b72
DA
87052012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8706
8707 Buffer compaction primitive which may be used from Lisp.
8708 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8709 (syms_of_buffer): Register Fcompact_buffer.
8710 * alloc.c (Fgarbage_collect): Use compact_buffer.
8711 * buffer.h (compact_buffer): New prototype.
8712 (struct buffer_text): New member.
8713
d17337e5
DA
87142012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8715
8716 New macro to iterate over all buffers, miscellaneous cleanups.
8717 * lisp.h (all_buffers): Remove declaration.
8718 * buffer.h (all_buffers): Add declaration, with comment.
8719 (for_each_buffer): New macro.
8720 * alloc.c (Fgarbage_collect, mark_object): Use it.
8721 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8722 (init_buffer): Likewise.
8723 * data.c (Fset_default): Likewise.
8724 * coding.c (code_conversion_restore): Remove redundant check
8725 for dead buffer.
8726 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8727
60cfd278
AS
87282012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8729
8730 Fix bug that created negative-length intervals.
8731 * intervals.c (merge_interval_right, merge_interval_left):
8732 Do not zero out this interval if it is absorbed by its children,
8733 as this interval's total length doesn't change in that case. See
8734 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8735
d06714cb
PE
87362012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8737
83713154
PE
8738 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8739 when invoking (make-bool-vector N t) and N is a positive
8740 multiple of 8 -- the last 8 bits were mistakenly cleared.
8741
d06714cb
PE
8742 Remove some struct layout assumptions in bool vectors.
8743 * alloc.c (bool_header_size): New constant.
8744 (header_size, word_size): Move earlier, as they're now used earlier.
8745 Use 'word_size' in a few more places, where it's appropriate.
8746 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8747 padding before the data member of a bool vector.
8748 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8749 than doing the check by hand with an abort ().
8750
464d5a5e
SM
87512012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8752
5fbc0409
SM
8753 * eval.c (Fdefvar): Don't check constants since we only set the var if
8754 it's not yet defined anyway (bug#11904).
8755
464d5a5e
SM
8756 * lisp.h (last_undo_boundary): Declare new var.
8757 * keyboard.c (command_loop_1): Set it.
8758 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
8759 were auto-added by the command loop (bug#11774).
8760
8dc2e44a
AS
87612012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8762
8763 * w32font.c (Qsymbol): Remove local definition.
8764 (syms_of_w32font): Don't DEFSYM it.
8765
169925ec
DA
87662012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8767
8768 Fix sweep_vectors to handle large bool vectors correctly.
8769 * alloc.c (sweep_vectors): Account total_vector_bytes for
8770 bool vectors larger than VBLOCK_BYTES_MAX.
8771
5fbfb018
CY
87722012-07-18 Chong Yidong <cyd@gnu.org>
8773
8774 * frame.c (x_set_frame_parameters): Revert bogus change introduced
8775 in 2012-05-25 commit by Paul Eggert (Bug#11738).
8776
3ab6e069
DA
87772012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8778
8779 Return more descriptive data from Fgarbage_collect.
8780 Suggested by Stefan Monnier in
8781 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
8782 * alloc.c (bounded_number): New function.
8783 (total_buffers, total_vectors): New variable.
8784 (total_string_size): Rename to total_string_bytes, adjust users.
8785 (total_vector_size): Rename to total_vector_bytes, adjust users.
8786 (sweep_vectors): Account total_vectors and total_vector_bytes.
8787 (Fgarbage_collect): New return value. Adjust documentation.
8788 (gc_sweep): Account total_buffers.
8789 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
8790 (VECTOR_SIZE): Remove.
8791 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
8792 (Qinterval, Qmisc): New symbols.
8793 (syms_of_data): Initialize them.
8794 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
8795 (Qcons, Qbuffer): New declarations.
8796
6d02fe5b
PE
87972012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8798
8799 * alloc.c (Fmemory_free): Account for memory-free's own storage.
8800 Round up, not down. Improve doc.
8801
b7ffe040
DA
88022012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8803
8804 Restore old code in allocate_string_data to avoid Faset breakage.
8805 Reported by Julien Danjou <julien@danjou.info> in
8806 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
8807 * alloc.c (allocate_string_data): Restore old code with minor
8808 adjustments, fix comment to explain this subtle issue.
8809
4dc7c8d5
SM
88102012-07-17 Eli Zaretskii <eliz@gnu.org>
8811
8812 Remove FILE_SYSTEM_CASE.
8813 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
8814
8815 * fileio.c (FILE_SYSTEM_CASE): Don't define.
8816 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
8817 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
8818 call-process-region passes it through expand-file-name.
8819
8820 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
8821
88222012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8823
8824 Fix crash when creating indirect buffer (Bug#11917)
8825 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
8826 Don't handle unbound variables specially if non-zero.
8827 (Fbuffer_local_variables): Pass zero.
8828 (clone_per_buffer_values): Pass non-zero.
8829
88302012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8831
8832 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
8833 to make the loop interruptible.
8834
88352012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8836
8837 * gnutls.c (emacs_gnutls_handshake): Only retry if
8838 GNUTLS_E_INTERRUPTED.
8839
cce7fefc
DA
88402012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8841
8842 Cleanup and convert miscellaneous checks to eassert.
8843 * alloc.c (mark_interval): Fix comment, partially rephrase
8844 old comment from intervals.h (see below).
8845 * intervals.c (find_interval, adjust_intervals_for_insertion)
8846 (delete_interval, adjust_intervals_for_deletion)
8847 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8848 Convert to eassert.
8849 (adjust_intervals_for_insertion, make_new_interval):
8850 Remove obsolete and unused code.
8851 * intervals.h (struct interval): Remove obsolete comment.
8852 * textprotp.c (erase_properties): Remove unused code.
8853 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8854 (Fremove_list_of_text_properties): Convert to eassert.
8855
9ea10cc3
CY
88562012-07-17 Chong Yidong <cyd@gnu.org>
8857
8858 * editfns.c (Finsert_char): Doc fix.
8859
3900d5de
DA
88602012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8861
8862 Fix previous change to make Fmemory_free always accurate.
8863 * alloc.c (make_interval): Update total_free_intervals.
8864 (make_float): Likewise for total_free_floats.
8865 (free_cons, Fcons): Likewise for total_free_conses.
8866 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8867 Likewise for total_free_vector_bytes.
8868 (Fmake_symbol): Likewise for total_free_symbols.
8869 (bytes_free): Remove.
8870
7098646f
DA
88712012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8872
8873 Simple free memory accounting feature.
8874 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8875 (sweep_vectors): Accumulate size of free vectors.
8876 (Fgarbage_collect): Setup bytes_free.
8877 (Fmemory_free): New function.
8878 (syms_of_alloc): Register it.
8879
22657b40
DA
88802012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8881
8882 Cleanup overlays checking.
8883 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8884 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8885 eassert and OVERLAYP.
8886 (sort_overlays): Change to use OVERLAYP.
8887
ddfc8813
RK
88882012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8889
8890 * editfns.c (Finsert_char): Make it interactive, and make the
8891 second arg optional. Copy interactive spec and docstring from
8892 ucs-insert.
8893
7c26cf3c
PE
88942012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8895
8896 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
8897 Unlike the other wrapped functions, fabs has an unspecified
8898 effect on errno.
8899
5d127af9
JD
89002012-07-16 Jan Djärv <jan.h.d@swipnet.se>
8901
8902 * nsterm.m (keyDown): Interpret flags without left/right bits
8903 as the left key (Bug#11670).
8904
6a0dd1d7
DA
89052012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8906
8907 Remove empty and useless init functions.
8908 * lisp.h (init_character_once, init_fns, init_image)
8909 (init_filelock, init_sound): Remove prototype.
8910 * character.c (init_character_once): Remove.
8911 * filelock.c (init_filelock): Likewise.
8912 * fns.c (init_fns): Likewise.
8913 * image.c (init_image): Likewise.
8914 * sound.c (init_sound): Likewise.
8915 * emacs.c (main): Adjust accordingly.
8916
7a6136fd
DA
89172012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8918
8919 * gtkutil.h: Tiny cleanups.
8920 (use_old_gtk_file_dialog): Remove useless declaration.
8921 (xg_uses_old_file_dialog): Add suggested const attribute.
8922
ce811ad9
EZ
89232012-07-15 Eli Zaretskii <eliz@gnu.org>
8924
8925 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
8926 (bidi_paragraph_init): Use it to limit search forward for a strong
8927 directional character in abnormally large paragraphs full of
8928 neutral or weak characters. (Bug#11943)
8929
c9adfeaa
SF
89302012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
8931
8932 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
8933 the toolbar (Bug#9451).
8934 (xg_make_tool_item): Give the widget event box a transparent
8935 background.
8936
fff62aa9
DA
89372012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8938
8939 Cleanup basic allocation variables and functions.
8940 * alloc.c (ignore_warnings, init_intervals, init_float)
8941 (init_cons, init_symbol, init_marker): Remove.
8942 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
8943 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
8944 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
8945 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
8946 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
8947 (staticidx, init_alloc_once, init_strings, free_ablock):
8948 Remove redundant initialization.
8949 * fns.c (init_weak_hash_tables): Remove.
8950 * lisp.h (init_weak_hash_tables): Remove prototype.
8951
9730daca
DA
89522012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8953
8954 Use zero_vector where appropriate.
8955 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
8956 accordingly.
8957 * lisp.h (zero_vector): New declaration.
8958 * font.c (null_vector): Remove.
8959 (syms_of_font): Remove initialization and staticpro.
8960 (font_list_entities, font_find_for_lface): Change to use zero_vector.
8961 * keymap.c (Faccessible_keymaps): Likewise.
8962
2e2d2a13
LL
89632012-07-15 Leo Liu <sdl.web@gmail.com>
8964
8965 * fringe.c: Fix typo in comments.
8966
cd276f6e
LL
89672012-07-14 Leo Liu <sdl.web@gmail.com>
8968
8969 * fringe.c: Add a new bitmap exclamation-mark.
8970
5a1131d9
EZ
89712012-07-14 Eli Zaretskii <eliz@gnu.org>
8972
8973 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
8974
8975 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
8976 (HAVE_MENUS): Don't define, defined by editing config.in with
8977 msdos/sed2v2.inp.
8978 (GMALLOC_INHIBIT_VALLOC): Don't define.
8979 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
8980
22e983b7
JB
89812012-07-14 Juanma Barranquero <lekktu@gmail.com>
8982
8983 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
8984
5b3f250f
GM
89852012-07-14 Glenn Morris <rgm@gnu.org>
8986
8987 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
8988 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
8989 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
8990
33d63ff4
GM
89912012-07-13 Glenn Morris <rgm@gnu.org>
8992
5b633342
GM
8993 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
8994
33d63ff4
GM
8995 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
8996 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
8997
b55b9f85
JD
89982012-07-13 Jan Djärv <jan.h.d@swipnet.se>
8999
0dc8cf50
JD
9000 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9001 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9002 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9003 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9004 where appropriate.
9005 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9006 as boolean expression.
9007 (x_set_window_size): Remove unused variable toolbar.
9008 (ns_get_color_default, ns_mod_to_lisp): Remove.
9009 (ns_mouse_position): Remove unused variables xchar and ychar.
9010 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9011 (ns_set_vertical_scroll_bar): Remove unused variable count.
9012 (ns_delete_terminal): Remove unused variable i.
9013 (ns_term_init): Remove unused variables r, g and b.
9014 (mouseDown): Remove unused variable window.
9015 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9016 (initFrameFromEmacs): Remove unused variable vbextra.
9017 (mouseEntered): Remove unused variables p and dpyinfo.
9018 (mouseExited): Remove unused variables p and r.
9019 (ns_define_frame_cursor, ns_clear_frame_area)
9020 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9021 (menuDown): Assign [sender tag] to variable and cast the variable.
9022
9023 * nsterm.h (menuDown): Add id as type to argument sender.
9024 (ns_display_info_for_name): Add Lisp_Object argument.
9025 (ns_term_init): Add Lisp_Object argument.
9026 (ns_map_event_to_object): Add void argument.
9027 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9028 prototype with arguments and only declare if __OBJC__.
9029 (nxatoms_of_nsselect): Add void argument.
9030 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9031 (ns_alloc_autorelease_pool): Add void argument.
9032 (ns_release_autorelease_pool): Add void* argument.
9033 (ns_get_defaults_value): Add const char* argument.
9034
9035 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9036 (initFromContents): Use SSDATA where appropriate.
9037 (ns_update_menubar): Add braces to ambigous if-else.
9038 (initWithTitle): Put () around assignment in if statement.
9039 (ns_menu_show): Remove unused variables window and keymap.
9040 (update_frame_tool_bar): Remove unused variable selected_p.
9041 (initWithContentRect): Remove unused variable this_cmd_name.
9042
9043 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9044 appropriate.
9045 (setXBMColor): Remove unused variable len.
9046 (setPixmapData): Put () around assignment in loop statement.
9047
9048 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9049 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9050 where appropriate.
9051 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9052 around assignment in loop statement.
9053 (nsfont_open): Remove unused variable i.
9054 (nsfont_open): Remove unused variable len.
9055 (nsfont_draw): Remove unused variable cs.
9056
9057 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9058 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9059 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9060 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9061 (Fns_font_name, Fns_perform_service)
9062 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9063 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9064 (ns_set_name): Remove unused variable view.
9065 (x_set_menu_bar_lines): Remove unused variable olines.
9066 (x_set_tool_bar_lines): Remove unused variable root_window.
9067 (Fns_list_colors): Put () around assignment in while statement.
9068 (Fns_perform_service): Remove unused variable len.
9069 (Fns_display_usable_bounds): Remove unused variable top.
9070 (syms_of_nsfns): Remove unused variable i.
9071
b55b9f85
JD
9072 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9073 memcpy (Bug#11907).
9074
ed9265fc 90752012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
9076
9077 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9078 and free it with DestroyExceptionInfo (Bug#11558).
9079
ef099b57
JB
90802012-07-13 Juanma Barranquero <lekktu@gmail.com>
9081
9082 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9083 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9084 Set here, not in nt/config.nt.
9085
ea814a5d
EZ
90862012-07-13 Eli Zaretskii <eliz@gnu.org>
9087
9088 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9089 cursor overflow into the last glyph on display line when the right
9090 fringe is off. (Bug#11832)
9091
1a952767
PE
90922012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9093
9094 * xdisp.c (produce_special_glyphs): Now static.
9095 * dispextern.h (produce_special_glyphs): Remove decl.
9096
983188fd
GM
90972012-07-13 Glenn Morris <rgm@gnu.org>
9098
8d7c7eed 9099 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
9100 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9101
983188fd
GM
9102 * s/usg5-4-common.h (USG, USG5):
9103 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9104 * s/sol2-6.h (SOLARIS2):
9105 * s/irix6-5.h (IRIX6_5):
9106 * s/hpux10-20.h (USG, USG5, HPUX):
9107 * s/gnu-linux.h (USG, GNU_LINUX):
9108 * s/freebsd.h (BSD_SYSTEM):
9109 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9110 * s/cygwin.h (CYGWIN):
9111 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9112 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9113
d1e68667 91142012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
9115
9116 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 9117
6de0e799
GM
91182012-07-13 Glenn Morris <rgm@gnu.org>
9119
739ae010
GM
9120 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9121
dbee5793
GM
9122 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9123
6de0e799
GM
9124 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9125 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9126
b82da769
GM
91272012-07-12 Glenn Morris <rgm@gnu.org>
9128
4fae5a7a 9129 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
9130
9131 * process.c (init_process_emacs): Rename from init_process.
9132 The old name is also the name of a Mach system call.
9133 * lisp.h, emacs.c: Update for this name change.
9134 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9135 longer needed.
9136
5a979817
EZ
91372012-07-12 Eli Zaretskii <eliz@gnu.org>
9138
9139 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9140 memmove call that removes glyphs covered by the left truncation
9141 glyph. Improve commentary.
9142 (display_line): Fix display of continuation glyphs on GUI frames
9143 when the right fringe is turned off and variable-size fonts are
9144 used in the window. Move the code that appends a stretch glyph to
9145 produce_special_glyphs, so that it could be used for truncation
9146 and continuation glyphs alike.
9147 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9148 glyph of a suitably computed width, to align the special glyphs at
9149 the window margin. Code moved from display_line. (Bug#11832)
9150
3e91a053
GM
91512012-07-12 Glenn Morris <rgm@gnu.org>
9152
ba9e4b84
GM
9153 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9154
9155 * s/gnu-linux.h, s/hpux10-20.h:
9156 Do not unconditionally define HAVE_XRMSETDATABASE.
9157
3e91a053
GM
9158 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9159
b300b1f4
PE
91602012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9161
9162 Fix typos that broke OS X build.
9163 Reported by Randal L. Schwartz in
9164 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9165 * nsterm.m (ns_timeout): Add missing local decl.
9166 (ns_get_color): snprintf -> sprintf, to fix typo.
9167
6e777848
GM
91682012-07-12 Glenn Morris <rgm@gnu.org>
9169
3f922c37
GM
9170 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9171 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9172 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9173 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9174
0ab7b23a
GM
9175 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9176 Move PTY_OPEN to configure.
9177
6e777848
GM
9178 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9179 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9180 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9181
4a7edc24
DA
91822012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9183
9184 Use empty_unibyte_string where applicable.
9185 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9186 * lread.c (read1): Likewise.
9187 * xsettings.c (syms_of_xsettings): Likewise.
9188
308aab79
GM
91892012-07-12 Glenn Morris <rgm@gnu.org>
9190
42bd1719
GM
9191 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9192 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
9193 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9194 * s/hpux10-20.h (RUN_TIME_REMAP):
9195 * s/bsd-common.h (TABDLY): Move to configure.
9196
9197 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9198
9199 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9200
ea0bbd17 9201 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 9202 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
9203
9204 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 9205
308aab79
GM
9206 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9207 * s/template.h: Move NARROWPROTO to configure.
9208
ee1cf5cf
GM
92092012-07-11 Glenn Morris <rgm@gnu.org>
9210
30fe9bf4
GM
9211 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9212 unused since 2011-01-17 change to systty.h.
9213
ee1cf5cf
GM
9214 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9215 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9216 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9217
63e47e07
PE
92182012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9219
9220 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9221
c43fb4c3
GM
92222012-07-11 Glenn Morris <rgm@gnu.org>
9223
9224 * s/darwin.h, s/gnu-linux.h, s/template.h:
9225 Move INTERRUPT_INPUT to configure.
9226
e8df9267
DA
92272012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9228
9229 Minor adjustments to interning code.
9230 * lisp.h (intern, intern_c_string): Redefine as static inline
9231 wrappers for intern_1 and intern_c_string_1, respectively.
9232 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
9233 * lread.c (intern_1, intern_c_string_1, oblookup):
9234 Simplify Vobarray checking.
e8df9267
DA
9235 * font.c (font_intern_prop): Likewise. Adjust comment.
9236 * w32font.c (intern_font_name): Likewise.
9237
34348bd4
AS
92382012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9239
d96a1e0c
AS
9240 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9241
34348bd4
AS
9242 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9243 of Fcar/Fcdr if possible.
9244 * font.c (check_otf_features): Likewise.
9245 * fontset.c (Fnew_fontset): Likewise.
9246 * gnutls.c (Fgnutls_boot): Likewise.
9247 * minibuf.c (read_minibuf): Likewise.
9248 * msdos.c (IT_set_frame_parameters): Likewise.
9249 * xmenu.c (Fx_popup_dialog): Likewise.
9250 * w32menu.c (Fx_popup_dialog): Likewise.
9251
c8add24e
GM
92522012-07-11 Glenn Morris <rgm@gnu.org>
9253
4b575b3c
GM
9254 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9255 since nothing has defined it on these platforms.
9256
09f4e3b0
GM
9257 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9258 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9259
172bedef
GM
9260 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9261 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9262 Move CLASH_DETECTION to configure.
9263
249685df
GM
9264 * s/gnu.h: Remove file, which is now empty.
9265
c8add24e
GM
9266 * s/gnu.h, s/gnu-linux.h:
9267 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9268
b41253a3
JW
92692012-07-11 John Wiegley <johnw@newartisans.com>
9270
9271 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9272 function attribute, so we only use it if it exists in the
9273 compiler.
9274
d923b542
DA
92752012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9276
9277 Avoid call to strlen in fast_c_string_match_ignore_case.
9278 * search.c (fast_c_string_match_ignore_case): Change to use
9279 length argument. Adjust users accordingly.
9280 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9281
5ebbef1d
PE
92822012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9283
bb352260
PE
9284 Assume mkdir, rmdir.
9285 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9286 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9287
57054ddd
PE
9288 Assume rename.
9289 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9290
b747d3f7
PE
9291 Assume perror.
9292 * s/hpux10-20.h (HAVE_PERROR): Remove.
9293 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9294 Remove dummy definition, as this problem was obsolete long ago.
9295
5ebbef1d
PE
9296 Assume strerror.
9297 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9298
984e7f30
DA
92992012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9300
9301 Avoid calls to strlen in font processing functions.
9302 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
9303 (font_open_by_name): Change to use length argument.
9304 Adjust users accordingly.
d923b542
DA
9305 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9306 Adjust prototypes.
9307 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9308 Change to return ptrdiff_t.
984e7f30
DA
9309 (xfont_list_pattern, xfont_match): Use length returned by
9310 xfont_decode_coding_xlfd.
9311 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9312
20e94fdd
GM
93132012-07-11 Glenn Morris <rgm@gnu.org>
9314
9d596af3
GM
9315 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9316 Move DONT_REOPEN_PTY to configure.
9317
20e94fdd
GM
9318 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9319 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9320
e99a530f
PE
93212012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9322
22ffb973
PE
9323 Remove "#define unix" that is no longer needed (Bug#11905).
9324 * s/aix4-2.h (unix): Remove; no longer needed.
9325
e9a9ae03
PE
9326 EMACS_TIME simplification (Bug#11875).
9327 This replaces macros (which typically do not work in GDB)
9328 with functions, typedefs and enums, making the code easier to debug.
9329 The functional style also makes code easier to read and maintain.
9330 * systime.h: Include <sys/time.h> on all hosts, not just if
9331 WINDOWSNT, since 'struct timeval' is needed in general.
9332 (EMACS_TIME): Now a typedef, not a macro.
9333 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9334 not macros.
9335 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9336 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9337 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9338 (EMACS_TIME_LE): Now functions, not macros.
9339 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9340 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9341 which are not functions. All uses rewritten to use:
9342 (make_emacs_time): New function.
9343 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9344 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9345 not functions. All uses rewritten to use the following, respectively:
9346 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9347 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 9348 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
9349 * fileio.c (Fcopy_file):
9350 * xterm.c (XTflash): Get the current time closer to when it's used.
9351 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9352
ffacb126
PE
9353 * bytecode.c (targets): Suppress -Woverride-init warnings.
9354
e99a530f
PE
9355 Simplify by avoiding confusing use of strncpy etc.
9356 * doc.c (Fsnarf_documentation):
9357 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9358 * frame.c (Fmake_terminal_frame):
9359 * gtkutil.c (get_utf8_string):
9360 * lread.c (openp):
9361 * nsmenu.m (ns_update_menubar):
9362 * regex.c (regerror):
9363 Prefer memcpy to strncpy and strncat when either will do.
9364 * fileio.c (Fsubstitute_in_file_name):
9365 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9366 (menu_separator_name_p):
9367 * nsmenu.m (ns_update_menubar):
9368 Prefer memcmp to strncmp when either will do.
9369 * nsterm.m: Include <ftoastr.h>.
9370 (ns_get_color):
9371 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9372 Prefer snprintf to strncpy.
9373 * nsterm.m (ns_term_init):
9374 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9375 * nsterm.m (ns_term_init):
9376 Avoid the need for strncpy, by using build_string or
9377 make_unibyte_string directly. Use dtoastr, not snprintf.
9378 * process.c (Fmake_network_process): Diagnose service names that
9379 are too long, rather than silently truncating them or creating
9380 non-null-terminated names.
9381 (Fnetwork_interface_info): Likewise, for interface names.
9382 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9383 Prefer sprintf to strncat.
9384 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9385 Prefer vsnprintf to vsprintf + strncpy.
9386
c59592b3
GM
93872012-07-10 Glenn Morris <rgm@gnu.org>
9388
9389 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9390 Clarify fallback case.
9391
7d7bbefd
DA
93922012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9393
9394 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9395 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9396 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 9397 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
9398 where argument type is known to be a Lisp_Cons.
9399
3a4c8000
TT
94002012-07-10 Tom Tromey <tromey@redhat.com>
9401
9402 * bytecode.c (BYTE_CODE_THREADED): New macro.
9403 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9404 (enum byte_code_op): New type.
9405 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9406 (exec_byte_code): Use them. Use token threading when applicable.
9407
2a0213a6
DA
94082012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9409
9410 Optimize pure C strings initialization.
9411 * lisp.h (make_pure_string): Fix prototype.
9412 (build_pure_c_string): New function, defined as static inline. This
9413 provides a better opportunity to optimize away calls to strlen when
9414 the function is called with compile-time constant argument.
9415 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9416 argument, adjust users accordingly. Use build_pure_c_string where
9417 appropriate.
9418 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9419 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9420 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9421
cb1caeaf
DA
94222012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9423
9424 Avoid calls to strlen in miscellaneous functions.
9425 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9426 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9427 * lread.c (openp): Likewise.
9428
c293e30c
DA
94292012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9430
9431 Avoid calls to strlen in path processing functions.
9432 * fileio.c (file_name_as_directory): Add comment. Change to add
9433 srclen argument and return the length of result. Adjust users
9434 accordingly.
9435 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
9436 swap 1st and 2nd arguments to obey the common convention.
9437 Adjust users accordingly.
c293e30c
DA
9438 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9439
9e059e3f
GM
94402012-07-10 Glenn Morris <rgm@gnu.org>
9441
d02eb359
GM
9442 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9443 Move PENDING_OUTPUT_COUNT definition to configure.
9444
882cf227
GM
9445 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9446 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9447 * s/gnu.h (DATA_START): Move definitions to configure.
9448
af6e839f
GM
9449 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9450 We include usg5-4-common.h, which defines them both.
9451
40289a12
GM
9452 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9453 O_RDONLY already includes it).
9454
9e059e3f
GM
9455 Stop ns builds setting the EMACSLOADPATH environment variable.
9456 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9457 Now it does not set EMACSLOADPATH, just returns the load-path string.
9458 * nsterm.h: Update accordingly.
9459 * lread.c [HAVE_NS]: Include nsterm.h.
9460 (init_lread) [HAVE_NS]: Use ns_load_path.
9461 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9462
7c4e8ec0
GM
94632012-07-09 Glenn Morris <rgm@gnu.org>
9464
d4f600ff
GM
9465 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9466 since the included bsd-common.h does so.
9467
cbb31951
GM
9468 Stop ns builds setting the EMACSPATH environment variable.
9469 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9470 (ns_init_paths): Do not set EMACSPATH.
9471 * nsterm.h (ns_exec_path): Add it.
9472 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9473 Use ns_exec_path.
9474
7c4e8ec0
GM
9475 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9476
26bccfae
PE
94772012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9478
a0bee46f
PE
9479 * process.c (wait_reading_process_output): 'waitchannels' was unset
9480 when read_kbd || !NILP (wait_for_cell); fix this.
9481
5994c183
PE
9482 Add GCC-style 'const' attribute to functions that can use it.
9483 * character.h (char_resolve_modifier_mask):
9484 * keyboard.h (make_ctrl_char):
9485 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9486 (init_character_once, next_almost_prime, init_fns, init_image)
9487 (flush_pending_output, init_sound):
9488 * mem-limits.h (start_of_data):
9489 * menu.h (finish_menu_items):
9490 Add ATTRIBUTE_CONST.
9491 * emacs.c (DEFINE_DUMMY_FUNCTION):
9492 Declare the dummy function with ATTRIBUTE_CONST.
9493 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9494 Add decls with ATTRIBUTE_CONST.
9495
26bccfae
PE
9496 Minor improvements to make_formatted_string.
9497 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9498 where int is good enough, as vsprintf returns an int.
9499 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9500
a8290ec3
DA
95012012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9502
9503 Use make_formatted_string to avoid double length calculation.
9504 * lisp.h (make_formatted_string): New prototype.
9505 * alloc.c (make_formatted_string): New function.
9506 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 9507 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
9508 * editfns.c (Fcurrent_time_zone): Likewise.
9509 * filelock.c (get_boot_time): Likewise.
9510 * frame.c (make_terminal_frame, set_term_frame_name)
9511 (x_report_frame_params): Likewise.
9512 * image.c (gs_load): Likewise.
9513 * minibuf.c (get_minibuffer): Likewise.
9514 * msdos.c (dos_set_window_size): Likewise.
9515 * process.c (make_process): Likewise.
9516 * xdisp.c (ensure_echo_area_buffers): Likewise.
9517 * xsettings.c (apply_xft_settings): Likewise.
9518
d01ba2f1
GM
95192012-07-09 Glenn Morris <rgm@gnu.org>
9520
9521 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9522 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9523 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9524 * nsterm.h (ns_etc_directory): Add it.
9525 * callproc.c [HAVE_NS]: Include nsterm.h.
9526 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9527
f1f924b6
DA
95282012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9529
9530 Move marker debugging code under MARKER_DEBUG.
9531 * marker.c (MARKER_DEBUG): Move marker debugging code under
9532 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9533 for bootstrap with --enable-checking (~3x slowdown reported
9534 by Juanma Barranquero <lekktu@gmail.com>).
9535 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9536
ab531b66
PE
95372012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9538
9539 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9540 See <http://bugs.gnu.org/11825#29>.
9541
c4b3bc8a
EZ
95422012-07-08 Eli Zaretskii <eliz@gnu.org>
9543
9544 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9545 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
9546 (display_line): Add commentary about displaying truncation glyphs
9547 on GUI frames.
9548 (produce_special_glyphs): Move here from term.c.
9549
9550 * term.c (produce_special_glyphs): Move to xdisp.c.
9551
9552 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9553 section.
c4b3bc8a 9554
b676b881
AS
95552012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9556
f17c5273
AS
9557 * xdisp.c (display_line): Avoid warning about implicit declaration
9558 of FRAME_FONT.
9559
298819b9
AS
9560 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9561
b676b881
AS
9562 * lisp.h: Remove empty conditional.
9563
6045c4fd
PE
95642012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9565
b3350bf9
PE
9566 * lread.c (load_path_check): Now static.
9567
6045c4fd
PE
9568 Fix some minor --with-ns problems found by static checking.
9569 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9570 (x_set_font) [!HAVE_X_WINDOWS]:
9571 * image.c (xpm_load_image) [HAVE_NS]:
9572 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9573 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9574 Remove unused local.
9575 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9576 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9577 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9578 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9579 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9580 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9581 Fix pointer signedness problem.
9582 * xfaces.c (FRAME_X_FONT_TABLE):
9583 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9584
929e7845
GM
95852012-07-07 Glenn Morris <rgm@gnu.org>
9586
9587 * lread.c (load_path_check): New function, split from init_lread.
9588 (init_lread): Reorganize. Motivation:
9589 If EMACSLOADPATH is set, check/warn about that rather than the
9590 defaults, which we are not going to use. Hence we can remove
9591 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9592 Don't warn if site-lisp directories are missing.
9593 If not installed, start from a blank load-path, since
9594 PATH_LOADSEARCH refers to the eventual installation directories.
9595
58dd0aa4
EZ
95962012-07-07 Eli Zaretskii <eliz@gnu.org>
9597
9598 Support truncation and continuation glyphs on GUI frames, when
9599 fringes are disabled. (Bug#11832)
9600 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
9601 continuation glyphs even if on GUI frames.
9602 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
9603 or both, are absent.
9604 (start_display, move_it_in_display_line_to): Handle the case of a
9605 GUI frame without a fringe to display continuation or truncation
9606 glyphs.
9607 (insert_left_trunc_glyphs): Support GUI frames: make sure
9608 truncation glyphs overwrite enough glyphs from the current line to
9609 have sufficient space in pixels.
9610 (display_line): Support truncation and continuation glyphs on GUI
9611 frames. If some spare pixels are left on the line after inserting
9612 the truncation glyphs, fill that space with a stretch glyph of a
9613 suitably computed width.
9614
9615 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9616 produce_glyphs, to support GUI sessions.
9617
31571fd7
PE
96182012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9619
5a16b9bc
PE
9620 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9621
f3047c75
PE
9622 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9623
31571fd7
PE
9624 Do not require float-time's arg to fit in time_t (Bug#11825).
9625 This works better on hosts where time_t is unsigned, and where
9626 float-time is applied to the (negative) difference between two times.
9627 * editfns.c (decode_time_components): Last arg is now double *,
9628 not int *, and means to store all the result as a double, without
9629 worrying about whether the seconds part fits in time_t.
9630 All callers changed.
9631 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9632 All callers changed.
9633 (Ffloat_time): Do not fail merely because the specified time falls
9634 outside of time_t range.
9635
4516fbef
GM
96362012-07-07 Glenn Morris <rgm@gnu.org>
9637
9638 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9639 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9640 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9641
07adc2c6
JB
96422012-07-07 Juanma Barranquero <lekktu@gmail.com>
9643
9644 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9645 Update dependencies.
9646
9647 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9648
fd573f31
PE
96492012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9650
fee5959d
PE
9651 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9652 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9653 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9654 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9655 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9656 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9657
fd573f31
PE
9658 * xfont.c (compare_font_names): Redo to omit the need for casts.
9659
ddadbc0e
AS
96602012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9661
fca8d6b6
AS
9662 * xfns.c (Fx_change_window_property): Doc fix.
9663 * w32fns.c (Fx_change_window_property): Doc fix.
9664
ddadbc0e
AS
9665 * w32fns.c (Fx_window_property): Accept the same arguments as the
9666 X Windows version. Doc fix.
9667 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9668
ed9265fc 96692012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
9670 Eli Zaretskii <eliz@gnu.org>
9671
9672 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9673 Windows-specific code from nt/config.nt moved here.
9674 Obsolete settings removed.
9675
216ee680
PE
96762012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9677
9678 * process.c: Avoid unnecessary calls to gettime.
9679 (wait_reading_process_output): Don't get the time of day
9680 when gobbling data immediately and not waiting, as there's no need
9681 for it in that case. This removes a FIXME.
9682
bdd091e4
JD
96832012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9684
9685 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9686 is defined (Bug#11768).
9687
9d44f8ce
DA
96882012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9689
9690 Fix marker debugging code.
9691 * marker.c (byte_char_debug_check): Do not perform the check
9692 if buffer is not multibyte.
090bd7cb
JB
9693 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9694 Call byte_char_debug_check with correct arguments.
9d44f8ce 9695
90fc4786
DA
96962012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9697
9698 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
9699 * marker.c (byte_char_debug_check, count_markers):
9700 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
9701 (byte_debug_flag): Remove.
9702 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9703 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9704
7b7ae965
DA
97052012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9706
4e57b342
DA
9707 Avoid code repetition in marker-related functions.
9708 * marker.c (attach_marker): New function.
9709 (Fset_marker, set_marker_restricted, set_marker_both)
9710 (set_marker_restricted_both): Use it.
9711 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9712 Consistently rename charno to charpos.
9713 (marker_position): Add eassert.
9714 (marker_byte_position): Convert to eassert.
9715
97162012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9717
9718 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 9719 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 9720 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 9721
657924ff
DA
97222012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9723
9724 Introduce fast path for the widely used marker operation.
9725 * alloc.c (build_marker): New function.
9726 * lisp.h (build_marker): New prototype.
9727 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9728 * composite.c (autocmp_chars): Likewise.
9729 * editfns.c (buildmark): Remove.
9730 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9731 (save_restriction_save): Use build_marker.
9732 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9733 * window.c (save_window_save): Likewise.
9734
041a49a6
DA
97352012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9736
9737 Do not use Fdelete_overlay in delete_all_overlays
9738 to avoid redundant calls to unchain_overlay.
9739 * buffer.c (drop_overlay): New function.
9740 (delete_all_overlays, Fdelete_overlay): Use it.
9741 * minibuf.c (get_minibuffer): Fix comment.
9742
7dca65a4
PE
97432012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9744
9745 Port to OpenBSD 5.1 amd64.
9746 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9747 This is needed for OpenBSD, and should be harmless on all BSD systems.
9748 Also, include <sys/sysctl.h>, as it should be available on all
9749 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9750 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9751 use p_pid member, not kp_proc.pid.
9752
8eb876e2
GM
97532012-07-06 Glenn Morris <rgm@gnu.org>
9754
9755 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
9756
38182d90
PE
97572012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9758
9759 More xmalloc and related cleanup.
9760 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
9761 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
9762 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
9763 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
9764 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
9765 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
9766 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
9767 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
9768 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
9769 * xterm.c:
9770 Omit needless casts involving void * pointers and allocation.
9771 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
9772 as the former is more robust if P's type is changed.
9773 Prefer xzalloc to xmalloc + memset 0.
9774 Simplify malloc-or-realloc to realloc.
9775 Don't worry about xmalloc returning a null pointer.
9776 Prefer xstrdup to xmalloc + strcpy.
9777 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
9778 growing it.
9779 * keyboard.c (apply_modifiers_uncached): Prefer local array to
9780 alloca of a constant.
9781
6dd5a677
EZ
97822012-07-05 Eli Zaretskii <eliz@gnu.org>
9783
9784 * xdisp.c (display_line): Fix horizontal pixel coordinates when
9785 hscroll is larger than the line width. Fixes long and futile
9786 looping inside extend_face_to_end_of_line (on a TTY) producing
9787 glyphs that are not needed and thrown away.
9788
6b312f0f
DA
97892012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9790
9791 * marker.c (set_marker_restricted_both): Simplify by using
9792 clip_to_bounds.
9793
f520ef9b
PE
97942012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9795
9796 * editfns.c (region_limit): Simplify by using clip_to_bounds.
9797
383b7c95
JD
97982012-07-05 Jan Djärv <jan.h.d@swipnet.se>
9799
9800 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
9801 not defined (Bug#11768).
9802 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
9803 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
9804 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
9805 followed by gtk_box_set_homogeneous (Bug#11768).
9806 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
9807 (update_theme_scrollbar_width, xg_create_scroll_bar):
9808 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
9809 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
9810 (is_box_type): New function (Bug#11768).
9811 (xg_tool_item_stale_p): Call is_box_type.
5293d758 9812 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
9813 with default display (Bug#11768).
9814
d6e7bf45
EZ
98152012-07-05 Eli Zaretskii <eliz@gnu.org>
9816
9817 * xdisp.c (window_hscroll_limited): New function.
9818 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
9819 coordinates when window's hscroll is set to insanely large
9820 values. (Bug#11857)
9821
431391ec
JB
98222012-07-05 Juanma Barranquero <lekktu@gmail.com>
9823
9824 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
9825 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
9826
23f86fce
DA
98272012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9828
9829 Cleanup xmalloc.
9830 * lisp.h (xzalloc): New prototype. Omit needless casts.
9831 * alloc.c (xzalloc): New function. Omit needless casts.
9832 * charset.c: Omit needless casts. Convert all calls to
9833 xmalloc with following memset to xzalloc.
9834 * dispnew.c: Likewise.
9835 * fringe.c: Likewise.
9836 * image.c: Likewise.
9837 * sound.c: Likewise.
9838 * term.c: Likewise.
9839 * w32fns.c: Likewise.
9840 * w32font.c: Likewise.
9841 * w32term.c: Likewise.
9842 * xfaces.c: Likewise.
9843 * xfns.c: Likewise.
9844 * xterm.c: Likewise.
9845 * atimer.c: Omit needless casts.
9846 * buffer.c: Likewise.
9847 * callproc.c: Likewise.
9848 * ccl.c: Likewise.
9849 * coding.c: Likewise.
9850 * composite.c: Likewise.
9851 * doc.c: Likewise.
9852 * doprnt.c: Likewise.
9853 * editfns.c: Likewise.
9854 * emacs.c: Likewise.
9855 * eval.c: Likewise.
9856 * filelock.c: Likewise.
9857 * fns.c: Likewise.
9858 * gtkutil.c: Likewise.
9859 * keyboard.c: Likewise.
9860 * lisp.h: Likewise.
9861 * lread.c: Likewise.
9862 * minibuf.c: Likewise.
9863 * msdos.c: Likewise.
9864 * print.c: Likewise.
9865 * process.c: Likewise.
9866 * region-cache.c: Likewise.
9867 * search.c: Likewise.
9868 * sysdep.c: Likewise.
9869 * termcap.c: Likewise.
9870 * terminal.c: Likewise.
9871 * tparam.c: Likewise.
9872 * w16select.c: Likewise.
9873 * w32.c: Likewise.
9874 * w32reg.c: Likewise.
9875 * w32select.c: Likewise.
9876 * w32uniscribe.c: Likewise.
9877 * widget.c: Likewise.
9878 * xdisp.c: Likewise.
9879 * xmenu.c: Likewise.
9880 * xrdb.c: Likewise.
9881 * xselect.c: Likewise.
9882
0497dc44
PE
98832012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9884
9885 * fileio.c (time_error_value): Check the right error number.
9886 Problem reported by Troels Nielsen in
9887 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9888
356e7178
PE
98892012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9890
4e71fd89
PE
9891 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9892 This should be fixed in a better way; see Eli Zaretskii in
9893 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9894 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9895
f0941253
PE
9896 * fileio.c (time_error_value): Rename from special_mtime.
9897 The old name's problems were noted by Eli Zaretskii in
9898 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
9899
065c9eb4
PE
9900 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
9901 This variable's comment says Emacs needs at least one GDB-visible
9902 symbol of type enum pvec_type, to work around GDB problems.
9903 The symbol's value doesn't matter.
9904
356e7178
PE
9905 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
9906 that causes compilation to fail on pre-C99 compilers.
9907
ed9265fc 99082012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
9909
9910 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
9911 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
9912
3884d954
DA
99132012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9914
d209e2fb 9915 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
9916 headers for buffer_defaults and buffer_local_symbols.
9917 Reported by Juanma Barranquero <lekktu@gmail.com>.
9918
ee28be33
SM
99192012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9920
9921 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
9922 * lisp.h (enum pvec_type): Use fewer bits.
9923 (PSEUDOVECTOR_SIZE_BITS): New constant.
9924 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
9925 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
9926 change in pvec_type.
9927 (PSEUDOVECTOR_TYPEP): New macro.
9928 (TYPED_PSEUDOVECTORP): Use it.
9929 * fns.c (internal_equal): Adapt code to extract pvectype.
9930 * emacs.c (gdb_pvec_type): Update type.
9931 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
9932 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
9933 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
9934 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
9935 (sweep_vectors): Use it. Use local var `total_bytes' instead of
9936 abusing vector->header.next.nbytes.
9937 (live_vector_p): Use PVEC_TYPE.
9938 (mark_object): Adapt code to extract pvectype. Use switch.
9939
c7f2cd7f
PE
99402012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9941
9942 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
9943 Tighten new eassert a bit.
9944
8ce70ed2
DA
99452012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9946
9947 Fix compilation with --enable-gcc-warnings and -O1
9948 optimization level.
9949 * doprnt.c (doprnt): Change type of tem to int, initialize
9950 to avoid compiler warning. Add eassert.
9951 * search.c (simple_search): Initialize match_byte to avoid
9952 compiler warning. Add eassert.
9953
dea7f1e5
PE
99542012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9955
24a212eb
PE
9956 Avoid weird behavior with large horizontal scrolls.
9957 Without this change, for example, large hscroll values would
9958 mess up Emacs's display on Fedora 15 x86, presumably due to
9959 overflows in int calculations in the display code.
9960 Also, if buffers had long lines, Emacs would freeze.
9961 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
9962 (set_window_hscroll): New function, containing the old guts of
9963 Fset_window_hscroll. Return the clipped value.
9964 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
9965 This avoids the need to check against PTRDIFF_MAX.
9966
dea7f1e5
PE
9967 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
9968
76046526
DA
99692012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9970
9971 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
9972
39adff0d
PE
99732012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9974
63807d47
PE
9975 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
9976 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
9977 since GCC 4.4.6 issues a bogus warning for them.
9978
39adff0d
PE
9979 Fix bugs in file timestamp newness comparisons.
9980 * fileio.c (Ffile_newer_than_file_p):
9981 * lread.c (Fload): Use full timestamp resolution of files,
9982 not just the 1-second resolution, so that files that are only
9983 slightly newer still count as newer.
9984 * fileio.c (Ffile_newer_than_file_p): Don't assume file
9985 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
9986
dbeed9a6
PE
99872012-07-03 Paul Eggert <eggert@cs.ucla.edu>
9988
9989 * fileio.c: Improve handling of file time marker. (Bug#11852)
9990 (special_mtime): New function.
9991 (Finsert_file_contents, Fverify_visited_file_modtime):
9992 Use it to set special mtime values consistently.
9993
636334d6
AS
99942012-07-03 Andreas Schwab <schwab@linux-m68k.org>
9995
9996 * fileio.c (Finsert_file_contents): Properly handle st_mtime
9997 marker for non-existing file. (Bug#11852)
9998
e2017fe2
GM
99992012-07-03 Glenn Morris <rgm@gnu.org>
10000
10001 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10002 and did not make it into globals.h).
10003
404dbd37
TT
100042012-07-03 Tom Tromey <tromey@redhat.com>
10005
10006 * window.c (Fset_window_margins, Fset_window_fringes)
10007 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10008 * textprop.c (Fprevious_property_change): No longer static.
10009 * syntax.c (Fsyntax_table_p): No longer static.
10010 * process.c (Fget_process, Fprocess_datagram_address): No longer
10011 static.
10012 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10013 * keyboard.c (Fcommand_execute): No longer static.
10014 Remove EXFUN.
10015 * insdel.c (Fcombine_after_change_execute): No longer static.
10016 * image.c (Finit_image_library): No longer static.
10017 * fileio.c (Fmake_symbolic_link): No longer static.
10018 * eval.c (Ffetch_bytecode): No longer static.
10019 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
10020 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10021 No longer static.
404dbd37
TT
10022 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10023 static.
10024 * dired.c (Ffile_attributes): No longer static.
10025 * composite.c (Fcomposition_get_gstring): No longer static.
10026 * callproc.c (Fgetenv_internal): No longer static.
10027
10028 * ccl.h: Remove EXFUNs.
10029 * buffer.h: Remove EXFUNs.
10030 * dispextern.h: Remove EXFUNs.
10031 * intervals.h: Remove EXFUNs.
10032 * fontset.h: Remove EXFUN.
10033 * font.h: Remove EXFUNs.
10034 * dosfns.c (system_process_attributes): Remove EXFUN.
10035 * keymap.h: Remove EXFUNs.
10036 * lisp.h: Remove EXFUNs.
10037 * w32term.h: Remove EXFUNs.
10038 * window.h: Remove EXFUNs.
10039 * xsettings.h: Remove EXFUN.
10040 * xterm.h: Remove EXFUN.
10041
8e4fd1e1
GM
100422012-07-03 Glenn Morris <rgm@gnu.org>
10043
10044 * lisp.h (Frandom): Make it visible to C.
10045 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10046 buffer for invisible buffers. (Bug#1229)
10047
ca95b3eb
DA
100482012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10049
10050 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10051 values which aren't power of 2.
14ae4239 10052 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 10053 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
10054 accordingly.
10055
7555c33f
SM
100562012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10057
10058 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10059
10060 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10061
d12e8f5a
DA
100622012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10063
10064 * alloc.c (allocate_vector_block): Remove redundant
10065 calls to mallopt if DOUG_LEA_MALLOC is defined.
10066 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10067 avoid calls to mallopt if zero_vector is returned.
10068
296094c3
DA
100692012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10070
10071 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10072 is enabled, avoid dereferencing NULL current_sblock if
10073 running undumped.
10074
36429c89
DA
100752012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10076
10077 Cleanup basic buffer management.
10078 * buffer.h (struct buffer): Change layout to use generic vector
10079 marking code. Fix some comments. Change type of 'clip_changed'
10080 to bitfield. Remove unused #ifndef old.
10081 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10082 (GET_OVERLAYS_AT): Fix indentation.
10083 (for_each_per_buffer_object_at): New macro.
10084 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10085 (Fbuffer_local_variables): Use it.
10086 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10087 * alloc.c (allocate_buffer): Adjust to match new layout of
10088 struct buffer. Fix comment.
10089 (mark_overlay): New function.
10090 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10091 Lisp area of struct buffer.
10092 (mark_object): Use it. Adjust marking of misc objects
10093 and related comments.
10094
3b3e4cac
PE
100952012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10096
10097 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10098 wrapper that is not needed because the wrapped code is a no-op (zero
10099 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10100 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10101
cf5c0175
DA
101022012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10103
10104 * alloc.c (mark_buffer): Simplify. Remove prototype.
10105 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 10106 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
10107 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10108 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 10109
ca26824c
GM
101102012-06-30 Glenn Morris <rgm@gnu.org>
10111
2e4c5312
GM
10112 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10113
ca26824c
GM
10114 * epaths.in (PATH_SITELOADSEARCH): New.
10115 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10116 This is rather than relying on --enable-locallisppath elements
10117 having "site-lisp" in their names. (Bug#10208#25, 11658)
10118
0d23c240
EZ
101192012-06-30 Eli Zaretskii <eliz@gnu.org>
10120
c9240d7a
EZ
10121 * w32proc.c (sys_select): Accept and ignore one more argument.
10122
10123 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10124
0d23c240 10125 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 10126 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
10127
10128 * sysdep.c: Don't include dos.h and dosfns.h.
10129
10130 * process.c (sys_select):
10131 * msdos.c (sys_select): Accept one more argument and ignore it.
10132
10133 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10134 adapt data types and code to that.
10135
10136 * dosfns.c:
10137 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10138 which clashes with the gnulib function of the same name.
10139
af5a5a98
AS
101402012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10141
c5e4379c
AS
10142 * font.c (font_style_to_value, font_style_symbolic)
10143 (font_prop_validate_style): Add type checks for values in
10144 font_style_table.
10145
af5a5a98
AS
10146 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10147 argument.
10148 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10149 uses.
10150
8d38f461
EZ
101512012-06-29 Eli Zaretskii <eliz@gnu.org>
10152
2e5a6631
EZ
10153 * xdisp.c (try_window_id): Undo last change.
10154
8d38f461
EZ
10155 * w32.c (getwd): Adjust commentary about startup_dir.
10156 (init_environment): Always call sys_access, even in non-MSVC
10157 builds. Don't chdir to the directory of the Emacs executable.
10158 This undoes code from 1997 which was justified by the need to
10159 "avoid conflicts when removing and renaming directories". But its
10160 downside was that every relative file name was being interpreted
10161 relative to the directory of the Emacs executable, which can never
10162 be TRT. In particular, it broke sys_access when called with
10163 relative file names.
10164 (sys_access): Map GetLastError to errno.
10165
2af3565e
DA
101662012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10167
10168 * window.h (struct window): Change type of 'fringes_outside_margins'
10169 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 10170 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
10171 Adjust comment.
10172 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10173 to ptrdiff_t.
10174
c8d3a25c 101752012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 10176
c8d3a25c
GM
10177 * gnutls.c (emacs_gnutls_handshake):
10178 Add QUIT to make the loop interruptible.
57570cd3 10179
c8d3a25c 101802012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 10181
c8d3a25c
GM
10182 * charset.c (init_charset): Make lack of etc/charsets fatal.
10183
3e984ee8
DA
101842012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10185
10186 * editfns.c (region_limit): Fix type mismatch.
10187
ef884f23
DA
101882012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10189
10190 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10191 undefined. Convert from xassert to eassert.
10192 * nsmenu.m: Convert from xassert to eassert.
10193 * nsterm.m: Likewise.
10194
7d7e0027
SM
101952012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10196
10197 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10198
aa754e6a
PE
101992012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10200
10201 Avoid integer overflow on scroll-left and scroll-right.
10202 * window.c (HSCROLL_MAX): New macro.
10203 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10204 overflow when requested scroll falls outside ptrdiff_t range.
10205
80b00b08
DA
102062012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10207
10208 * window.h (struct window): Change type of 'hscroll',
10209 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10210 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10211 Adjust users accordingly.
10212 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10213 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10214 from EMACS_INT to ptrdiff_t.
10215 (make_window): Omit redundant initialization.
10216
62b2bcf6
JB
102172012-06-28 Juanma Barranquero <lekktu@gmail.com>
10218
10219 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10220
45942c7d
DA
102212012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10222
10223 * window.h (struct window): Change type of 'use_time' and
10224 'sequence_number' from Lisp_Object to int.
10225 * frame.c (make_frame): Adjust users accordingly.
10226 * print.c (print_object): Likewise.
10227 * window.c (select_window, Fwindow_use_time, make_parent_window)
10228 (make_window): Likewise.
10229
e509cfa6
DA
102302012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10231
10232 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10233 enabled with --enable-checking=[all,glyphs] configure option.
10234 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10235 adjust comments accordingly.
10236 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10237 undefined, adjust comments accordingly.
10238 * image.c: Likewise.
10239 * scroll.c: Likewise.
10240 * w32fns.c: Likewise.
10241 * w32term.c: Likewise.
10242 * xdisp.c: Likewise.
10243 * xfaces.c: Likewise.
10244 * xfns.c: Likewise.
10245 * xterm.c: Likewise.
10246
a54e2c05
DA
102472012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10248
10249 Generalize run-time debugging checks.
10250 * dispextern.h (XASSERTS): Remove.
10251 * fontset.c (xassert): Remove.
10252 Convert from xassert to eassert.
10253 * alloc.c: Convert from xassert to eassert.
10254 * bidi.c: Likewise.
10255 * dispnew.c: Likewise.
10256 * fns.c: Likewise.
10257 * fringe.c: Likewise.
10258 * ftfont.c: Likewise.
10259 * gtkutil.c: Likewise.
10260 * image.c: Likewise.
10261 * keyboard.c: Likewise.
10262 * menu.c: Likewise.
10263 * process.c: Likewise.
10264 * scroll.c: Likewise.
10265 * sound.c: Likewise.
10266 * term.c: Likewise.
10267 * w32console.c: Likewise.
10268 * w32fns.c: Likewise.
10269 * w32term.c: Likewise.
10270 * window.c: Likewise.
10271 * xdisp.c: Likewise.
10272 * xfaces.c: Likewise.
10273 * xfns.c: Likewise.
10274 * xselect.c: Likewise.
10275 * xterm.c: Likewise.
10276
1ec4b7b2
SM
102772012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10278
10279 * fns.c (maybe_resize_hash_table): Output message when growing the
10280 purify-hashtable.
10281
2014308a
DA
102822012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10283
10284 * alloc.c (allocate_string_data): Remove dead code.
10285 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10286 avoid GCC warning about unused macro.
10287
246155eb
DA
102882012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10289
10290 * alloc.c (allocate_string): Omit intervals initialization.
10291 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10292 as in make_pure_string and make_pure_c_string.
10293
43184b7b
DA
102942012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10295
d209e2fb 10296 * alloc.c (allocate_string): Fix last change.
43184b7b 10297
3fe6dd74
DA
102982012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10299
d209e2fb 10300 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
10301 to memset, add explicit initialization where appropriate.
10302
1ba6038a
GM
103032012-06-27 Glenn Morris <rgm@gnu.org>
10304
10305 * lisp.mk (lisp): Remove paths.elc.
10306
c89926a5
CY
103072012-06-27 Chong Yidong <cyd@gnu.org>
10308
10309 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10310
ed6b3510
JW
103112012-06-26 John Wiegley <johnw@newartisans.com>
10312
1ec4b7b2 10313 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
10314 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10315
ed6b3510
JW
10316 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10317 when building with Clang.
10318
8edd4a2b
SM
103192012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10320
10321 * eval.c (Fapply): Allow calling it with a single argument.
10322
f6f62d1b
EZ
103232012-06-26 Eli Zaretskii <eliz@gnu.org>
10324
10325 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10326 _stricmp and _strnicmp.
10327 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10328
62efea5e
DA
103292012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10330
10331 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10332 allocated window.
10333 (allocate_process): Likewise for new process.
8edd4a2b 10334 (allocate_terminal): Change to use offsetof.
62efea5e
DA
10335 (allocate_frame): Likewise.
10336 * frame.c (make_frame): Omit redundant initialization.
10337 * window.c (make_parent_window): Use memset.
10338 (make_window): Omit redundant initialization.
10339 * process.c (make_process): Omit redundant initialization.
10340 * terminal.c (create_terminal): Likewise.
10341
42997f4d
DA
103422012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10343
10344 * term.c (delete_tty): Remove redundant call to memset.
10345
1130ecfc
DA
103462012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10347
10348 * alloc.c: Remove build_string.
10349 * lisp.h: Define build_string as static inline. This provides
10350 a better opportunity to optimize away calls to strlen when the
10351 function is called with compile-time constant argument.
10352 * image.c (imagemagick_error): Convert to build_string.
10353 * w32proc.c (sys_spawnve): Likewise.
10354 * xterm.c (x_term_init): Likewise.
10355
cf38a720
PE
103562012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10357
99027bdd
PE
10358 Use sprintf return value instead of invoking strlen on result.
10359 In the old days this wasn't portable, since some sprintf
10360 implementations returned char *. But they died out years ago and
10361 Emacs already assumes sprintf returns int.
10362 Similarly for float_to_string.
10363 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10364 * ccl.c (ccl_driver):
10365 * character.c (string_escape_byte8):
10366 * data.c (Fnumber_to_string):
10367 * doprnt.c (doprnt):
10368 * print.c (print_object):
10369 * xdisp.c (message_dolog):
10370 * xfns.c (syms_of_xfns):
10371 Use sprintf or float_to_string result to avoid need to call strlen.
10372 * data.c (Fnumber_to_string):
10373 Use make_unibyte_string, since the string must be ASCII.
10374 * lisp.h, print.c (float_to_string): Now returns int length.
10375 * term.c (produce_glyphless_glyph):
10376 Use sprintf result rather than recomputing it.
10377
cf38a720
PE
10378 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10379 * Makefile.in (ALL_CFLAGS):
10380 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10381 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10382
3511c784
DA
103832012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10384
0a08eb21 10385 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
10386 strcasecmp if available.
10387 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10388
fb7da12e
AS
103892012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10390
10391 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10392 Avoid comma operator.
10393 * menu.c (push_submenu_start, push_submenu_end)
10394 (push_left_right_boundary, push_menu_pane): Likewise.
10395 * msdos.c (dos_rawgetc): Likewise.
10396
afa2ffd8
DA
103972012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10398
10399 * xfns.c (xic_create_fontsetname): Remove redundant calls
10400 to memset.
10401
b3b4476b
PE
104022012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10403
4495ff38
PE
10404 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10405 sprintf already null-terminates its output.
10406
b3b4476b
PE
10407 * xfns.c (x_window): Remove redundant cast.
10408
b00876c9
DA
104092012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10410
10411 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10412 `const char *' to `char *' to avoid compiler warning.
10413
d188e26b
PE
104142012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10415
885d1d74
PE
10416 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10417 instead of truncating it to 63 (admittedly a generous limit).
10418
d188e26b
PE
10419 * process.c: Fix spelling and caps in comments.
10420
e2f560b1
DN
104212012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10422
e86db54b 10423 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
10424 * sysdep.c (setpgrp): Remove definition, not used in this file.
10425
7583a3a1
JB
104262012-06-24 Juanma Barranquero <lekktu@gmail.com>
10427
10428 * makefile.w32-in: Update dependencies.
10429
696056c2
EZ
104302012-06-24 Eli Zaretskii <eliz@gnu.org>
10431
10432 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10433 (SYSTIME_H): Add nt/inc/sys/time.h.
10434
10435 * systime.h [WINDOWSNT]: Include sys/time.h.
10436
10437 * s/ms-w32.h (struct timespec): Definition moved from
10438 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10439
845ca893
PE
104402012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10441
10442 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10443 * buffer.h (buffer_slot_type_mismatch):
10444 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10445 * eval.c (unwind_to_catch):
10446 * image.c (my_png_error, my_error_exit):
10447 * keyboard.c (quit_throw_to_read_char, user_error)
10448 (Fexit_recursive_edit, Fabort_recursive_edit):
10449 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10450 (wrong_type_argument, buffer_overflow, __executable_start)
10451 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10452 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10453 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10454 (fatal):
10455 (child_setup) [!DOS_NT]:
10456 * lread.c (end_of_file_error, invalid_syntax):
10457 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10458 * puresize.h (pure_write_error):
10459 * search.c (matcher_overflow):
10460 * sound.c (sound_perror, alsa_sound_perror):
10461 * sysdep.c, syssignal.h (croak):
10462 * term.c (maybe_fatal, vfatal):
10463 * textprop.c (text_read_only):
10464 * undo.c (user_error):
10465 * unexmacosx.c (unexec_error):
10466 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10467 Use _Noreturn rather than NO_RETURN.
10468 No need for separate decl merely because of _Noreturn.
10469 * sound.c (sound_warning, parse_sound):
10470 Remove unnecessary forward decls.
10471
f1dd8073
PE
104722012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10473
10474 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10475 * lisp.h (WAIT_READING_MAX): New macro.
10476 * dispnew.c (Fsleep_for, sit_for):
10477 * keyboard.c (kbd_buffer_get_event):
10478 * process.c (Faccept_process_output):
10479 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10480 This improves on the previous patch, which introduced a bug
10481 when time_t is unsigned and as wide as intmax_t.
10482 See <http://bugs.gnu.org/9000#51>.
10483
b82c1755
EZ
104842012-06-23 Eli Zaretskii <eliz@gnu.org>
10485
10486 * dispnew.c (sit_for, Fsleep_for):
10487 * keyboard.c (kbd_buffer_get_event):
10488 * process.c (Faccept_process_output): Avoid compiler warnings when
10489 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10490
ca300656
JB
104912012-06-23 Juanma Barranquero <lekktu@gmail.com>
10492
049ec95b
JB
10493 * makefile.w32-in: Update dependencies.
10494
ca300656
JB
10495 * w32.c (ltime): Add return type and declare static.
10496 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10497
db7b8d06
PE
104982012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10499
10500 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10501 Privately reported by Herbert J. Skuhra.
10502 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10503 All uses changed.
10504 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10505 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10506
0bd8297f
EZ
105072012-06-23 Eli Zaretskii <eliz@gnu.org>
10508
96512555
EZ
10509 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10510 last argument of make_unibyte_string.
10511
0bd8297f
EZ
10512 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10513 language ID in the event parameters.
10514
10515 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10516 event.code, not the obscure "character set ID".
10517
63def6b6
CY
105182012-06-23 Chong Yidong <cyd@gnu.org>
10519
10520 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10521
e8a02204
EZ
105222012-06-23 Eli Zaretskii <eliz@gnu.org>
10523
388cdec0
EZ
10524 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10525 * w32.c (fdutimens): New function.
10526
10527 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10528
10529 * s/ms-w32.h (pselect): Redirect to sys_select.
10530
10531 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10532
e8a02204
EZ
10533 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10534 in the logic of incrementing and decrementing the value of
10535 use_relocatable_buffers.
10536
d054f3fb
PE
105372012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10538
10539 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10540 Privately reported by Herbert J. Skuhra.
10541 [__FreeBSD__]: Remove "*/" typo after "#include".
10542 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10543 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10544 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10545 Don't assume EMACS_TIME and struct timeval are the same type.
10546
d35af63c
PE
105472012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10548
10549 Support higher-resolution time stamps (Bug#9000).
10550 The time stamps are only nanosecond-resolution at the C level,
10551 since that's the best that any real-world system supports now.
10552 But they are picosecond-resolution at the Lisp level, as that's
10553 easy, and leaves room for future OS improvements.
10554
10555 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10556 (LIBES): Use it.
10557
10558 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10559 Don't get current time unless it's needed.
10560
10561 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10562 now provides it if it's absent.
10563 (start_atimer): Port to higher-res time stamps.
10564 Check for time stamp overflow. Don't get current time more
10565 often than is needed.
10566
10567 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10568 Include systime.h, not time.h.
10569 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10570
10571 * dired.c: Include stat-time.h.
10572 (Ffile-attributes): File times now have higher resolution.
10573
10574 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10575 (struct image): Timestamp now has higher resolution.
10576
10577 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10578 has at least microseconds now. All uses removed.
10579 (update_frame, update_single_window, update_window, update_frame_1)
10580 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 10581 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
10582
10583 * editfns.c (time_overflow): Now extern.
10584 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10585 (float-time, Fformat_time_string, Fcurrent_time_string)
10586 (Fcurrent_time_zone): Accept and generate higher-resolution
10587 time stamps.
10588 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10589 (decode_time_components, lisp_seconds_argument): New functions.
10590 (make_time): Now static.
10591 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10592 Report an error if the time is invalid, rather than having the caller
10593 do that.
10594
10595 * fileio.c: Include <stat-time.h>
10596 (Fcopy_file): Copy higher-resolution time stamps.
10597 Prefer to set the time stamp via a file descriptor if that works.
10598 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10599 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10600 (Fvisited_file_modtime, Fset_visited_file_modtime):
10601 Support higher-resolution time stamps.
10602
10603 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10604
10605 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10606
10607 * image.c (prepare_image_for_display, clear_image_cache)
10608 (lookup_image): Port to higer-resolution time stamps.
10609
10610 * keyboard.c (start_polling, bind_polling_period):
10611 Check for time stamp overflow.
10612 (read_char, kbd_buffer_get_event, timer_start_idle)
10613 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10614 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10615 Port to higher-resolution time stamps. Do not assume time_t is signed.
10616 (decode_timer): New function. Timers are now vectors of length 9,
10617 not 8, to accommodate the picosecond component.
10618 (timer_check_2): Use it.
10619
10620 * nsterm.m (select_timeout, timeval_subtract): Remove.
10621 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10622 as they're a bit more accurate and handle overflow better.
10623 (ns_select): Change prototype to be compatible with pselect.
10624 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10625 * nsterm.h (ns_select): Adjust prototype.
10626
10627 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10628 us-resolution time stamps.
10629 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10630
10631 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10632
10633 * lisp.h (time_overflow): New decl.
10634 (wait_reading_process_output): First arg is now intmax_t, not int,
10635 to accommodate larger waits.
10636
10637 * process.h (struct Lisp_Process.read_output_delay):
10638 Now counts nanoseconds, not microseconds.
10639 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10640 EMACS_HAS_USECS.
10641 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10642 (wait_reading_process_output):
10643 Port to ns-resolution time stamps.
10644 (Faccept_process_output, wait_reading_process_output):
10645 Check for time stamp overflow. Do not assume time_t is signed.
10646 (select_wrapper): Remove; we now use pselect.
10647 (Fprocess_attributes): Now generates ns-resolution time stamps.
10648
10649 * sysdep.c: Include utimens.h. Don't include utime.h
10650 or worry about struct utimbuf; gnulib does that for us now.
10651 (gettimeofday): Remove; gnulib provides a substitute.
10652 (make_timeval): New function.
10653 (set_file_times): Now sets ns-resolution time stamps.
10654 New arg FD; all uses changed.
10655 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10656 (system_process_attributes):
10657 Now returns ns-resolution time stamp. All uses changed.
10658 Check for time stamp overflow.
10659
10660 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10661 provides a substitute now.
10662
10663 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10664 since it guarantees struct timespec.
10665 (EMACS_TIME): Now struct timespec, so that we can support
10666 ns-resolution time stamps.
10667 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10668 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10669 (EMACS_USECS): Remove.
10670 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10671 so multiply the arg by 1000 before storing it.
10672 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10673 New macros.
10674 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10675 Port to ns-resolution time stamps.
10676 (EMACS_TIME_NEG_P): Remove; replaced by....
10677 (EMACS_TIME_SIGN): New macro.
10678 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10679 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10680 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10681 (make_timeval, make_lisp_time, decode_time_components): New decls.
10682 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10683 that it mishandled time_t overflow. You can't compare by subtracting!
10684 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10685 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10686
10687 * term.c: Include <sys/time.h>.
10688 (timeval_to_Time): New function, for proper overflow wraparound.
10689 (term_mouse_position, term_mouse_click): Use it.
10690
10691 * undo.c (record_first_change): Support higher-resolution time stamps
10692 in the undo buffer.
10693 (Fprimitive_undo): Use them when restoring time stamps.
10694
10695 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10696 (w32_get_internal_run_time):
10697 Port to higher-resolution Emacs time stamps.
10698 (ltime): Now accepts single 64-bit integer, as that's more convenient
10699 for callers.
10700
10701 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10702
10703 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10704 for compatibility with pselect. Support ns-resolution time stamps.
10705
10706 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10707
10708 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10709 Check for time stamp overflow, and support ns-resolution time stamps.
10710
10711 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10712 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10713 (timeval_subtract): Remove; no longer needed.
10714 (XTflash, XTring_bell, x_wait_for_event):
10715 Port to ns-resolution time stamps. Don't assume time_t is signed.
10716
b6a92dfe
CY
107172012-06-22 Chong Yidong <cyd@gnu.org>
10718
10719 * xdisp.c (x_consider_frame_title): Revert last change.
10720
d251c37c
EZ
107212012-06-22 Eli Zaretskii <eliz@gnu.org>
10722
10723 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10724 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10725 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10726 staticidx goes up to 1597 out of 1600 = 0x640.)
10727
f10deafb
PE
107282012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10729
10730 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10731 Otherwise, the umask might be mistakenly 0 while handling input signals.
10732
ec6de1e2
SM
107332012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10734
10735 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10736
28be1ada
DA
107372012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10738
10739 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10740 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10741 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10742 access to `contents' member of Lisp_Vector objects with AREF and ASET
10743 where appropriate.
10744
c6bf3022
CY
107452012-06-19 Chong Yidong <cyd@gnu.org>
10746
10747 * frame.c (delete_frame): When selecting a frame on a different
10748 text terminal, do not alter the terminal's top-frame.
10749
10750 * xdisp.c (format_mode_line_unwind_data): Record the target
10751 frame's selected window and its terminal's top-frame.
10752 (unwind_format_mode_line): Restore them.
10753 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10754 Callers changed.
10755 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
10756 since tty frames can be explicitly named.
10757 (prepare_menu_bars): Likewise.
10758
10759 * term.c (Ftty_top_frame): New function.
10760
defd4196
PE
107612012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10762
10763 Port byte-code-meter to modern targets.
10764 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
10765 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 10766 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
10767 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
10768 (METER_1, METER_2): Simplify.
10769
1053a871
SM
107702012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10771
10772 * data.c (Fdefalias): Return `symbol' (bug#11686).
10773
b7e8d081
MR
107742012-06-18 Martin Rudalics <rudalics@gmx.at>
10775
10776 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
10777 gets killed during executing of this function (Bug#11665).
10778 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
10779 (Vkill_buffer_query_functions): In doc-string say that functions
10780 run by this hook should not change the current buffer.
10781
7ea2b339
PE
107822012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10783
10784 Fix recently-introduced process.c problems found by static checking.
10785 * process.c (write_queue_push, write_queue_pop, send_process):
10786 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
10787 (write_queue_pop): Fix pointer signedness problem.
10788 (send_process): Remove unused local.
10789
96a313a1
CY
107902012-06-17 Chong Yidong <cyd@gnu.org>
10791
10792 * xdisp.c (redisplay_internal): No need to redisplay terminal
10793 frames that are not on top.
10794
20ca2e94
TN
107952012-06-17 Troels Nielsen <bn.troels@gmail.com>
10796
10797 * process.c (make_process): Initialize write_queue.
10798 (write_queue_push, write_queue_pop): New functions.
10799 (send_process): Use them to maintain correct ordering of process
10800 writes (Bug#10815).
10801
9a900ca9
PE
108022012-06-17 Paul Eggert <eggert@cs.ucla.edu>
10803
310fbfa8
PE
10804 * lisp.h (eassert): Assume C89 or later.
10805 This removes the need for CHECK.
10806 (CHECK): Remove. Its comments about always evaluating its
10807 argument were confusing, as 'eassert' typically does not evaluate
10808 its argument.
10809
27bb1ca4
PE
10810 * coding.c (produce_chars): Use ptrdiff_t, not int.
10811
9a900ca9
PE
10812 * xterm.c (x_draw_underwave): Check for integer overflow.
10813 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
10814
41b7f8bc 108152012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
10816
10817 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
10818 referenced (Bug#11583).
10819
9b0e3eba
AA
108202012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
10821
10822 Implement wave-style variant of underlining.
10823 * dispextern.h (face_underline_type): New enum.
10824 (face): Add field for underline type.
10825 * nsterm.m (ns_draw_underwave): New function.
10826 (ns_draw_text_decoration): Use it.
10827 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
10828 New functions.
10829 (x_draw_glyph_string): Use them.
10830 * xfaces.c (Qline, Qwave): New Lisp objects.
10831 (check_lface_attrs, merge_face_ref)
1053a871
SM
10832 (Finternal_set_lisp_face_attribute, realize_x_face):
10833 Handle wave-style underline face attributes.
9b0e3eba
AA
10834 * xterm.c (x_draw_underwave): New function.
10835 (x_draw_glyph_string): Use it.
10836
0fb52f11
JB
108372012-06-16 Juanma Barranquero <lekktu@gmail.com>
10838
10839 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10840 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10841 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10842 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10843 ($(BLD)/w32select.$(O)): Update dependencies.
10844
e5560ff7
AS
108452012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10846
10847 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10848 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10849 * character.c (_fetch_multibyte_char_p): Remove.
10850 * alloc.c: Include "character.h" before "buffer.h".
10851 * bidi.c: Likewise.
10852 * buffer.c: Likewise.
10853 * bytecode.c: Likewise.
10854 * callint.c: Likewise.
10855 * callproc.c: Likewise.
10856 * casefiddle.c: Likewise.
10857 * casetab.c: Likewise.
10858 * category.c: Likewise.
10859 * cmds.c: Likewise.
10860 * coding.c: Likewise.
10861 * composite.c: Likewise.
10862 * dired.c: Likewise.
10863 * dispnew.c: Likewise.
10864 * doc.c: Likewise.
10865 * dosfns.c: Likewise.
10866 * editfns.c: Likewise.
10867 * emacs.c: Likewise.
10868 * fileio.c: Likewise.
10869 * filelock.c: Likewise.
10870 * font.c: Likewise.
10871 * fontset.c: Likewise.
10872 * fringe.c: Likewise.
10873 * indent.c: Likewise.
10874 * insdel.c: Likewise.
10875 * intervals.c: Likewise.
10876 * keyboard.c: Likewise.
10877 * keymap.c: Likewise.
10878 * lread.c: Likewise.
10879 * macros.c: Likewise.
10880 * marker.c: Likewise.
10881 * minibuf.c: Likewise.
10882 * nsfns.m: Likewise.
10883 * nsmenu.m: Likewise.
10884 * print.c: Likewise.
10885 * process.c: Likewise.
10886 * regex.c: Likewise.
10887 * region-cache.c: Likewise.
10888 * search.c: Likewise.
10889 * syntax.c: Likewise.
10890 * term.c: Likewise.
10891 * textprop.c: Likewise.
10892 * undo.c: Likewise.
10893 * unexsol.c: Likewise.
10894 * w16select.c: Likewise.
10895 * w32fns.c: Likewise.
10896 * w32menu.c: Likewise.
10897 * window.c: Likewise.
10898 * xdisp.c: Likewise.
10899 * xfns.c: Likewise.
10900 * xmenu.c: Likewise.
10901 * xml.c: Likewise.
10902 * xselect.c: Likewise.
10903
2f07e6af
EZ
109042012-06-16 Eli Zaretskii <eliz@gnu.org>
10905
1053a871
SM
10906 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
10907 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 10908 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
10909 row.
10910 (handle_face_prop): Use chunk-relative overlay string index when
10911 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
10912 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
10913 the rightmost. (Bug#11720)
2f07e6af 10914
29b83cec
AS
109152012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10916
10917 * category.h (CHAR_HAS_CATEGORY): Define as inline.
10918 (CATEGORY_MEMBER): Enforce 1/0 value.
10919 * category.c (_temp_category_set): Remove.
10920
4c5501e9
EZ
109212012-06-16 Eli Zaretskii <eliz@gnu.org>
10922
10923 * window.c (Fdelete_other_windows_internal)
10924 (Fdelete_window_internal): Don't access frame's mouse highlight
10925 info of the initial frame. (Bug#11677)
10926
2b570124
PE
109272012-06-14 Paul Eggert <eggert@cs.ucla.edu>
10928
e93864f9
PE
10929 * .gdbinit (xgetint): Fix recently-introduced paren typo.
10930 Assume USE_2_TAGS_FOR_INTS.
10931 (xreload): Adjust $tagmask width to match recent lisp.h change.
10932
2b570124
PE
10933 Simplify lisp.h in minor ways that should not affect code.
10934 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
10935 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
10936 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
10937 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
10938 (INTTYPEBITS): New macro, for clarity.
10939 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
10940 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
10941 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
10942 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
10943 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
10944
81755f69
JB
109452012-06-13 Juanma Barranquero <lekktu@gmail.com>
10946
10947 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
10948
16192a57
GM
109492012-06-13 Glenn Morris <rgm@gnu.org>
10950
10951 * s/bsd-common.h (BSD4_3):
10952 * s/usg5-4-common.h (USG5_4): No longer define; unused.
10953
646b5f55
AS
109542012-06-13 Andreas Schwab <schwab@linux-m68k.org>
10955
10956 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
10957 instead of union.
10958 (XLI, XIL): Define.
1053a871
SM
10959 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
10960 Use them.
10961 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 10962 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 10963 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
10964 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
10965 * frame.c (delete_frame): Remove outdated comment.
10966 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
10967 USE_LISP_UNION_TYPE.
10968 (Fw32_unregister_hot_key): Likewise.
10969 (Fw32_toggle_lock_key): Likewise.
10970 * w32menu.c (add_menu_item): Likewise.
10971 (w32_menu_display_help): Use XIL instead of checking
10972 USE_LISP_UNION_TYPE.
10973 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
10974 (init_heap): Likewise.
10975 * w32term.c (w32_read_socket): Update comment.
10976
1d3823c9
GM
109772012-06-13 Glenn Morris <rgm@gnu.org>
10978
c62ff706
GM
10979 * s/usg5-4-common.h, src/s/unixware.h:
10980 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
10981
1d3823c9
GM
10982 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
10983
bfe3e0a2
PE
109842012-06-13 Paul Eggert <eggert@cs.ucla.edu>
10985
10986 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
10987 * alloc.c (make_number) [!defined make_number]:
10988 Remove, as lisp.h always defines this now.
10989 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
10990 (roundup_size): Verify that it is a power of 2.
10991 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
10992 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
10993 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
10994 -DUSE_LSB_TAG=0, to override the automatically-selected default.
10995 USE_LSB_TAG now is always defined to be either 0 or 1.
10996 All uses changed.
10997 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
10998 code works fine either way, and efficiency is not a concern here,
10999 as the union type is for debugging, not for production.
11000 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11001 Use an inline function on all platforms when using the union type,
11002 since this is simpler and 'static inline' can be used portably
11003 within Emacs now.
11004 (LISP_INITIALLY_ZERO): New macro.
11005 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11006 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11007
45fa9c0f
GM
110082012-06-12 Glenn Morris <rgm@gnu.org>
11009
b4492cba
GM
11010 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11011
11012 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 11013
45fa9c0f
GM
11014 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11015 Move BROKEN_SIGIO to configure.
11016
11017 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11018 Move NO_TERMIO to configure.
11019
0e25d334
CY
110202012-06-12 Chong Yidong <cyd@gnu.org>
11021
11022 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11023 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11024 MagickExportImagePixels is undefined.
11025
43682bb6
PE
110262012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11027
11028 * image.c (imagemagick_load_image): Remove unused label.
11029
a9be7d2b
GM
110302012-06-11 Glenn Morris <rgm@gnu.org>
11031
11032 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11033 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11034 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11035 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11036
3017f87f
SM
110372012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11038
11039 * alloc.c (make_byte_code): New function.
11040 (Fmake_byte_code): Use it. Don't purify here.
11041 * lread.c (read1): Use it as well to avoid extra allocation.
11042
1b9b4cf4
CY
110432012-06-11 Chong Yidong <cyd@gnu.org>
11044
11045 * image.c (imagemagick_load_image): Implement transparency.
11046
95988fcf
AS
110472012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11048
11049 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11050 account for preceding backslashes. (Bug#11663)
11051
cd4eb164
CY
110522012-06-09 Chong Yidong <cyd@gnu.org>
11053
11054 * term.c: Support italics in capable terminals (Bug#9652).
11055 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11056 (turn_on_face): Output using TS_enter_italic_mode if available.
11057 Don't handle unused blinking and alt-charset cases.
11058 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11059 and tty_alt_charset_p cases.
11060 (tty_capable_p, init_tty): Support italics.
11061
11062 * termchar.h (struct tty_display_info): Add field for italics.
11063 Remove unused blink field.
11064
11065 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11066 Handle slant.
11067
11068 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11069 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11070 tty_alt_charset_p. Add tty_italic_p.
11071
ff88beb8
MA
110722012-06-09 Michael Albinus <michael.albinus@gmx.de>
11073
11074 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11075 dbus_type_is_basic if available.
11076 (xd_extract_signed, xd_extract_unsigned): Rename from
11077 extract_signed and extract_unsigned, respectively. Adapt callers.
11078
44286096
CY
110792012-06-09 Chong Yidong <cyd@gnu.org>
11080
1682701f
CY
11081 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11082
44286096
CY
11083 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11084 case (Bug#9752).
11085
d86feb17
PE
110862012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11087
11088 * xdisp.c (vmessage): Treat frame message as multibyte.
11089 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11090 would generate the diagnostic "Making \302\247 buffer-local while
11091 let-bound!".
11092
d5c20fe8
EZ
110932012-06-08 Eli Zaretskii <eliz@gnu.org>
11094
11095 * dispnew.c (showing_window_margins_p): Undo last change, which
11096 was done due to an inadvertent commit.
11097 (adjust_frame_glyphs_for_frame_redisplay): Do call
11098 showing_window_margins_p.
11099
513749ee
SM
111002012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11101
11102 * eval.c (Fmake_var_non_special): New primitive.
11103 (syms_of_eval): Defsubr it.
11104 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11105
d4a8f5c1
JB
111062012-06-08 Juanma Barranquero <lekktu@gmail.com>
11107
11108 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11109 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11110
8bbbc977
EZ
111112012-06-08 Eli Zaretskii <eliz@gnu.org>
11112
11113 * alloc.c (allocate_vectorlike): Fix last change.
11114
f3372c87
DA
111152012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11116
11117 Block-based vector allocation of small vectors.
11118 * lisp.h (struct vectorlike_header): New field `nbytes',
11119 adjust comment accordingly.
11120 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 11121 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
11122 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11123 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11124 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11125 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11126 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11127 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11128 (roundup_size): New constant.
11129 (struct vector_block): New data type.
11130 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 11131 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
11132 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11133 (sweep_vectors): New functions.
11134 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 11135 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
11136 or equal to VBLOCK_BYTES_MAX.
11137 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11138 (init_alloc_once): Add call to init_vectors.
11139
4f18a4ed
SM
111402012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11141
11142 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11143
86f158bc
PE
111442012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11145
11146 * doprnt.c (doprnt): Truncate multibyte char correctly.
11147 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11148 would mishandle a string argument "Xc" if X was a multibyte
11149 character of length 2: it would truncate after X's first byte
11150 rather than including all of X.
11151
c5cfcbe0
CY
111522012-06-06 Chong Yidong <cyd@gnu.org>
11153
11154 * buffer.c (word_wrap): Doc fix.
11155
c05cf390
PE
111562012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11157
11158 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11159
0c3461de
GM
111602012-06-03 Glenn Morris <rgm@gnu.org>
11161
11162 * xdisp.c (tool-bar-style): Doc fix.
11163
c71232db
UM
111642012-06-03 Ulrich Müller <ulm@gentoo.org>
11165
11166 * Makefile.in (PAXCTL): Define.
11167 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11168 binary via PaX flags if the paxctl utility is available.
11169 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11170 Restore PaX flags to their default. (Bug#11398)
11171
383f7350
CY
111722012-06-03 Chong Yidong <cyd@gnu.org>
11173
11174 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11175 buffer (Bug#11226).
11176
5f2c76c6
CY
111772012-06-03 Chong Yidong <cyd@gnu.org>
11178
11179 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11180 (note_mode_line_or_margin_highlight): If there is no help echo,
11181 use mode-line-default-help-echo. Handle the case where the mouse
11182 position is past the end of the mode line string.
11183
11184 * buffer.c (buffer_local_value_1): New function, split from
11185 Fbuffer_local_value; can return Qunbound.
11186 (Fbuffer_local_value): Use it.
11187 (Vmode_line_format): Docstring tweaks.
11188
773d47f6
PE
111892012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11190
11191 * sysdep.c (system_process_attributes): Improve comment.
11192
f2d6a3df
SM
111932012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11194
11195 * keyboard.c: Export real-this-command to Elisp.
11196 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11197 and DEFVAR it. Update all users.
11198
63810350
PE
111992012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11200
7bd5c1f4
PE
11201 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11202
63810350
PE
11203 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11204 Convert pctcpu and pctmem to Lisp float properly.
11205 Let the compiler fold better, as 100.0/0x8000 is exact.
11206
a2821611
AS
112072012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11208
11209 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11210 cons_block.
11211
5fceba1d
PE
112122012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11213
11214 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11215
c98ff5dd
DA
112162012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11217
11218 For a 'struct window', replace some Lisp_Object fields to
11219 bitfields where appropriate, remove unused fields.
11220 * window.h (struct window): Remove unused 'last_mark_x' and
11221 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 11222 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
11223 Change type of 'force_start', 'optional_new_start',
11224 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 11225 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 11226
ca34e0be
PE
112272012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11228
11229 Pacify gcc -Wdouble-precision when using Xaw.
11230 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11231 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11232 Use 'float' consistently, rather than 'float' in most places
11233 and 'double' in a couple of places.
11234
efc00ab1 112352012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
11236
11237 * xdisp.c (handle_stop): Detect whether we have overlay strings
11238 loaded by testing it->current.overlay_string_index to be
11239 non-negative, instead of checking whether n_overlay_strings is
11240 positive. (Bug#11587)
11241
efc00ab1 112422012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
11243
11244 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11245
11246 * doc.c (Fsubstitute_command_keys): Doc fix.
11247
efc00ab1 112482012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
11249
11250 * search.c (search_buffer): Remove calls to
11251 r_alloc_inhibit_buffer_relocation, as it is now called by
11252 maybe_unify_char, which was the cause of relocation of buffer text
11253 in bug#11519.
11254
efc00ab1 112552012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
11256
11257 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11258 for the duration of call to load_charset, to avoid problems with
11259 callers of maybe_unify_char that access buffer text through C
11260 pointers.
11261
11262 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11263 decrement the inhibition flag, instead of just setting or
11264 resetting it.
11265
ba93a187
PE
112662012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11267
11268 Remove obsolete '#define static' cruft.
11269 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11270 This #undef was "temporary" in 2000; it is no longer needed
11271 now that '#define static' has gone away.
11272 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11273 (gray_bitmap_bits): Remove; no longer needed.
11274 All uses replaced with definiens.
11275 * xterm.c: Include "bitmaps/gray.xbm".
11276
9e4bf381
PE
112772012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11278
11279 Clean up __executable_start, monstartup when --enable-profiling.
11280 The following changes affect the code only when profiling.
11281 * dispnew.c (__executable_start): Rename from safe_bcopy.
11282 Define only on platforms that need it.
11283 * emacs.c: Include <sys/gmon.h> when profiling.
11284 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11285 (__executable_start): Remove decl, since lisp.h does it now.
11286 (safe_bcopy): Remove decl; no longer has that name.
11287 (main): Coalesce #if into single bit of code, for simplicity.
11288 Cast pointers to uintptr_t, since standard libraries want integers
11289 and not pointers.
11290 * lisp.h (__executable_start): New decl.
11291
32d72c2f
GM
112922012-05-31 Glenn Morris <rgm@gnu.org>
11293
11294 * image.c (Fimagemagick_types): Doc fix.
11295
baac5bc7
JM
112962012-05-30 Jim Meyering <meyering@redhat.com>
11297
11298 * callproc.c (Fcall_process_region): Include directory component
11299 in mkstemp error message (Bug#11586).
11300
72cb32cf
PE
113012012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11302
11303 * alloc.c, lisp.h (make_pure_vector): Now static.
11304
61b108cc
SM
113052012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11306
11307 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11308 Move to byte-run.el.
11309 (Fautoload): Do the hash-doc more carefully.
11310 * data.c (Fdefalias): Purify definition, except for keymaps.
11311 (Qdefun): Move from eval.c.
11312 * lisp.h (Qdefun): Remove.
11313 * lread.c (read1): Tiny simplification.
11314
471fe23d
TN
113152012-05-29 Troels Nielsen <bn.troels@gmail.com>
11316
934f3f58 11317 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
11318 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11319 Bug#9642, but explicitly check that the buffer the overlay would
11320 be moved to is live and rearrange lines to make sure that errors
11321 will not put the overlay in an inconsistent state.
11322 (Fdelete_overlay): Cosmetics.
11323
85d0efd1
EZ
113242012-05-28 Eli Zaretskii <eliz@gnu.org>
11325
11326 * w32term.c (my_bring_window_to_top): New function.
11327 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
11328 could be different from the original one.
11329 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
11330 (Bug#11513)
11331
11332 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11333 by calling BringWindowToTop.
11334
11335 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11336 (WM_EMACS_END): Increase by one.
11337
da92a98c
PE
113382012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11339
11340 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11341 This avoids undefined behavior that might cause the eassert
11342 to not catch an out-of-range value.
11343
74d1f848
JB
113442012-05-28 Juanma Barranquero <lekktu@gmail.com>
11345
11346 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11347 Update dependencies.
11348
9e1a06fc
EZ
113492012-05-27 Eli Zaretskii <eliz@gnu.org>
11350
11351 * bidi.c (bidi_mirror_char): Fix last change.
11352
f3dd7312
AS
113532012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11354
11355 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11356 when referring to sectname field in printf format.
11357
81899c91
PE
113582012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11359
57b81a9f
PE
11360 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11361 Only r_alloc_inhibit_buffer_relocation needed to be added;
11362 the others were already declared.
11363
81899c91
PE
11364 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11365 before checking whether it's out of range. Put the check inside
11366 eassert. See
11367 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11368
33017faf 113692012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
11370
11371 * callproc.c (Fcall_process): Restore a line that was accidentally
11372 commented out in the 2011-02-13 change (bug#11547).
11373
33017faf 113742012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
11375
11376 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11377 defined on ralloc.c.
11378
11379 * buffer.c [REL_ALLOC]: Remove prototypes of
11380 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11381 they are now on lisp.h.
11382
11383 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11384
11385 * search.c (search_buffer): Use it to inhibit relocation of buffer
11386 text while re_search_2 is doing its job, because re_search_2 is
11387 passed C pointers to buffer text. (Bug#11519)
11388
23415acf
EZ
11389 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11390 Update value to 24.
11391
44e27368
EZ
11392 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11393 state after an additional call to move_it_in_display_line_to, keep
11394 the values of it->max_ascent and it->max_descent found for the
11395 entire line.
11396 (pos_visible_p): Revert the comparison against bottom_y to what it
11397 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11398 (Bug#11464)
11399
c1892f11
PE
114002012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11401
11402 Fix coding-related core dumps with gcc -ftrapv.
11403 The code was computing A - B, where A and B are pointers, and B is
11404 random garbage. This can lead to core dumps on platforms that
11405 have special pointer registers, and it also leads to core dumps on
11406 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11407 A - B only when B is initialized properly.
11408 * coding.c (coding_set_source, coding_set_destination): Return void.
11409 (coding_change_source, coding_change_destinations): New functions,
11410 with the old behaviors of coding_set_source and coding_set_destination.
11411 All callers that need an offset changed to use these new functions.
11412
eb7afdad
GM
114132012-05-26 Glenn Morris <rgm@gnu.org>
11414
11415 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11416
f12fdf02
EZ
114172012-05-26 Eli Zaretskii <eliz@gnu.org>
11418
53a63be6 11419 Extend mouse support on W32 text-mode console.
61b108cc
SM
11420 * xdisp.c (draw_row_with_mouse_face):
11421 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 11422
eb3f6f01 11423 * w32console.c: Include window.h.
61b108cc
SM
11424 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11425 New functions.
eb3f6f01
EZ
11426 (initialize_w32_display): Initialize mouse-highlight data.
11427
53a63be6
EZ
11428 * w32inevt.c: Include termchar.h and window.h.
11429 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11430 moves, call note_mouse_highlight. If help_echo changed, call
11431 gen_help_event to produce help-echo message in the echo area.
11432 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11433 highlight info.
11434
4cfd81f6
PE
114352012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11436
11437 * lread.c (read1): Simplify slightly to avoid an overflow warning
11438 with GCC 4.7.0 on x86-64.
11439
4446092a
EZ
114402012-05-26 Eli Zaretskii <eliz@gnu.org>
11441
11442 * bidi.c (bidi_mirror_char): Revert last change: an int is
11443 definitely wide enough here.
11444
42b2a986 114452012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 11446
42b2a986 11447 Fix integer width and related bugs (Bug#9874).
eb106a49 11448 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
11449 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11450 (string_bytes, check_sblock, allocate_string_data):
11451 (compact_small_strings, Fmake_bool_vector, make_string)
11452 (make_unibyte_string, make_multibyte_string)
11453 (make_string_from_bytes, make_specified_string)
11454 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11455 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11456 (mark_vectorlike):
11457 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11458 (allocate_pseudovector):
11459 Use int, not EMACS_INT, where int is wide enough.
11460 (inhibit_garbage_collection, Fgarbage_collect):
11461 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11462 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11463 int might not be wide enough.
11464 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11465 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11466 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11467 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11468 (bidi_level_of_next_char, bidi_move_to_visually_next):
11469 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11470 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11471 (Fkill_buffer, Fset_buffer_major_mode)
11472 (advance_to_char_boundary, Fbuffer_swap_text)
11473 (Fset_buffer_multibyte, overlays_at, overlays_in)
11474 (overlay_touches_p, struct sortvec, record_overlay_string)
11475 (overlay_strings, recenter_overlay_lists)
11476 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11477 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11478 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11479 (Foverlay_recenter, last_overlay_modification_hooks_used)
11480 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11481 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
11482 (validate_region): Omit unnecessary test for b <= e,
11483 since that's guaranteed by the previous test.
d311d28c
PE
11484 (adjust_overlays_for_delete): Avoid pos + length overflow.
11485 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11486 (report_overlay_modification):
11487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11488 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11489 Omit pointer cast, which isn't needed anyway, and doesn't work
11490 after the EMACS_INT -> ptrdiff_t change.
02481186 11491 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
11492 * buffer.h: Adjust decls to match defn changes elsewhere.
11493 (struct buffer_text, struct buffer):
11494 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11495 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
11496 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11497 not int, to avoid needless 32-bit limit on 64-bit hosts.
11498 (exec_byte_code): Use tighter memory-full test, one that checks
11499 for alloca overflow. Don't compute the address of the object just
11500 before an array, as that's not portable. Use EMACS_INT, not
11501 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
11502 * callint.c (Fcall_interactively):
11503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11504 * callproc.c (call_process_kill, Fcall_process):
11505 Don't assume pid_t fits into an Emacs fixnum.
11506 (call_process_cleanup, Fcall_process, child_setup):
11507 Don't assume pid_t fits into int.
11508 (call_process_cleanup, Fcall_process, delete_temp_file)
11509 (Fcall_process_region):
11510 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11511 (Fcall_process): Simplify handling of volatile integers.
11512 Use int, not EMACS_INT, where int will do.
11513 * casefiddle.c (casify_object, casify_region, operate_on_word)
11514 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11516 (casify_object): Avoid integer overflow when overallocating buffer.
11517 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 11518 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
11519 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11520 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11521 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11522 integers are now checked earlier. All uses replaced with XINT.
11523 (ccl_driver):
11524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11525 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
11526 (ccl_driver, Fregister_code_conversion_map):
11527 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
11528 (resolve_symbol_ccl_program): Check that vector header is in range.
11529 Always copy the vector, so that we can check its contents reliably
11530 now rather than having to recheck each instruction as it's being
11531 executed. Check that vector words fit in 'int'.
11532 (ccl_get_compiled_code, Fregister_ccl_program)
11533 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11534 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11535 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11536 contents are in range.
11537 (Fccl_execute_on_string): Check that status is in range.
11538 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11539 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11540 Accept and return EMACS_INT, not int, because callers can pass values
11541 out of 'int' range.
11542 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11543 (multibyte_chars_in_text, parse_str_as_multibyte)
11544 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11545 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11546 (string_escape_byte8, Fget_byte):
11547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 11548 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
11549 avoid mishandling large integers.
11550 * character.h: Adjust decls to match defn changes elsewhere.
11551 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11552 (Ffind_charset_region):
11553 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11554 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11555 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 11556 Don't assume fixnum fits in int.
d311d28c
PE
11557 (load_charset_map_from_vector, Fmap_charset_chars):
11558 Remove now-unnecessary CHECK_NATNUMs.
11559 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
11560 Don't rely on undefined behavior with signed left shift overflow.
11561 Don't assume unsigned int fits into fixnum, or that fixnum fits
11562 into unsigned int. Don't require max_code to be a valid fixnum;
11563 that's not true for gb10830 4-byte on a 32-bit host. Allow
11564 invalid_code to be a cons, for the same reason. Require code_offset
11565 to be a character. Avoid int overflow if max_char is close
11566 to INT_MAX.
11567 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11568 this is intended anyway and avoids some undefined behavior.
11569 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11570 INDEX_TO_CODE_POINT, as that's what it expects.
11571 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
11572 * charset.h (DECODE_CHAR): Return int, not unsigned;
11573 this is what was intended anyway, and it avoids undefined behavior.
11574 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11575 integer-overflow issues.
11576 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11577 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11578 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
11579 * chartab.c (Fmake_char_table, Fset_char_table_range)
11580 (uniprop_get_decoder, uniprop_get_encoder):
11581 Don't assume fixnum fits in int.
11582 * cmds.c (move_point): New function, that does the gist of
11583 Fforward_char and Fbackward_char, but does so while checking
11584 for integer overflow more accurately.
c96e5d6a 11585 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
11586 (Fforward_line, Fend_of_line, internal_self_insert)
11587 (internal_self_insert):
11588 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11589 Fix a FIXME, by checking for integer overflow when calculating
11590 target_clm and actual_clm.
11591 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 11592 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
11593 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11594 (coding_alloc_by_making_gap, alloc_destination)
11595 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11596 (encode_coding_utf_16, detect_coding_emacs_mule)
11597 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11598 (detect_coding_iso_2022, decode_coding_iso_2022)
11599 (encode_invocation_designation, encode_designation_at_bol)
11600 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11601 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11602 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11603 (encode_coding_ccl, encode_coding_raw_text)
11604 (detect_coding_charset, decode_coding_charset)
11605 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11606 (produce_composition, produce_charset, produce_annotation)
11607 (decode_coding, handle_composition_annotation)
11608 (handle_charset_annotation, consume_chars, decode_coding_gap)
11609 (decode_coding_object, encode_coding_object, detect_coding_system)
11610 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11611 (code_convert_region, code_convert_string)
8f50130c
PE
11612 (Fdefine_coding_system_internal)
11613 (coding_set_source, coding_set_destination):
d311d28c
PE
11614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11615 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11616 (Fdefine_coding_system_internal):
11617 Don't assume fixnums fit in int.
11618 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 11619 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
11620 (Funencodable_char_position, Fcheck_coding_systems_region)
11621 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 11622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 11623 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 11624 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 11625 Don't access memory outside of the args array.
d311d28c 11626 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
11627 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11628 result of ENCODE_CHAR.
d311d28c
PE
11629 * coding.h: Adjust decls to match defn changes elsewhere.
11630 (struct coding_system):
11631 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11632 * composite.c (get_composition_id, find_composition)
11633 (run_composition_function, update_compositions)
11634 (compose_text, composition_gstring_put_cache)
11635 (composition_gstring_p, composition_gstring_width)
11636 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11637 (composition_compute_stop_pos, composition_reseat_it)
11638 (composition_update_it, struct position_record)
11639 (find_automatic_composition, composition_adjust_point)
11640 (Fcomposition_get_gstring, Ffind_composition_internal):
11641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11642 (update_compositions):
11643 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11644 * composite.h: Adjust decls to match defn changes elsewhere.
11645 (struct composition):
11646 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11647 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11648 Do not attempt to compute the address of the object just before a
11649 buffer; this is not portable.
11650 (Faref, Faset):
11651 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11652 (Faset): Use int, not EMACS_INT, where int is wide enough.
11653 (Fstring_to_number): Don't assume fixnums fit in int.
11654 (Frem): Don't assume arg is nonnegative.
11655 * dbusbind.c (xd_append_arg): Check for integers out of range.
11656 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 11657 (extract_signed, extract_unsigned): New functions.
243e0530
PE
11658 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11659 (xd_get_connection_references): Return ptrdiff_t, not int.
11660 All uses changed.
11661 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11662 (xd_read_message_1):
11663 Use int, not unsigned, where the dbus API uses int.
11664 (Fdbus_message_internal): Don't overflow mtype.
11665 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
11666 * dired.c (directory_files_internal, file_name_completion, scmp)
11667 (file_name_completion_stat):
11668 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11669 (file_name_completion): Don't overflow matchcount.
11670 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11671 * dispextern.h: Adjust decls to match defn changes elsewhere.
11672 (struct text_pos, struct glyph, struct bidi_saved_info)
11673 (struct bidi_string_data, struct bidi_it, struct composition_it)
11674 (struct it):
11675 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11676 (struct display_pos, struct composition_it, struct it):
11677 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11678 * dispnew.c (increment_matrix_positions)
11679 (increment_row_positions, mode_line_string)
11680 (marginal_area_string):
11681 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 11682 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
11683 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11684 (duration_to_sec_usec): New function, to check for overflow better.
11685 (Fsleep_for, sit_for): Use it.
11686 * doc.c (get_doc_string, store_function_docstring):
11687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11688 (get_doc_string, Fsnarf_documentation):
11689 Use int, not EMACS_INT, where int is wide enough.
11690 (get_doc_string):
11691 Use SAFE_ALLOCA, not alloca.
11692 Check for overflow when converting EMACS_INT to off_t.
11693 * doprnt.c (doprnt):
11694 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11695 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11696 Don't assume uid_t fits into fixnum.
11697 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11698 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11699 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11700 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11701 (general_insert_function)
11702 (Finsert_char, make_buffer_string, make_buffer_string_both)
11703 (update_buffer_properties, Fbuffer_substring)
11704 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11705 (Fsubst_char_in_region, check_translation)
11706 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11707 (transpose_markers, Ftranspose_regions):
11708 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11709 (clip_to_bounds): Move to lisp.h as an inline function).
11710 (Fconstrain_to_field): Don't assume integers are nonnegative.
11711 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11712 (Fsubst_char_in_region, Fsave_restriction):
11713 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11714 (Femacs_pid): Don't assume pid_t fits into fixnum.
11715 (lo_time): Use int, not EMACS_INT, when int suffices.
11716 (lisp_time_argument): Check for usec out of range.
11717 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
11718 (Fuser_login_name, Fuser_full_name): Signal an error
11719 if a uid argument is out of range, rather than relying on
11720 undefined behavior.
c8d5c857
PE
11721 (Fformat_time_string): Remove now-unnecessary check.
11722 lisp_time_argument checks for out-of-range usec now.
243e0530 11723 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
11724 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11725 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11726 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11727 (init_cmdargs, Fdump_emacs):
11728 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11729 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11730 the bottom (typically) 32 bits of the fixnum.
11731 * eval.c (specpdl_size, call_debugger):
11732 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11733 (when_entered_debugger, Fbacktrace_debug):
11734 Don't assume fixnum can fit in int.
11735 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11736 the object just before a buffer; this is not portable.
11737 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11738 (grow_specpdl, unbind_to):
11739 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11740 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11741 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 11742 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
11743 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11744 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11745 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11746 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11747 (a_write, e_write):
11748 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11749 (Fcopy_file, non_regular_nbytes, read_non_regular)
11750 (Finsert_file_contents):
11751 Use int, not EMACS_INT, where int is wide enough.
11752 (READ_BUF_SIZE): Verify that it fits in int.
11753 (Finsert_file_contents): Check that counts are in proper range,
11754 rather than assuming fixnums fit into ptrdiff_t etc.
11755 Don't assume fixnums fit into int.
125b3835 11756 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
11757 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
11758 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
11759 (string_char_to_byte, string_byte_to_char)
11760 (string_make_multibyte, string_to_multibyte)
11761 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
11762 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
11763 (substring_both, Fdelete, internal_equal, Ffillarray)
11764 (Fclear_string, mapcar1)
11765 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
11766 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
11767 (larger_vector, make_hash_table, maybe_resize_hash_table)
11768 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
11769 (Fmaphash, secure_hash):
11770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11771 (concat): Check for string index and length overflow.
11772 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
11773 (Frequire):
11774 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11775 (larger_vector): New API (vec, incr_min, size_max) replaces old
11776 one (vec, new_size, init). This catches size overflow.
11777 INIT was removed because it was always Qnil.
11778 All callers changed.
11779 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
11780 the upper bound on a hash table index size.
11781 (make_hash_table, maybe_resize_hash_table): Use it.
11782 (secure_hash): Computer start_byte and end_byte only after
11783 they're known to be in ptrdiff_t range.
11784 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
11785 (Ffont_get_glyphs, Ffont_at):
11786 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11787 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
11788 (Flist_fonts, Fopen_font):
11789 Don't assume fixnum can fit in int.
11790 (check_gstring): Don't assume index can fit in int.
11791 (font_match_p): Check that fixnum is a character, not a nonnegative
11792 fixnum, since the later code needs to stuff it into an int.
11793 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
11794 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
11795 conversion overflow issues.
11796 (Fopen_font): Check for integer out of range.
11797 (Ffont_get_glyphs): Don't assume index can fit in int.
11798 * font.h: Adjust decls to match defn changes elsewhere.
11799 * fontset.c (reorder_font_vector): Redo score calculation to avoid
11800 integer overflow.
11801 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
11802 printmax_t, where ptrdiff_t is wide enough.
11803 (Finternal_char_font):
11804 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11805 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
11806 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
11807 (Fset_frame_position, x_set_frame_parameters)
11808 (x_set_line_spacing, x_set_border_width)
11809 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
11810 Check that fixnums are in proper range for system types.
11811 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
11812 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11813 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
11814 Use SAFE_ALLOCA_LISP, not alloca.
11815 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
11816 intptr_t is wide enough.
11817 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
11818 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
11819 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
11820 Check for fixnum out of range.
11821 * ftfont.c (ftfont_list): Don't assume index fits in int.
11822 Check that fixnums are in proper range for system types.
11823 (ftfont_shape_by_flt):
11824 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
11825 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11826 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11827 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
11828 Check that fixnums are in proper range for system types.
11829 * gnutls.h: Adjust decls to match defn changes elsewhere.
11830 * gtkutil.c (xg_dialog_run):
11831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11832 (update_frame_tool_bar):
11833 Check that fixnums are in proper range for system types.
11834 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 11835 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
11836 * indent.c (last_known_column, last_known_column_point):
11837 (current_column_bol_cache):
11838 (skip_invisible, current_column, check_display_width):
11839 (check_display_width, scan_for_column, current_column_1)
11840 (Findent_to, Fcurrent_indentation, position_indentation)
11841 (indented_beyond_p, Fmove_to_column, compute_motion):
11842 (Fcompute_motion, Fvertical_motion):
11843 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11844 (last_known_column_modified): Use EMACS_INT, not int.
11845 (check_display_width):
11846 (Fcompute_motion):
11847 Check that fixnums and floats are in proper range for system types.
11848 (compute_motion): Don't assume index or fixnum fits in int.
11849 (compute_motion, Fcompute_motion):
11850 Use int, not EMACS_INT, when it is wide enough.
11851 (vmotion): Omit local var start_hpos that is always 0; that way
11852 we don't need to worry about overflow in expressions involving it.
11853 * indent.h: Adjust decls to match defn changes elsewhere.
11854 (struct position):
11855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11856 Use int, not EMACS_INT, where int is wide enough.
11857 Remove unused members ovstring_chars_done and tab_offset;
11858 all uses removed.
11859 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11860 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11861 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11862 (make_gap, copy_text, insert, insert_and_inherit)
11863 (insert_before_markers, insert_before_markers_and_inherit)
11864 (insert_1, count_combining_before, count_combining_after)
11865 (insert_1_both, insert_from_string)
11866 (insert_from_string_before_markers, insert_from_string_1)
11867 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11868 (adjust_after_replace, adjust_after_insert, replace_range)
11869 (replace_range_2, del_range, del_range_1, del_range_byte)
11870 (del_range_both, del_range_2, modify_region)
11871 (prepare_to_modify_buffer, signal_before_change)
11872 (signal_after_change, Fcombine_after_change_execute):
11873 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11874 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11875 (balance_an_interval, split_interval_right, split_interval_left)
11876 (find_interval, next_interval, update_interval)
11877 (adjust_intervals_for_insertion, delete_node, delete_interval)
11878 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11879 (static_offset_intervals, offset_intervals)
11880 (merge_interval_right, merge_interval_left, make_new_interval)
11881 (graft_intervals_into_buffer, temp_set_point_both)
11882 (temp_set_point, set_point, adjust_for_invis_intang)
11883 (set_point_both, move_if_not_intangible, get_property_and_range)
11884 (get_local_map, copy_intervals, copy_intervals_to_string)
11885 (compare_string_intervals, set_intervals_multibyte_1):
11886 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11887 * intervals.h: Adjust decls to match defn changes elsewhere.
11888 (struct interval):
11889 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11890 * keyboard.c (this_command_key_count, this_single_command_key_start)
11891 (before_command_key_count, before_command_echo_length, echo_now)
11892 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11893 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11894 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11895 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11896 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11897 (last_non_minibuf_size, last_point_position, echo_truncate)
11898 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
11899 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
11900 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
11901 (stuff_buffered_input):
11902 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11903 (last_auto_save, command_loop_1, read_char):
11904 Use EMACS_INT, not int, to avoid integer overflow.
11905 (record_char): Avoid overflow in total_keys computation.
11906 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
11907 * keyboard.h: Adjust decls to match defn changes elsewhere.
11908 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
11909 (Fkey_description, Fdescribe_vector, Flookup_key):
11910 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11911 (click_position): New function, to check that positions are in range.
11912 (Fcurrent_active_maps):
11913 (describe_command):
11914 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11915 (Faccessible_keymaps, Fkey_description):
11916 (preferred_sequence_p):
11917 Don't assume fixnum can fit into int.
11918 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
11919 Check for integer overflow in size calculations.
11920 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
11921 avoid mishandling large integers.
11922 * lisp.h: Adjust decls to match defn changes elsewhere.
11923 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
11924 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
11925 (struct Lisp_Marker):
11926 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11927 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
11928 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
11929 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
11930 All callers changed.
11931 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
11932 Assume the arg has valid form, since it always does.
11933 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
11934 unsigned integer system type.
11935 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
11936 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
11937 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11938 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
11939 (duration_to_sec_usec): New decl.
11940 * lread.c (read_from_string_index, read_from_string_index_byte)
11941 (read_from_string_limit, readchar, unreadchar, openp)
11942 (read_internal_start, read1, oblookup):
11943 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11944 (Fload, readevalloop, Feval_buffer, Feval_region):
11945 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11946 (openp): Check for out-of-range argument to 'access'.
11947 (read1): Use int, not EMACS_INT, where int is wide enough.
11948 Don't assume fixnum fits into int.
6efdadfd 11949 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
11950 (read_filtered_event): Use duration_to_sec_usec
11951 to do proper overflow checking on durations.
d311d28c
PE
11952 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
11953 in size calculation.
11954 (Fexecute_kbd_macro):
11955 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11956 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
11957 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
11958 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
11959 (set_marker_both, set_marker_restricted_both, marker_position)
11960 (marker_byte_position, Fbuffer_has_markers_at):
11961 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11962 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 11963 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
11964 It now merely ensures that the menu is large enough, without
11965 necessarily growing it, as this avoids some integer overflow issues.
11966 All callers changed.
11967 (keymap_panes, parse_single_submenu, Fx_popup_menu):
11968 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11969 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
11970 Use SAFE_ALLOCA_LISP, not alloca.
11971 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
11972 to EMACS_INT. Check that fixnums are in proper range for system types.
11973 * minibuf.c (minibuf_prompt_width, string_to_object)
11974 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
11975 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
11976 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11977 (get_minibuffer, read_minibuf_unwind):
11978 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11979 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
11980 this simplifies overflow checking. All callers changed.
11981 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
11982 (Ftest_completion):
11983 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11984 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
11985 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
11986 Check that fixnums are in proper range for system types.
11987 (Fx_create_frame, Fx_show_tip):
11988 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11989 * nsfont.m (ns_findfonts, nsfont_list_family):
11990 Don't assume fixnum fits in long.
11991 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
11992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11993 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
11994 wide enough.
17fdb222 11995 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
11996 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11997 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
11998 (PRINTDECLARE, PRINTPREPARE):
11999 (strout, print_string):
12000 (print, print_preprocess, print_check_string_charset_prop)
12001 (print_object):
12002 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12003 (PRINTDECLARE):
12004 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12005 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12006 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 12007 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 12008 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
12009 (print_error_message): Use SAFE_ALLOCA, not alloca.
12010 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
12011 (print_depth, new_backquote_output, print_number_index):
12012 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
12013 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12014 (Fset_process_window_size, Fformat_network_address)
12015 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 12016 (sigchld_handler):
d311d28c 12017 Check that fixnums are in proper range for system types.
d44287d4 12018 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
12019 Check for process-ids out of pid_t range rather than relying on
12020 undefined behavior.
e4d81efc 12021 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
12022 (Fformat_network_address, read_process_output, send_process)
12023 (Fprocess_send_region, status_notify):
12024 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12025 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12026 (wait_reading_process_output, read_process_output, exec_sentinel):
12027 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12028 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12029 (Faccept_process_output): Use duration_to_sec_usec to do proper
12030 overflow checking on durations.
dde14581
PE
12031 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12032 Don't assume pid_t fits in int.
02481186
PE
12033 * process.h (struct Lisp_Process): Members tick and update_tick
12034 are now of type EMACS_INT, not int.
b62b53e8
PE
12035 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12036 configured --with-wide-int.
d311d28c
PE
12037 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12038 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12039 * search.c (looking_at_1, string_match_1):
12040 (fast_string_match, fast_c_string_match_ignore_case)
12041 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12042 (scan_newline, find_before_next_newline, search_command)
12043 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12044 (set_search_regs, wordify):
12045 (Freplace_match):
12046 (Fmatch_data):
12047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12048 (string_match_1, search_buffer, set_search_regs):
12049 (Fmatch_data):
12050 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12051 (wordify): Check for overflow in size calculation.
12052 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12053 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12054 Check that fixnums are in proper range for system types.
12055 * sound.c (struct sound_device)
12056 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12057 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12058 (Fplay_sound_internal):
12059 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 12060 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
12061 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12062 (Fparse_partial_sexp):
12063 Don't assume fixnums can fit in int.
12064 (struct lisp_parse_state, find_start_pos, find_start_value)
12065 (find_start_value_byte, find_start_begv)
12066 (update_syntax_table, char_quoted, dec_bytepos)
12067 (find_defun_start, prev_char_comend_first, back_comment):
12068 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12069 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12070 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12071 (Finternal_describe_syntax_value): Check that match_lisp is a
12072 character, not an integer, since the code stuffs it into int.
12073 (scan_words, scan_sexps_forward):
12074 Check that fixnums are in proper range for system types.
12075 (Fforward_word):
12076 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12077 (scan_sexps_forward):
12078 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12079 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12080 * syntax.h: Adjust decls to match defn changes elsewhere.
12081 (struct gl_state_s):
12082 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
12083 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12084 MOST_POSITIVE_FIXNUM.
d311d28c
PE
12085 * sysdep.c (wait_for_termination_1, wait_for_termination)
12086 (interruptible_wait_for_termination, mkdir):
12087 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12088 (emacs_read, emacs_write):
12089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
12090 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12091 and double all fit in int.
d311d28c
PE
12092 * term.c (set_tty_color_mode):
12093 Check that fixnums are in proper range for system types.
12094 * termhooks.h (struct input_event):
12095 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12096 * textprop.c (validate_interval_range, interval_of)
12097 (Fadd_text_properties, set_text_properties_1)
12098 (Fremove_text_properties, Fremove_list_of_text_properties)
12099 (Ftext_property_any, Ftext_property_not_all)
12100 (copy_text_properties, text_property_list, extend_property_ranges)
12101 (verify_interval_modification):
12102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12103 (Fnext_single_char_property_change)
12104 (Fprevious_single_char_property_change):
12105 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
12106 (copy_text_properties):
12107 Check for integer overflow in index calculation.
d311d28c
PE
12108 * undo.c (last_boundary_position, record_point, record_insert)
12109 (record_delete, record_marker_adjustment, record_change)
12110 (record_property_change):
12111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12112 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12113 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12114 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12115 (Fx_hide_tip, Fx_file_dialog):
12116 * w32menu.c (set_frame_menubar):
12117 Use ptrdiff_t, not int, for consistency with rest of code.
12118 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12119 (select_window, Fdelete_other_windows_internal)
12120 (window_scroll_pixel_based, window_scroll_line_based)
12121 (Frecenter, Fset_window_configuration):
12122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12123 (Fset_window_hscroll, run_window_configuration_change_hook)
12124 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 12125 (Fscroll_other_window, Frecenter):
d311d28c
PE
12126 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12127 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12128 Don't assume fixnum fits in int.
12129 (Fset_window_scroll_bars):
12130 Check that fixnums are in proper range for system types.
12131 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12132 (string_pos, c_string_pos, number_of_chars, init_iterator)
12133 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12134 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12135 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
12136 (face_before_or_after_it_pos, handle_invisible_prop)
12137 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
12138 (display_prop_intangible_p, string_buffer_position_lim)
12139 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12140 (get_overlay_strings_1, get_overlay_strings)
12141 (iterate_out_of_display_property, forward_to_next_line_start)
12142 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12143 (get_next_display_element, set_iterator_to_next)
12144 (get_visually_first_element, compute_stop_pos_backwards)
12145 (handle_stop_backwards, next_element_from_buffer)
12146 (move_it_in_display_line_to, move_it_in_display_line)
12147 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12148 (add_to_log, message_dolog, message_log_check_duplicate)
12149 (message2, message2_nolog, message3, message3_nolog
12150 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12151 (current_message_1, truncate_echo_area, truncate_message_1)
12152 (set_message, set_message_1, store_mode_line_noprop)
12153 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12154 (text_outside_line_unchanged_p, check_point_in_composition)
12155 (reconsider_clip_changes)
12156 (redisplay_internal, set_cursor_from_row, try_scrolling)
12157 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12158 (redisplay_window, find_last_unchanged_at_beg_row)
12159 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12160 (trailing_whitespace_p, find_row_edges, display_line)
12161 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12162 (display_mode_element, store_mode_line_string)
12163 (pint2str, pint2hrstr, decode_mode_spec)
12164 (display_count_lines, display_string, draw_glyphs)
12165 (x_produce_glyphs, x_insert_glyphs)
12166 (rows_from_pos_range, mouse_face_from_buffer_pos)
12167 (fast_find_string_pos, mouse_face_from_string_pos)
12168 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12169 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12170 (safe_call, init_from_display_pos, handle_fontified_prop)
12171 (handle_single_display_spec, load_overlay_strings)
12172 (with_echo_area_buffer, setup_echo_area_for_printing)
12173 (display_echo_area, echo_area_display)
12174 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12175 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
12176 (redisplay_window, dump_glyph_row, display_mode_line)
12177 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 12178 (handle_display_spec, display_prop_string_p):
d311d28c
PE
12179 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12180 (handle_single_display_spec, build_desired_tool_bar_string)
12181 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12182 (get_specified_cursor_type):
12183 Check that fixnums are in proper range for system types.
12184 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12185 (Flookup_image_map):
12186 Don't assume fixnums fit in int.
12187 (compare_overlay_entries):
12188 Avoid mishandling comparisons due to subtraction overflow.
12189 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12190 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12191 (handle_tool_bar_click):
12192 Use int, not unsigned, since we prefer signed and the signedness
12193 doesn't matter here.
12194 (get_next_display_element, next_element_from_display_vector):
12195 Use int, not EMACS_INT, when int is wide enough.
12196 (start_hourglass): Use duration_to_sec_usec to do proper
12197 overflow checking on durations.
12198 * xfaces.c (Fbitmap_spec_p):
12199 Check that fixnums are in proper range for system types.
12200 (compare_fonts_by_sort_order):
12201 Avoid mishandling comparisons due to subtraction overflow.
12202 (Fx_family_fonts, realize_basic_faces):
12203 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12204 (Fx_family_fonts):
12205 Don't assume fixnum fits in int.
12206 Use SAFE_ALLOCA_LISP, not alloca.
12207 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12208 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12209 (face_at_buffer_position, face_for_overlay_string)
12210 (face_at_string_position):
12211 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12212 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12213 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12214 (Fx_show_tip):
12215 Check that fixnums are in proper range for system types.
12216 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12217 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12218 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12219 (Fx_change_window_property): Don't assume fixnums fit in int.
12220 * xfont.c (xfont_chars_supported):
12221 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12222 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12223 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12224 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12225 * xml.c (parse_region):
12226 * xrdb.c (magic_file_p):
12227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12228 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12229 (x_get_local_selection, x_reply_selection_request)
12230 (x_handle_selection_request, wait_for_property_change):
12231 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12232 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12233 short is wide enough.
12234 (x_send_client_event): Don't assume fixnum fits in int.
12235 * xterm.c (x_x_to_emacs_modifiers):
12236 Don't assume EMACS_INT overflows nicely into int.
12237 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12238 may come from Lisp.
12239 (handle_one_xevent): NATNUMP can eval its arg twice.
12240 (x_connection_closed):
12241 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12242 * xterm.h: Adjust decls to match defn changes elsewhere.
12243 (struct scroll_bar): Use struct vectorlike_header
12244 rather than rolling our own approximation.
12245 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12246
c6574eb5
GM
122472012-05-25 Glenn Morris <rgm@gnu.org>
12248
12249 * lisp.mk (lisp): Update for more files being compiled now.
12250
e8d32c7e
SM
122512012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12252
48def666
SM
12253 * lread.c: Remove `read_pure' which makes no difference.
12254 (read_pure): Remove var.
12255 (unreadpure): Remove function.
12256 (readevalloop): Don't call read_list with -1 flag.
12257 (read1, read_vector): Don't test read_pure any more.
12258 (read_list): Simplify.
12259
e8d32c7e
SM
12260 * fileio.c, character.h: Minor style tweaks.
12261
4b2addb7
DA
122622012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12263
12264 * window.h (clip_changed): Remove useless declaration.
12265
584461b2
JB
122662012-05-22 Juanma Barranquero <lekktu@gmail.com>
12267
12268 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12269 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12270
34374650
PE
122712012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12272
12273 Remove src/m/*.
12274 This directory predates autoconf and is no longer needed nowadays.
12275 Move its few remaining bits of functionality to where they're needed.
12276 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12277 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12278 * m/template.h: Remove.
12279 * Makefile.in (M_FILE): Remove. All uses removed.
12280 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12281 * lisp.h (USE_LSB_TAG):
12282 * mem-limits.h (EXCEEDS_LISP_PTR):
12283 Use VAL_MAX, not VALBITS, in #if.
12284 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12285 (EMACS_UINT): Define unconditionally now.
12286 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12287 (BITS_PER_EMACS_INT): New constants, replacing
12288 what used to be in config.h, but not useful in #if.
12289 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12290 define them any more.
12291 (VAL_MAX): New macro.
12292 (VALMASK): Use it.
12293 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12294 BITS_PER_EMACS_INT, in #if.
12295 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12296 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12297 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12298 * s/ms-w32.h (DATA_START):
12299 Move here from removed file m/intel386.h.
12300 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12301 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12302
261cb4bb
PE
123032012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12304
12305 Assume C89 or later.
12306 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12307 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12308 (xrealloc):
12309 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12310 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12311 * textprop.c, tparam.c (NULL): Remove.
12312 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12313 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12314 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12315 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12316 * xterm.c (input_signal_count): Assume volatile works.
12317
ff23cd9f
KB
123182012-05-21 Ken Brown <kbrown@cornell.edu>
12319
12320 * xgselect.c (xg_select): Fix first argument in call to 'select'
12321 (bug#11508).
12322
1b170bc6
KB
123232012-05-20 Ken Brown <kbrown@cornell.edu>
12324
12325 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 12326 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 12327
b2f4d39f
KB
123282012-05-19 Ken Brown <kbrown@cornell.edu>
12329
12330 * xfns.c (x_in_use): Remove `static' qualifier.
12331 * xterm.h (x_in_use): Declare.
12332 * xgselect.c: Include xterm.h.
12333 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12334 and `display_arg' (bug#9754).
12335
003fdae2
PE
123362012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12337
9232a6d9
PE
12338 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12339
003fdae2
PE
12340 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12341 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12342
784b56e2
EZ
123432012-05-18 Eli Zaretskii <eliz@gnu.org>
12344
12345 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12346
12347 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 12348 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
12349
12350 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12351 reference to image_cache->refcount.
12352 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12353
a0a79cde
JL
123542012-05-17 Juri Linkov <juri@jurta.org>
12355
12356 * search.c (Fword_search_regexp, Fword_search_backward)
12357 (Fword_search_forward, Fword_search_backward_lax)
12358 (Fword_search_forward_lax): Move functions to isearch.el
12359 (bug#10145, bug#11381).
12360
b0572523
PE
123612012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12362
12363 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12364
9660f5fc
SM
123652012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12366
12367 * lread.c (init_obarray): Declare Qt and Qnil as special.
12368
4374de83
GM
123692012-05-14 Glenn Morris <rgm@gnu.org>
12370
12371 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 12372 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 12373
dc44c39a
PE
123742012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12375
078c97cb
PE
12376 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12377
dc44c39a
PE
12378 * unexaix.c: Port to more-recent AIX compilers.
12379 (report_error, report_error_1, make_hdr, copy_sym)
12380 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12381 Make arguments const char *, not char *, to avoid violations of C
12382 standard and to fix some AIX warnings reported by Gilles Pion.
12383
e18afed7 123842012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
12385
12386 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12387 already have overlays loaded.
12388 (handle_single_display_spec): Before returning without displaying
12389 fringe bitmap, synchronize the bidi iterator with the main display
12390 iterator, by calling iterate_out_of_display_property.
12391 (iterate_out_of_display_property): Detect buffer iteration by
12392 testing that it->string is a Lisp string.
12393 (get_next_display_element): When the current object is exhausted,
12394 and there's something on it->stack, call set_iterator_to_next to
12395 proceed with what's on the stack, instead of returning zero.
12396 (set_iterator_to_next): If called at the end of a Lisp string,
12397 proceed to consider_string_end without incrementing string
12398 position. Don't increment display vector index past the end of
12399 the display vector. (Bug#11417)
c8fb9dc6
EZ
12400 (pos_visible_p): Don't report a position visible when move_it_to
12401 stopped at the last line of window, which happens to be scanned
12402 backwards by the bidi iteration. (Bug#11464)
ac268e67 12403
e18afed7 124042012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
12405
12406 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12407 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
12408 are on a TTY, and thus unable to display on the fringes.
12409 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
12410 so we need to signal to the caller that this is a "replacing"
12411 display spec. This fixes display when the spec is invalid or we
12412 are on a TTY.
12413
e18afed7 124142012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
12415
12416 * unexaix.c (make_hdr): Fix typo in prototype.
12417 This bug broke the build on AIX. Problem reported by Gilles Pion.
12418
9d0a235a
MA
124192012-05-14 Michael Albinus <michael.albinus@gmx.de>
12420
12421 * keyboard.c (kbd_buffer_get_event): Read special events also in
12422 batch mode. (Bug#11415)
12423
9e6b06ed
GM
124242012-05-12 Glenn Morris <rgm@gnu.org>
12425
12426 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12427
c1a1d7a3
EZ
124282012-05-12 Eli Zaretskii <eliz@gnu.org>
12429
12430 * lisp.mk (lisp): Add newcomment.elc.
12431
3fe7cdc8
GM
124322012-05-12 Glenn Morris <rgm@gnu.org>
12433
12434 * Makefile.in (MKDIR_P): New, set by configure.
12435 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12436
53f7d2c0
PE
124372012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12438
12439 Remove unused function hourglass_started.
12440 * dispextern.h (hourglass_started):
12441 * w32fns.c (hourglass_started):
12442 * xdisp.c (hourglass_started): Remove.
12443
75aafb17
JB
124442012-05-10 Juanma Barranquero <lekktu@gmail.com>
12445
12446 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12447 Update dependencies.
12448
12959e8e
PE
124492012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12450
97107e2e
PE
12451 * xgselect.c (xg_select): Put maxfds+1 into a var.
12452 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12453
12959e8e
PE
12454 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12455
836d29b3
DA
124562012-05-10 Dave Abrahams <dave@boostpro.com>
12457
12458 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12459 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12460
5cb67954
MA
124612012-05-09 Michael Albinus <michael.albinus@gmx.de>
12462
12463 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 12464 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
12465 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12466 Initialize xd_registered_buses.
12467
3478ec45
PE
124682012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12469
b263a6b0
PE
12470 Untag more efficiently if USE_LSB_TAG.
12471 This is based on a proposal by YAMAMOTO Mitsuharu in
12472 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12473 For an admittedly artificial (nth 8000 longlist) benchmark on
12474 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12475 Emacs's overall text size by 1%.
12476 * lisp.h (XUNTAG): New macro.
12477 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12478 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12479 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12480 * eval.c (Fautoload):
12481 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12482 * frame.h (XFRAME): Use XUNTAG.
12483
3478ec45
PE
12484 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12485 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12486 Remove unportable assumptions about print widths of types like
12487 dbus_uint32_t.
12488 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12489 intptr_t when converting between pointer and integer, to avoid GCC
12490 warnings about wrong width.
12491
666b903b 124922012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
12493
12494 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12495 stack for each reader_thread, instead of defaulting to 8MB
12496 determined by the linker. This avoids failures in creating
12497 subprocesses on Windows 7, see the discussion in this thread:
12498 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12499
b120cc17
JC
125002012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12501
12502 Fix up display of the *Minibuf-0* buffer in the mini window.
12503 * keyboard.c (read_char): Don't clear the echo area if there's no
12504 message to clear.
12505 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 12506 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 12507
9a4b36f8
MA
125082012-05-07 Michael Albinus <michael.albinus@gmx.de>
12509
12510 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12511 batch mode.
12512
e5f9458f
CY
125132012-05-06 Chong Yidong <cyd@gnu.org>
12514
12515 * lisp.mk (lisp): Update.
12516
eceeb5fc 125172012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
12518
12519 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12520
71873e2b
SM
125212012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12522
12523 * data.c (PUT_ERROR): New macro.
12524 (syms_of_data): Use it. Add new error type `user-error'.
12525 * undo.c (user_error): New function.
12526 (Fprimitive_undo): Use it.
12527 * print.c (print_error_message): Adjust print style for `user-error'.
12528 * keyboard.c (user_error): New function.
12529 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12530
ab0fa4e4
PE
125312012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12532
12533 Do not limit current-time-string to years 1000..9999.
12534 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12535 (Fcurrent_time_string): Support any year that is supported by the
12536 underlying localtime representation. Don't use asctime, as it
12537 has undefined behavior for years outside the range -999..9999.
12538
7ed806a7
PE
125392012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12540
12541 Fix race conditions involving setenv, gmtime, localtime, asctime.
12542 Without this fix, interrupts could mess up code that uses these
12543 nonreentrant functions, since setting TZ invalidates existing
12544 tm_zone or tzname values, and since most of these functions return
12545 pointers to static storage.
12546 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12547 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12548 Grow the critical sections to include not just invoking
12549 localtime/gmtime, but also accessing these functions' results
12550 including their tm_zone values if any, and any related TZ setting.
12551 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
12552 so that the struct tm is saved in the critical section.
12553 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
12554 motivated by the fact that memory allocation needs to be outside
12555 the critical section.
12556
0c16dfed
DA
125572012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12558
12559 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12560 with RESET_INTERVAL.
12561
12562 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12563 Remove duplicated buffer name initialization.
12564
3f83ace8
JM
125652012-05-02 Jim Meyering <jim@meyering.net>
12566
12567 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12568
c7b8541e
JM
12569 * xfns.c (x_window): Use xstrdup (Bug#11375).
12570
90207a15 125712012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
12572
12573 * xdisp.c (pos_visible_p): If already at a newline from the
12574 display string before the 'while' loop, don't walk back the glyphs
12575 from it3.glyph_row. Solves assertion violation when the display
12576 string begins with a newline (egg.el). (Bug#11367)
12577
b593d6a9
AH
125782012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12579
12580 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12581 Move to simple.el.
12582
4737362e
GM
125832012-05-01 Glenn Morris <rgm@gnu.org>
12584
99cf43f9
GM
12585 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12586 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12587 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12588 All were removed before 23.1.
12589
9311dcff
GM
12590 * dispnew.c: Remove HAVE_LIBNCURSES test;
12591 it is always true on relevant platforms.
12592
4d5c6349
GM
12593 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12594 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12595
4737362e
GM
12596 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12597
74dd3a6b
AS
125982012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12599
12600 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12601 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12602 Remove.
12603
13c379ee
PE
126042012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12605
12606 Do not avoid creating empty evaporating overlays (Bug#9642).
12607 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12608 That is, do not delete an evaporating overlay if it becomes
12609 empty after its bounds are adjusted to fit within its buffer.
12610 This fix caused other problems, and I'm reverting it until we get
12611 to the bottom of them.
12612
a8e7d6d7 126132012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
12614
12615 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12616
a8e7d6d7 126172012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
12618
12619 * xdisp.c (pos_visible_p): If the window start position is beyond
12620 ZV, start the display from buffer beginning. Prevents assertion
12621 violation in init_iterator when the minibuffer window is scrolled
12622 via the scroll bar.
12623
12624 * window.c (window_scroll_pixel_based): Likewise.
12625
a8e7d6d7 126262012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
12627
12628 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12629
a8e7d6d7 126302012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
12631
12632 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12633 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12634
a8e7d6d7 126352012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 12636
b593d6a9
AH
12637 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12638 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 12639
1c6900d9
EZ
126402012-04-26 Eli Zaretskii <eliz@gnu.org>
12641
4c3fa1d9
EZ
12642 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12643 display element, check also the underlying string or buffer
12644 character. (Bug#11341)
12645
1c6900d9
EZ
12646 * w32menu.c: Include w32heap.h.
12647 (add_menu_item): If the call to AppendMenuW (via
12648 unicode_append_menu) fails, disable Unicode menus only if we are
12649 running on Windows 9X/Me.
12650
42bf8205
AS
126512012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12652
12653 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12654 (xgetint): Add missing shift for LSB tags.
12655
b1bac16e
MR
126562012-04-24 Martin Rudalics <rudalics@gmx.at>
12657
12658 * keyboard.c (read_char): Don't wipe echo area for select window
12659 events: These might get delayed via `mouse-autoselect-window'
12660 (Bug#11304).
12661
d69621cc
JB
126622012-04-24 Juanma Barranquero <lekktu@gmail.com>
12663
12664 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12665 manipulation of :loaded-from data.
12666
02fd101b
JB
126672012-04-23 Juanma Barranquero <lekktu@gmail.com>
12668
12669 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12670 now a cons (bug#11311).
12671
888bec30
PE
126722012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12673
89a438bd
PE
12674 Do not create empty overlays with the evaporate property (Bug#9642).
12675 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12676 if it becomes empty after its bounds are adjusted to fit within
12677 its buffer. Without this fix, in a nonempty buffer (let ((o
12678 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12679 yields an empty overlay that has the evaporate property, which is
12680 not supposed to happen.
12681
1068fe4d
PE
12682 Fix minor GTK3 problems found by static checking.
12683 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12684 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12685 (struct _EmacsFixedClass, emacs_fixed_get_type):
12686 Move decls here from emacsgtkfixed.h, since they needn't be public.
12687 (emacs_fixed_get_type): Now static.
12688 (emacs_fixed_class_init): Omit unused local.
12689 (emacs_fixed_child_type): Remove; unused.
12690 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12691 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12692 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12693 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12694 (EMACS_FIXED_GET_CLASS): Remove; unused.
12695 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12696
888bec30
PE
12697 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12698 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12699
de85e130
PE
127002012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12701
d0baac98 12702 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 12703 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
12704 (__malloc_size_t, __malloc_ptrdiff_t):
12705 Remove. All uses removed, replaced by the definiens if needed,
12706 since we can assume C89 or better now.
12707 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12708 (protect_malloc_state, align, get_contiguous_space)
12709 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12710 (malloc_atfork_handler_child, malloc_enable_thread)
12711 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12712 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12713 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12714 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12715 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12716 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12717 Define using prototypes, not old style.
12718 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12719 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12720 (align): Don't assume that signed integer overflow wraps around.
12721 Omit unused local var.
12722 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12723 (_free_internal_nolock, memalign, mallochook, reallochook):
12724 Omit no-longer-needed casts.
12725 (valloc): Use getpagesize, not __getpagesize.
12726 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12727 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12728
de85e130
PE
12729 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12730
dcbf5805
MA
127312012-04-22 Michael Albinus <michael.albinus@gmx.de>
12732
12733 Move functions from C to Lisp. Make non-blocking method calls
12734 the default. Implement further D-Bus standard interfaces.
12735
12736 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12737 (QCdbus_request_name_allow_replacement)
12738 (QCdbus_request_name_replace_existing)
12739 (QCdbus_request_name_do_not_queue)
12740 (QCdbus_request_name_reply_primary_owner)
12741 (QCdbus_request_name_reply_in_queue)
12742 (QCdbus_request_name_reply_exists)
12743 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12744 (QCdbus_registered_serial, QCdbus_registered_method)
12745 (QCdbus_registered_signal): New Lisp objects.
12746 (XD_DEBUG_MESSAGE): Use sizeof.
12747 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12748 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12749 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12750 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12751 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12752 (xd_signature, xd_append_arg): Allow float for integer types.
12753 (xd_get_connection_references): New function.
b593d6a9
AH
12754 (xd_get_connection_address): Rename from xd_initialize.
12755 Return cached address.
dcbf5805
MA
12756 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
12757 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
12758 level.
12759 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 12760 Return number of refcounts.
dcbf5805
MA
12761 (Fdbus_get_unique_name): Make stronger parameter check.
12762 (Fdbus_message_internal): New defun.
12763 (Fdbus_call_method, Fdbus_call_method_asynchronously)
12764 (Fdbus_method_return_internal, Fdbus_method_error_internal)
12765 (Fdbus_send_signal, Fdbus_register_service)
12766 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
12767 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
12768 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
12769 (Vdbus_compiled_version, Vdbus_runtime_version)
12770 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
12771 (Vdbus_message_type_method_return, Vdbus_message_type_error)
12772 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
12773 (Vdbus_registered_buses, Vdbus_registered_objects_table):
12774 Adapt docstring.
dcbf5805 12775
52828e02
PE
127762012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12777
da05bc4c
PE
12778 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
12779 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
12780 Do not assume ptrdiff_t is the same width as 'int'.
12781
52828e02
PE
12782 * alloc.c: Handle unusual debugging option combinations.
12783 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
12784 since the two debugging options are incompatible.
12785 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
12786 is defined.
12787 (mem_init, mem_insert, mem_insert_fixup):
12788 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
12789 (NEED_MEM_INSERT): Remove; no longer needed.
12790
f01769f9
LL
127912012-04-22 Leo Liu <sdl.web@gmail.com>
12792
12793 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
12794
5790543d
PE
127952012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12796
12797 * sysdep.c [__FreeBSD__]: Minor cleanups.
12798 (list_system_processes, system_process_attributes) [__FreeBSD__]:
12799 Use Emacs indenting style more consistently. Avoid some casts.
12800 Use 'double' consistently rather than mixing 'float' and 'double'.
12801
b91b7e4d
EW
128022012-04-21 Eduard Wiebe <usenet@pusto.de>
12803
b593d6a9
AH
12804 * sysdep.c (list_system_processes, system_process_attributes):
12805 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 12806
6114eb15
AS
128072012-04-21 Andreas Schwab <schwab@linux-m68k.org>
12808
12809 * lisp.mk (lisp): Update.
12810
2f38dff7
PE
128112012-04-20 Paul Eggert <eggert@cs.ucla.edu>
12812
12813 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
12814 It is never used otherwise.
12815
4ae29f89
SM
128162012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
12817
12818 * print.c (print_preprocess): Only check print_depth if print-circle
12819 is nil.
12820 (print_object): Check for cycles even when print-circle is nil and
12821 print-gensym is t, but only check print_depth if print-circle is nil.
12822
f30d612a
CY
128232012-04-20 Chong Yidong <cyd@gnu.org>
12824
12825 * process.c (wait_reading_process_output): If EIO occurs on a pty,
12826 set the status to "failed" and ensure that sentinel is run.
12827
c07a4c0b 128282012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
12829
12830 * process.c (Fset_process_inherit_coding_system_flag)
12831 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 12832 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 12833
c07a4c0b 128342012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
12835
12836 * xdisp.c (string_buffer_position_lim): Limit starting position to
12837 BEGV.
12838 (set_cursor_from_row): If called for a mode-line or header-line
12839 row, return zero immediately.
12840 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
12841 farther than the first row after the header line, if any.
12842 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
12843 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12844
c07a4c0b 128452012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12846
4ae29f89
SM
12847 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12848 (bug#11238).
ad3a2b41 12849
c07a4c0b 128502012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 128512012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
12852
12853 configure: new option --enable-gcc-warnings (Bug#11207)
12854 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12855 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12856 (ALL_CFLAGS): Use new macros rather than old.
12857 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12858 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12859 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12860 -Wunused-result, -Wunused-variable. This should go away once
12861 the Emacs and Gnulib regex code is merged.
12862 (xmalloc, xrealloc): Now static.
12863
aba027e8
PE
128642012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12865
12866 * dired.c (Fsystem_groups): Remove unused local.
12867
e5a36063
GM
128682012-04-17 Glenn Morris <rgm@gnu.org>
12869
12870 * dired.c (Fsystem_users): Doc fix.
12871
316411f0
DA
128722012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12873
12874 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12875 (syms_of_dired): Add them.
12876
9426aba4
PE
128772012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12878
b62a57be
PE
12879 Fix minor alloc.c problems found by static checking.
12880 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12881 New extern decls, to avoid calling undeclared functions.
12882 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12883 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12884 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12885 (NEED_MEM_INSERT): New macro.
12886 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 12887 Remove one incorrect comment and fix another.
b62a57be 12888
3539f31f
PE
12889 Fix minor ralloc.c problems found by static checking.
12890 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12891 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12892 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12893 (r_alloc_sbrk): Now static.
12894
a041960a
PE
12895 Improve ralloc.c interface checking.
12896 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12897 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
12898 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
12899 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
12900 [REL_ALLOC]: ... to here, to check interface.
12901 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
12902 Remove decls. This fixes an "It stinks!".
12903
9426aba4
PE
12904 * alloc.c (which_symbols): Fix alignment issue / type clash.
12905
d55c12ed
AS
129062012-04-15 Andreas Schwab <schwab@linux-m68k.org>
12907
12908 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
12909 (struct Lisp_Misc_Any): Likewise.
12910 (struct Lisp_Free): Likewise.
12911 * alloc.c (union aligned_Lisp_Symbol): Define.
12912 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
12913 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
12914 (union aligned_Lisp_Misc): Define.
12915 (MARKER_BLOCK_SIZE, struct marker_block): Use union
12916 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 12917 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 12918
b948ce8b
PE
129192012-04-14 Paul Eggert <eggert@cs.ucla.edu>
12920
12921 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
12922 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
12923 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
12924 * s/netbsd.h, s/sol2-6.h:
12925 Remove definition of GC_MARK_STACK, since the default now works.
12926 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
12927 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
12928 no longer the default.
12929 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
12930
35dc09a1 129312012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12932
35dc09a1
GM
12933 * lread.c (lisp_file_lexically_bound_p):
12934 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 12935
35dc09a1
GM
129362012-04-14 Eli Zaretskii <eliz@gnu.org>
12937
12938 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
12939 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
12940
129412012-04-14 Jan Djärv <jan.h.d@swipnet.se>
12942
12943 * nsterm.m (constrainFrameRect): Always constrain when there is only
12944 one screen (Bug#10962).
12945
bcd86815
KB
129462012-04-13 Ken Brown <kbrown@cornell.edu>
12947
12948 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
12949
c25df26e
RT
129502012-04-13 Reuben Thomas <rrt@sc3d.org>
12951
12952 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
12953
0fc59f1e
DC
129542012-04-11 Daniel Colascione <dancol@dancol.org>
12955
12956 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
12957 against is gone. It's better to use vfork now so that when Cygwin
12958 gains a new, working vfork, we use it automatically (bug#10398).
12959
de8c03dc
SM
129602012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12961
12962 * window.c (save_window_save): Obey window-point-insertion-type.
12963
2f097256
GM
129642012-04-11 Glenn Morris <rgm@gnu.org>
12965
12966 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
12967
453b951e
SM
129682012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12969
12970 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
12971
75f1671a 129722012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
12973
12974 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
12975 (force_quit_count): New var.
12976 (handle_interrupt): Use it.
12977
2a8ce227
JB
129782012-04-10 Juanma Barranquero <lekktu@gmail.com>
12979
12980 * w32.c (w32_delayed_load): Record the full path of the library
12981 being loaded (bug#10424).
12982
935396c0
GM
129832012-04-09 Glenn Morris <rgm@gnu.org>
12984
05920a43
GM
12985 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
12986 not just in the obarray, before snarfing them. (Bug#11036)
12987
935396c0
GM
12988 * Makefile.in ($(leimdir)/leim-list.el):
12989 Pass EMACS rather than BUILT_EMACS.
12990
a18ecafa
TZ
129912012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
12992
12993 * process.c (make_process):
12994 * process.h: Add integer `gnutls_handshakes_tried' member to
12995 process struct.
12996
6bbef4e5
JC
12997 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
12998 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
12999
13000 * gnutls.c (gnutls_log_function2i): Convenience log function.
13001 (emacs_gnutls_read): Use new log functions,
13002 `gnutls_handshakes_tried' process member, and
13003 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13004 attempts per process (connection).
13005
b4d3bc10
CY
130062012-04-09 Chong Yidong <cyd@gnu.org>
13007
13008 * eval.c (Fuser_variable_p, user_variable_p_eh)
13009 (lisp_indirect_variable): Functions deleted.
13010 (Fdefvar): Caller changed.
13011
13012 * callint.c (Finteractive, Fcall_interactively):
13013 * minibuf.c (Fread_variable): Callers changed.
13014
70f4d973
EZ
130152012-04-09 Eli Zaretskii <eliz@gnu.org>
13016
13017 * xdisp.c (set_cursor_from_row): If the display string appears in
13018 the buffer at position that is closer to point than the position
13019 after the display string, display the cursor on the first glyph of
13020 the display string. Fixes cursor display when a 'display' text
13021 property immediately follows invisible text. (Bug#11094)
13022
cb3c2e3e
PE
130232012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13024
13025 composite.c: use 'double' consistently
13026 * composite.c (get_composition_id): Use 'double' consistently
13027 instead of converting 'float' to 'double' and vice versa; this is
13028 easier to understand and avoids a GCC warning.
13029
fd06db5d
GM
130302012-04-09 Glenn Morris <rgm@gnu.org>
13031
50fe702a
GM
13032 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13033 preparation for dumping it with emacs. (Bug#4789)
13034 (leimdir): New variable.
13035 ($(leimdir)/leim-list.el): New rule.
13036 (emacs$(EXEEXT)): Depend on leim-list.el.
13037
fd06db5d
GM
13038 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13039 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13040 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13041
55c131ee
AS
130422012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13043
13044 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13045 proper alignment.
13046
9209588f
JB
130472012-04-07 Juanma Barranquero <lekktu@gmail.com>
13048
13049 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13050 Remove unused local variable.
13051
e3fb2efb
PE
130522012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13053
13054 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13055 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13056 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13057 objects, as mark_maybe_pointer will catch them otherwise.
13058 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13059 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13060
b5385551
PE
130612012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13062
13063 Fix typo that broke non-Windows builds.
13064 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13065
9078ead6
EZ
130662012-04-07 Eli Zaretskii <eliz@gnu.org>
13067
13068 Support building on MS-Windows with libxml2.
13069
13070 * makefile.w32-in (OBJ2): Add xml.$(O).
13071 (GLOBAL_SOURCES): Add xml.c.
13072 ($(BLD)/xml.$(O)): New dependency list.
13073
13074 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13075 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13076 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13077 [!WINDOWSNT]: New macros.
13078 (init_libxml2_functions, libxml2_loaded_p): New functions.
13079 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13080 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13081 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13082 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13083 linked in).
6bbef4e5
JC
13084 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13085 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
13086 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13087
13088 * emacs.c: Don't include libxml/parser.h.
13089 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13090 xmlCleanupParser directly.
13091
13092 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13093
3811fdf3
EZ
130942012-04-07 Eli Zaretskii <eliz@gnu.org>
13095
13096 * indent.c (Fvertical_motion): If there is a display string at
13097 point, use it.vpos to compute how many lines to backtrack after
13098 move_it_to point. (Bug#11133)
13099
2f8e16b2
EZ
131002012-04-06 Eli Zaretskii <eliz@gnu.org>
13101
13102 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13103 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13104 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13105 macros related to unification of CJK characters. For the details,
13106 see the discussion following the message here:
13107 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13108
3d439cd1
CY
131092012-04-04 Chong Yidong <cyd@gnu.org>
13110
13111 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13112
8bc53d00
EZ
131132012-04-01 Eli Zaretskii <eliz@gnu.org>
13114
13115 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13116 instead of alloca. (Bug#11138)
13117
3b0512a3
AS
131182012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13119
13120 * w32menu.c (is_simple_dialog): Properly check lisp types.
13121 (Bug#11141)
13122
8427ddd2
EZ
131232012-03-31 Eli Zaretskii <eliz@gnu.org>
13124
979022ef
EZ
13125 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13126 position we get to after a call to move_it_to fails the
13127 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13128 only if we wind up in a string from display property. (Bug#11063)
13129
a6b1c7cc
EZ
13130 * window.c (Fdelete_other_windows_internal): Invalidate the row
13131 and column information about mouse highlight, so that redisplay
13132 restores it after reallocating the glyph matrices. (Bug#7464)
13133
8427ddd2
EZ
13134 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13135 string comes from a `display' text property, use the buffer
13136 position of that property as if we actually saw that position in
13137 the row's glyphs.
697ba24b
EZ
13138 (move_it_by_lines): Remove the assertion that
13139 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13140 violated when there's a before-string at the beginning of a line.
13141 (Bug#11063)
8427ddd2 13142
65a0a738
EZ
131432012-03-30 Eli Zaretskii <eliz@gnu.org>
13144
13145 * xdisp.c (append_space_for_newline): If the default face was
13146 remapped, use the remapped face for the appended newline.
13147 (extend_face_to_end_of_line): Use the remapped default face for
13148 extending the face to the end of the line.
13149 (display_line): Call extend_face_to_end_of_line when the default
13150 face was remapped. (Bug#11068)
13151
581355cc
EZ
131522012-03-29 Eli Zaretskii <eliz@gnu.org>
13153
13154 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13155
e8fc049f
SM
131562012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13157
13158 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13159
4fb9a543
GM
131602012-03-27 Glenn Morris <rgm@gnu.org>
13161
13162 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13163 Doc fixes.
13164
679910f1
KH
131652012-03-26 Kenichi Handa <handa@m17n.org>
13166
13167 * dispextern.h (struct glyph): Fix previous change. Change the
13168 bit length of glyphless.ch to 25 (Bug#11082).
13169
90d49b7f
CY
131702012-03-26 Chong Yidong <cyd@gnu.org>
13171
13172 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13173 (command_loop_1): Use it; inhibit selection update for
13174 handle-select-window too (Bug#8996).
13175
f514f6f0
FP
131762012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13177
e8fc049f 13178 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 13179
bf43fa51
KH
131802012-03-25 Kenichi Handa <handa@m17n.org>
13181
13182 * dispextern.h (struct glyph): Change the bit length of
13183 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13184
8a0c01dd
EZ
131852012-03-24 Eli Zaretskii <eliz@gnu.org>
13186
13187 * s/ms-w32.h (tzname): Include time.h before redirecting to
13188 _tzname. Fixes the MSVC build. (Bug#9960)
13189
7d1c3a76
AS
131902012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13191
8ed79523
AS
13192 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13193 characters.
13194
7d1c3a76
AS
13195 * xterm.c (XTread_socket): Only modify handling_signal if
13196 !SYNC_INPUT. (Bug#11080)
13197
e99a9b8b
EZ
131982012-03-23 Eli Zaretskii <eliz@gnu.org>
13199
13200 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13201 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13202 when fetching a multibyte character consumes more bytes than
13203 CHAR_BYTES returns, due to unification of CJK characters in
13204 string_char. (Bug#11073)
13205
5063c0e1
TN
132062012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13207
13208 * process.c (wait_reading_process_output): Handle pty disconnect
13209 by refraining from sending oneself a SIGCHLD (bug#10933).
13210
9f851fbd
CY
132112012-03-22 Chong Yidong <cyd@gnu.org>
13212
13213 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13214
5063c0e1 13215 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
13216 Mark string as coming from a prefix property.
13217 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13218 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13219
fb5b8aca
CY
132202012-03-21 Chong Yidong <cyd@gnu.org>
13221
13222 * xfaces.c (Vface_remapping_alist): Doc fix.
13223
62356a1b
EZ
132242012-03-20 Eli Zaretskii <eliz@gnu.org>
13225
13226 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
13227 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13228 Doc fixes.
62356a1b 13229
025de85b
CY
132302012-03-20 Chong Yidong <cyd@gnu.org>
13231
13232 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13233 to reflect default non-nil value of redisplay-dont-pause.
13234
4827f94e
KH
132352012-03-19 Kenichi Handa <handa@m17n.org>
13236
13237 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13238 it fit in a valid range (Bug#11003).
13239
e50a24a2
EZ
132402012-03-18 Eli Zaretskii <eliz@gnu.org>
13241
13242 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13243 that is not from display property, accept the row as a "cursor
13244 row" if one of the string's character has a non-nil `cursor'
13245 property. Fixes cursor positioning when there are newlines in
13246 overlay strings, e.g. in icomplete.el. (Bug#11035)
13247
9af5ed87
PE
132482012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13249
13250 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13251
d1f55f16
CY
132522012-03-12 Chong Yidong <cyd@gnu.org>
13253
13254 * eval.c (inhibit_lisp_code): Rename from
13255 inhibit_window_configuration_change_hook; move from window.c.
13256
13257 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13258 * window.c (run_window_configuration_change_hook)
13259 (syms_of_window): Callers changed.
13260
66c5eebd
CY
132612012-03-11 Chong Yidong <cyd@gnu.org>
13262
413df973
CY
13263 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13264
66c5eebd
CY
13265 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13266
1de11f56
CY
132672012-03-10 Chong Yidong <cyd@gnu.org>
13268
13269 * frame.c (other_visible_frames): Don't assume the selected frame
13270 is visible (Bug#10955).
13271
cae07000
SM
132722012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13273
13274 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13275
89c94350
JD
132762012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13277
13278 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13279 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13280 zero (Bug#10954).
13281
999dd333
GM
132822012-03-03 Glenn Morris <rgm@gnu.org>
13283
01a6dcc8 13284 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 13285
de0100f2
EZ
132862012-03-02 Eli Zaretskii <eliz@gnu.org>
13287
13288 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13289 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
13290 (redisplay_window, next_element_from_string): Fix typos in
13291 comments.
3e441275
EZ
13292 (redisplay_window): Pass to move_it_vertically the margin in
13293 pixels, not in screen lines.
de0100f2 13294
96a72ee9
GM
132952012-03-02 Glenn Morris <rgm@gnu.org>
13296
13297 * buffer.c (buffer-list-update-hook): Doc fix.
13298
312508d7
EZ
132992012-02-29 Eli Zaretskii <eliz@gnu.org>
13300
13301 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13302 push_it before setting up the iterator for the first overlay
13303 string, even if we have an empty string loaded.
13304 (next_overlay_string): If there's an empty string on the iterator
13305 stack, pop the stack. (Bug#10903)
13306
27f3c637
PE
133072012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13308
13309 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13310 Suggested by Stefan Monnier in
13311 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13312 * alloc.c (widen_to_Lisp_Object): New static function.
13313 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13314 and widening them to Lisp_Objects. This would work even if
13315 USE_LSB_TAG is defined and wide integers are used, which might
13316 happen in a future version of Emacs.
13317
3c9dfce6
CY
133182012-02-25 Chong Yidong <cyd@gnu.org>
13319
fa74b241
CY
13320 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13321 Doc fix.
13322
3c9dfce6
CY
13323 * xselect.c (Fx_selection_exists_p): Doc fix.
13324 (x_clipboard_manager_save_all): Print an informative message
13325 before saving to clipboard manager.
13326
9486df08
CY
133272012-02-24 Chong Yidong <cyd@gnu.org>
13328
13329 * keyboard.c (process_special_events): Handle all X selection
13330 requests in kbd_buffer, not just the next one (Bug#8869).
13331
f01d3321
CY
133322012-02-23 Chong Yidong <cyd@gnu.org>
13333
13334 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13335 call when setting menu-bar-lines and tool-bar-lines parameters.
13336 (unwind_create_frame_1): New helper function.
13337
13338 * window.c (inhibit_window_configuration_change_hook): New var.
13339 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 13340 (syms_of_window): Initialize it.
f01d3321 13341
86b847b6
CY
133422012-02-22 Chong Yidong <cyd@gnu.org>
13343
13344 * xterm.c (x_draw_image_relief): Add missing type check for
13345 Vtool_bar_button_margin (Bug#10743).
13346
a59225b1
CY
133472012-02-21 Chong Yidong <cyd@gnu.org>
13348
13349 * fileio.c (Vfile_name_handler_alist): Doc fix.
13350
13351 * buffer.c (Fget_file_buffer): Protect against invalid file
13352 handler return value.
13353
310f5bd4
PE
133542012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13355
cb3a28cc
PE
13356 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13357 when computing $valmask.
13358
310f5bd4
PE
13359 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13360 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13361 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13362 It's useless in that case, and it can cause problems on hosts
13363 that allocate halves of EMACS_INT values separately.
13364 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13365 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13366 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13367 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13368 it avoids undefined behavior on hosts where shifting right by more
13369 than the word width has undefined behavior.
13370
2375c96a
CY
133712012-02-19 Chong Yidong <cyd@gnu.org>
13372
13373 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13374 (Funhandled_file_name_directory, Ffile_name_as_directory)
13375 (Fdirectory_file_name, Fexpand_file_name)
13376 (Fsubstitute_in_file_name): Protect against invalid file handler
13377 return values (Bug#10845).
13378
3eb49e71
EZ
133792012-02-18 Eli Zaretskii <eliz@gnu.org>
13380
13381 * .gdbinit (pitx): Fix incorrect references to fields of the
13382 iterator stack.
13383
7b926f3f
CY
133842012-02-17 Chong Yidong <cyd@gnu.org>
13385
13386 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13387
11273115
PE
133882012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13389
13390 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13391 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13392
c3a70e2b
CY
133932012-02-15 Chong Yidong <cyd@gnu.org>
13394
13395 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13396 marked as special. Also, starting docstrings with * is obsolete.
13397
0ca43699
AS
133982012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13399
13400 * gnutls.c (emacs_gnutls_write): Fix last change.
13401
2e8f3c56
LI
134022012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13403
13404 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13405 send_process.
13406
af70074f
SM
134072012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13408
13409 * keymap.c (Fsingle_key_description): Handle char ranges.
13410
95986d52
CY
134112012-02-12 Chong Yidong <cyd@gnu.org>
13412
afd83bd1
CY
13413 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13414 as that creates a dangerous corner case.
13415
95986d52
CY
13416 * window.c (Fdelete_window_internal): Invalidate the mouse
13417 highlight (Bug#9904).
13418
bd7da63e
GM
134192012-02-12 Glenn Morris <rgm@gnu.org>
13420
13421 * xselect.c (Fx_own_selection_internal)
13422 (Fx_get_selection_internal, Fx_disown_selection_internal)
13423 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13424 * nsselect.m (Fx_own_selection_internal)
13425 (Fx_disown_selection_internal, Fx_selection_exists_p)
13426 (Fx_selection_owner_p, Fx_get_selection_internal):
13427 Sync docs and argument specs with the xselect.c versions.
13428
77abcbc2
LI
134292012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13430
13431 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13432
90b671e2
EZ
134332012-02-11 Eli Zaretskii <eliz@gnu.org>
13434
1c0ca0b7
EZ
13435 * w32select.c (Fx_selection_exists_p): Sync doc string and
13436 argument list with xselect.c. (Bug#10783)
13437
13438 * w16select.c (Fx_selection_exists_p): Sync doc string and
13439 argument list with xselect.c. (Bug#10783)
90b671e2 13440
49241268
GM
134412012-02-10 Glenn Morris <rgm@gnu.org>
13442
13443 * fns.c (Fsecure_hash): Doc fix.
13444
f998bbe7 134452012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
13446
13447 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13448
0992bd9c
CY
134492012-02-07 Chong Yidong <cyd@gnu.org>
13450
13451 * buffer.c (Fbuffer_local_variables)
13452 (buffer_lisp_local_variables): Handle unbound vars correctly;
13453 don't let Qunbound leak into Lisp.
13454
af008560
GM
134552012-02-07 Glenn Morris <rgm@gnu.org>
13456
dd605cc4
GM
13457 * image.c (Fimagemagick_types): Doc fix.
13458
af008560
GM
13459 * image.c (imagemagick-render-type): Change it from a lisp object
13460 to an integer. Move the doc here from the lisp manual.
13461 Treat all values not equal to 0 the same.
13462
1449fa1d
CY
134632012-02-06 Chong Yidong <cyd@gnu.org>
13464
13465 * doc.c (store_function_docstring): Avoid applying docstring of
13466 alias to base function (Bug#2603).
13467
3723ec07
AS
134682012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13469
13470 * .gdbinit (pp1, pv1): Remove redundant defines.
13471 (pr): Use pp.
13472
79c1cc1e
CY
134732012-02-04 Chong Yidong <cyd@gnu.org>
13474
13475 * nsterm.m: Declare a global (Bug#10694).
13476
d7f29f8e
EZ
134772012-02-04 Eli Zaretskii <eliz@gnu.org>
13478
cae07000
SM
13479 * w32.c (get_emacs_configuration_options):
13480 Include --enable-checking, if specified, in the return value.
d7f29f8e 13481
3b95a6f9
MR
134822012-02-04 Martin Rudalics <rudalics@gmx.at>
13483
13484 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13485 after rounding frame sizes. (Bug#9723)
13486
d6fa96a6
EZ
134872012-02-04 Eli Zaretskii <eliz@gnu.org>
13488
13489 * keyboard.c (adjust_point_for_property): Don't position point
13490 before BEGV. (Bug#10696)
13491
df0b2940
PE
134922012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13493
13494 Handle overflow when computing char display width (Bug#9496).
13495 * character.c (char_width): Return EMACS_INT, not int.
13496 (char_width, c_string_width): Check for overflow when
13497 computing the width; this is possible now that individual
13498 characters can have unbounded width. Problem introduced
13499 by merge from Emacs 23 on 2012-01-19.
13500
6bee44d6
MA
135012012-02-02 Michael Albinus <michael.albinus@gmx.de>
13502
13503 * dbusbind.c (Fdbus_register_method): Mention the return value
13504 :ignore in the docstring.
13505
44f92739
GM
135062012-02-02 Glenn Morris <rgm@gnu.org>
13507
1b9f60cc
GM
13508 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13509
44f92739
GM
13510 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13511 Unconditionally set to t. (Bug#10673)
13512 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13513 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13514 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13515
c5d3843c
KH
135162012-02-02 Kenichi Handa <handa@m17n.org>
13517
13518 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13519 0, do not call append_composite_glyph.
13520
159462d4 135212012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
13522
13523 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13524 NULL (Bug#6988).
13525 (x_produce_glyphs): If the component of a composition is a null
13526 string, set it->pixel_width to 1 to avoid zero-width glyph.
13527
78cef877
EZ
135282012-02-01 Eli Zaretskii <eliz@gnu.org>
13529
13530 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13531 first 2 arguments are identical. This makes inserting large
13532 output from a subprocess an order of magnitude faster on
13533 MS-Windows, where all sbrk'ed memory is always contiguous.
13534
97897668
GM
135352012-01-31 Glenn Morris <rgm@gnu.org>
13536
13537 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 13538 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
13539 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13540
31fd3586
GM
135412012-01-29 Glenn Morris <rgm@gnu.org>
13542
13543 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13544
0e24a8b2
CY
135452012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13546
13547 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13548
cc0adcb0
CY
135492012-01-28 Chong Yidong <cyd@gnu.org>
13550
13551 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13552
acc28cb9
CY
135532012-01-26 Chong Yidong <cyd@gnu.org>
13554
9c69cfb7
CY
13555 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13556
acc28cb9
CY
13557 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13558 repeat counts (Bug#10507).
13559
48da7392
GM
135602012-01-26 Glenn Morris <rgm@gnu.org>
13561
13562 * lread.c (syms_of_lread): Doc fix.
13563
14af5f7f
CY
135642012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13565
13566 * coding.c (encode_designation_at_bol): Change return value to
13567 EMACS_INT.
13568
0b21c100
CY
135692012-01-25 Chong Yidong <cyd@gnu.org>
13570
13571 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13572
3c2907f7
CY
135732012-01-21 Chong Yidong <cyd@gnu.org>
13574
13575 * floatfns.c (Fcopysign): Make the second argument non-optional,
13576 since nil is not allowed anyway.
13577
959ad23f
AS
135782012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13579
13580 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13581 (send_process): Likewise.
13582
34a02f46
MR
135832012-01-19 Martin Rudalics <rudalics@gmx.at>
13584
13585 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
13586 (Vwindow_persistent_parameters): Do not use Qstate.
13587 Rewrite doc-strings.
34a02f46 13588
1259009a 135892012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
13590
13591 * character.c (char_width): New function.
70d4fdf6
GM
13592 (Fchar_width, c_string_width, lisp_string_width):
13593 Use char_width (Bug#9496).
25ed9e61 13594
6a6ee00d
MR
135952012-01-16 Martin Rudalics <rudalics@gmx.at>
13596
13597 * window.c (Vwindow_persistent_parameters): New variable.
13598 (Fset_window_configuration, save_window_save): Handle persistent
13599 window parameters.
13600
c85efaf7
EZ
136012012-01-14 Eli Zaretskii <eliz@gnu.org>
13602
13603 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13604 thrashing the stack of the thread. (Bug#9087)
13605
5944709e
PE
136062012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13607
13608 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13609
e71f5d99
EZ
136102012-01-11 Eli Zaretskii <eliz@gnu.org>
13611
13612 * xdisp.c (rows_from_pos_range): Handle the case where the
13613 highlight ends on a newline. (Bug#10464)
13614 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13615 he end column for display of highlight that ends on a newline
13616 before a R2L line.
13617
ce316182
GM
136182012-01-11 Glenn Morris <rgm@gnu.org>
13619
13620 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13621 from load-path also when installation-directory is nil. (Bug#10208)
13622
5b43da69
GM
136232012-01-10 Glenn Morris <rgm@gnu.org>
13624
74cc8ff9
GM
13625 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13626
7d8d6e4e
GM
13627 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13628 Update template values to be closer to their typical values these days.
5b43da69 13629
a0db8d43
EZ
136302012-01-09 Eli Zaretskii <eliz@gnu.org>
13631
13632 * xdisp.c (rows_from_pos_range): Accept additional argument
13633 DISP_STRING, and accept any glyph in a row whose object is that
13634 string as eligible for mouse highlight. Fixes mouse highlight of
13635 display strings from overlays. (Bug#10464)
13636
9a0115ab 136372012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 13638
b9110d6a 13639 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
13640 * fileio.c (auto_saving_dir_umask): New static var.
13641 (Fmake_directory_internal): Use it.
13642 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13643 creating the directory. The old code temporarily assigns
13644 too-generous permissions to the directory.
13645 (do_auto_save_eh): Clear it.
b9110d6a 13646 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
13647 that the var is always cleared.
13648
6c1bd3f3
EZ
136492012-01-07 Eli Zaretskii <eliz@gnu.org>
13650
13651 * search.c (scan_buffer): Pass character positions to
13652 know_region_cache, not byte positions. (Bug#6540)
13653
069d2b50
L
136542012-01-07 LynX <_LynX@bk.ru> (tiny change)
13655
13656 * w32.c (sys_rename): Report EXDEV when rename of a directory
13657 fails because the target is on another logical disk. (Bug#10284)
13658
75bf0d33
DB
136592012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13660
13661 * xterm.c (x_embed_request_focus): New function.
13662
13663 * xterm.h: Add prototype.
13664
13665 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13666
1c6e5a32
GM
136672012-01-05 Glenn Morris <rgm@gnu.org>
13668
13669 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13670
651e947e
EZ
136712012-01-01 Eli Zaretskii <eliz@gnu.org>
13672
13673 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13674 Load gnutls_transport_set_lowat only if GnuTLS version is below
13675 2.11.1.
13676 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13677 GnuTLS versions below 2.11.1.
13678
3778cdd8
AL
136792011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13680
13681 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13682 to the doc string advising against its use for altering the way
13683 windows are scrolled.
13684
0e5317f7
KH
136852011-12-28 Kenichi Handa <handa@m17n.org>
13686
13687 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13688 coding-system ASCII compatible only when it does not produce BOM
13689 on encoding (Bug#10383).
13690
93d5ca1f
JD
136912011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13692
13693 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13694 can scroll.
13695 (create_and_show_popup_menu): Always use menu_position_func for
13696 Gtk3 (Bug#10361).
13697
ca22b785
AS
136982011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13699
13700 * callint.c (Fcall_interactively): Don't truncate prompt string.
13701
d048e1e6
EZ
137022011-12-23 Eli Zaretskii <eliz@gnu.org>
13703
13704 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13705 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 13706 resumed from there (after widening). (Bug#10360)
d048e1e6 13707
5ccaba1f
JD
137082011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13709
13710 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13711
204ee57f
JD
137122011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13713
b81d40f0
JB
13714 * nsterm.m (x_free_frame_resources):
13715 Release f->output_data.ns->miniimage.
204ee57f
JD
13716 (ns_index_color): Fix indentation. Do not retain
13717 color_table->colors[i].
13718
13719 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13720 before returning.
13721
13722 * nsfns.m (x_set_background_color): Assign return value from
13723 ns_index_color to face-background instead of NSColor*.
13724 (ns_implicitly_set_icon_type): Fix indentation.
13725 Change assignment in for loop to comparison.
13726
13727 * emacs.c (ns_pool): New variable.
13728 (main): Assign ns_pool.
13729 (Fkill_emacs): Call ns_release_autorelease_pool.
13730
13731 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13732 autorelease fdesc, release fdAttrs and tdict.
13733 (ns_get_covering_families): Release charset.
13734 (ns_findfonts): Release NSFontDescriptor created with new.
13735 (ns_uni_to_glyphs): Fix indentation.
13736 (setString): Release attrStr before assigning new value.
13737
c803b2b7
JD
137382011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13739
678f4426
JD
13740 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13741 and NS_IMPL_COCOA.
13742 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13743 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13744
cd394be1 137452011-12-18 David Reitter <reitter@cmu.edu>
678f4426 13746
5fecd5fc
JD
13747 * nsterm.m (ns_term_init): Subscribe for notifications
13748 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13749 to method trackingNotification in EmacsMenu.
13750
13751 * nsmenu.m (trackingMenu): New variable.
3771cb17 13752 (trackingNotification): New method (from Aquamacs).
5fecd5fc 13753 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 13754 from Aquamacs (Bug#7030).
678f4426
JD
13755
137562011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 13757
c803b2b7
JD
13758 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
13759 (symbol_to_nsstring): Fix indentation.
13760 (ns_symbol_to_pb): New function.
cae07000
SM
13761 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
13762 (Fns_rotate_cut_buffers_internal): Remove.
13763 (Fns_store_selection_internal): Rename from
c803b2b7
JD
13764 Fns_store_cut_buffer_internal.
13765 (ns_get_foreign_selection, Fx_own_selection_internal)
13766 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
13767 (Fns_get_selection_internal, Fns_store_selection_internal):
13768 Use ns_symbol_to_pb and check if return value is nil.
13769 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
13770 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
13771 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
13772 renamed to Sns_store_selection_internal.
13773 (ns_handle_selection_request): Move code to Fx_own_selection_internal
13774 and remove this function.
13775 (ns_handle_selection_clear): Remove, never used.
13776 (Fx_own_selection_internal): Move code from ns_handle_selection_request
13777 here.
13778
e1b01a3a
KB
137792011-12-17 Ken Brown <kbrown@cornell.edu>
13780
13781 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
13782 GID is unknown (Bug#10257).
13783
2adb6e85
PE
137842011-12-17 Paul Eggert <eggert@cs.ucla.edu>
13785
13786 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
13787 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
13788 which caused a build failure on GNU/Linux IA-64. This problem was
13789 introduced by my 2011-10-07 patch.
13790
d1d7b339
JL
137912011-12-15 Juri Linkov <juri@jurta.org>
13792
13793 * image.c (imagemagick_error): New function. (Bug#10112)
13794 (imagemagick_load_image): Comment out `MagickSetResolution' call.
13795 Use `imagemagick_error' where ImageMagick functions return
13796 `MagickFalse'.
13797 (Fimagemagick_types): Add `Fnreverse' to return the list in the
13798 proper order.
13799
100d5755
KH
138002011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13801
13802 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
13803 fill background (Bug#8992).
13804
454592a6
MR
138052011-12-13 Martin Rudalics <rudalics@gmx.at>
13806
13807 * window.c (Vwindow_combination_resize)
13808 (Vwindow_combination_limit): Use t instead of non-nil in
13809 doc-strings.
61d4b438
MR
13810 (Vrecenter_redisplay): Add first sentence of doc-string on
13811 separate line.
53524d93 13812 (Frecenter): Fix doc-string typo.
454592a6 13813
3633e3aa
KH
138142011-12-11 Kenichi Handa <handa@m17n.org>
13815
13816 * coding.c (Funencodable_char_position): Pay attention to the
13817 buffer text relocation (Bug#9389).
13818
7b9d523a 138192011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 13820
7b9d523a
JD
13821 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
13822 gtk_init (Bug#10100).
13823
b73189c6
EZ
138242011-12-10 Eli Zaretskii <eliz@gnu.org>
13825
13826 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
13827 IT->string is nil. (Bug#10263)
13828
f7dfe5d6
JD
138292011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13830
83faebb4
JD
13831 * nsterm.h (x_free_frame_resources): Declare.
13832
f7dfe5d6
JD
13833 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
13834 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
13835
13836 * nsterm.h (ns_get_defaults_value): Declare.
13837
13838 * nsterm.m (ns_default): Call ns_get_defaults_value.
13839
7cd4e72c
EZ
138402011-12-09 Eli Zaretskii <eliz@gnu.org>
13841
13842 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13843 (Bug#10170)
13844
b34d7317
YM
138452011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13846
13847 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13848 that where the value of an _OBJC_* symbol points to is in the .bss
13849 section (Bug#10240).
13850
76470ad1
KH
138512011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13852
13853 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 13854 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 13855
745fff94
KH
138562011-12-08 Kenichi Handa <handa@m17n.org>
13857
13858 * ftfont.c (get_adstyle_property): Fix previous change
13859 (Bug#10233).
13860
6e44397c
JB
138612011-12-07 Juanma Barranquero <lekktu@gmail.com>
13862
13863 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13864 dirs from the default value of EMACSLOADPATH (bug#10208).
13865
7efa6272
GM
138662011-12-07 Glenn Morris <rgm@gnu.org>
13867
13868 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13869 installation and source directories as well. (Bug#10208)
13870
f6fc4d87
CY
138712011-12-06 Chong Yidong <cyd@gnu.org>
13872
13873 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13874
2bf26180
GM
138752011-12-06 Glenn Morris <rgm@gnu.org>
13876
13877 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13878 as an error, not just -1. (Bug#10217)
13879
3a6ad4f0
CY
138802011-12-05 Chong Yidong <cyd@gnu.org>
13881
13882 * keyboard.c (process_special_events): New function.
13883 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13884
75a3b399
PE
138852011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13886
13887 * coding.c (encode_designation_at_bol): Don't use uninitialized
13888 local variable (Bug#9318).
13889
c3c9e25e
KH
138902011-12-05 Kenichi Handa <handa@m17n.org>
13891
13892 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13893 return Qnil (Bug#8046, Bug#10193).
13894
5eb05ea3
KH
138952011-12-05 Kenichi Handa <handa@m17n.org>
13896
13897 * coding.c (encode_designation_at_bol): New args charbuf_end and
13898 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
13899 (coding_set_source): Return how many bytes coding->source was
13900 relocated.
13901 (coding_set_destination): Return how many bytes
13902 coding->destination was relocated.
13903 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 13904 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
13905
139062011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13907
13908 * coding.c (CODING_CHAR_CHARSET_P): New macro.
13909 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
13910 macro (Bug#9318).
13911
139122011-12-05 Andreas Schwab <schwab@linux-m68k.org>
13913
13914 The following changes are to fix Bug#9318.
13915
a79703f5 13916 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
13917 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
13918 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 13919 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 13920
7dbda6df
JB
139212011-12-05 Juanma Barranquero <lekktu@gmail.com>
13922
13923 * lisp.h (process_quit_flag): Fix external declaration.
13924
6d5eb5b0
SM
139252011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
13926
13927 Don't macro-inline non-performance-critical code.
13928 * eval.c (process_quit_flag): New function.
13929 * lisp.h (QUIT): Use it.
13930
a0c3fad0
JD
139312011-12-04 Jan Djärv <jan.h.d@swipnet.se>
13932
13933 * nsfns.m (get_geometry_from_preferences): New function.
13934 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
13935
6c07aac2
AS
139362011-12-04 Andreas Schwab <schwab@linux-m68k.org>
13937
13938 * emacs.c (Qkill_emacs): Define.
13939 (syms_of_emacs): Initialize it.
13940 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
13941 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
13942 (quit_throw_to_read_char): Add parameter `from_signal'.
13943 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
13944 * lisp.h (QUIT): Call Fkill_emacs if requested.
13945
c052ead4
JD
139462011-12-03 Jan Djärv <jan.h.d@swipnet.se>
13947
13948 * widget.c (update_wm_hints): Return if wmshell is null.
13949 (widget_update_wm_size_hints): New function.
13950
13951 * widget.h (widget_update_wm_size_hints): Declare.
13952
13953 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
13954 widget_update_wm_size_hints (Bug#10104).
13955
9e49252b
EZ
139562011-12-03 Eli Zaretskii <eliz@gnu.org>
13957
13958 * xdisp.c (handle_invisible_prop): If the invisible text ends just
13959 before a newline, prepare the bidi iterator for consuming the
13960 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 13961 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 13962
02b16839
JL
139632011-12-02 Juri Linkov <juri@jurta.org>
13964
13965 * search.c (Fword_search_regexp): New Lisp function created from
13966 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
13967 (Fword_search_backward, Fword_search_forward)
13968 (Fword_search_backward_lax, Fword_search_forward_lax):
13969 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
13970 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
13971
0068070e
SM
139722011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
13973
13974 * fileio.c (Finsert_file_contents): Move after-change-function call
13975 to before the "handled:" label, since all "goto handled" appear in
13976 cases where the *-change-functions have already been properly called
13977 (bug#10117).
13978
3360a3fc
AS
139792011-12-01 Andreas Schwab <schwab@linux-m68k.org>
13980
13981 * keyboard.c (interrupt_signal): Don't call kill-emacs when
13982 waiting for input. (Bug#10169)
13983
73d6c093
EZ
139842011-11-30 Eli Zaretskii <eliz@gnu.org>
13985
13986 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
13987 verifies glyph row's hash code--we have just reallocated the
13988 glyphs, so their contents can be complete garbage. (Bug#10164)
13989
febe6bea
JB
139902011-11-30 Juanma Barranquero <lekktu@gmail.com>
13991
13992 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
13993
801a4313
EZ
139942011-11-30 Eli Zaretskii <eliz@gnu.org>
13995
13996 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
13997 attributes are tested _before_ calling verify_row_hash, to protect
13998 against GCC re-ordering of the tests. (Bug#10164)
13999
2b56b87e
JD
140002011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14001
14002 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14003
14004 * xterm.c (handle_one_xevent): Only set async_visible and friends
14005 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 14006 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
14007 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14008
dbf31225
PE
140092011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14010
14011 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14012 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14013 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14014 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14015 All uses changed to use GCPRO1 etc.
14016 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14017 Revert to old implementation (i.e., before 2011-03-11).
14018
1305621b
YM
140192011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14020
14021 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14022 of scroll runs so as to avoid assigning disabled bogus rows and
14023 unnecessary graphics copy operations.
14024
8c9afb46
EZ
140252011-11-27 Eli Zaretskii <eliz@gnu.org>
14026
14027 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14028 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14029 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14030 (malloc, free, realloc, calloc): Redirect to e_* only when
14031 compiling Emacs.
14032
14033 * lisp.h (GCTYPEBITS): Move before first use.
14034 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14035 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14036 this macro definition.
14037
14038 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14039 _MSC_VER.
14040
54e9e3bf
JD
140412011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14042
6d5eb5b0
SM
14043 * gtkutil.c (xg_create_frame_widgets):
14044 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
14045 present with Gtk+ 2.0.
14046
83aca1cb
PE
140472011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14048
14049 * fileio.c (Finsert_file_contents): Undo previous change; see
14050 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14051
5b76caa4
PE
140522011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14053
14054 Rename locals to avoid shadowing.
14055 * fileio.c (Finsert_file_contents):
14056 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14057 * process.c (wait_reading_process_output):
14058 Rename inner 'proc' to 'p' to avoid shadowing.
14059 Indent for consistency with usual Emacs style.
14060
8c535114
EZ
140612011-11-25 Eli Zaretskii <eliz@gnu.org>
14062
14063 * xdisp.c (redisplay_window): If cursor row is not fully visible
14064 after recentering, and scroll-conservatively is set to a large
14065 number, scroll window by a few more lines to make the cursor fully
14066 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
14067 (start_display): Don't move to the next line if the display should
14068 start at a newline that is part of a display vector or an overlay
14069 string. (Bug#10119)
8c535114 14070
fa4fdb5c
JL
140712011-11-24 Juri Linkov <juri@jurta.org>
14072
14073 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14074 after the `MagickPingImage' call. (Bug#10112)
14075
90ec88df
CY
140762011-11-23 Chong Yidong <cyd@gnu.org>
14077
14078 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14079
56e2e794
MR
140802011-11-23 Martin Rudalics <rudalics@gmx.at>
14081
14082 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14083 making another buffer current. (Bug#10114)
14084
b6e64c41
GM
140852011-11-23 Glenn Morris <rgm@gnu.org>
14086
14087 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14088
6b21de18
CY
140892011-11-23 Chong Yidong <cyd@gnu.org>
14090
14091 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14092 using it (Bug#5984).
14093
b12cd789
EZ
140942011-11-22 Eli Zaretskii <eliz@gnu.org>
14095
14096 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14097 and header-lines, as they don't have one computed for them.
14098 (Bug#10098)
14099
14100 * .gdbinit (prow): Make displayed values more self-explaining.
14101 Add row's hash code.
14102
261b6fd4
LMI
141032011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14104
14105 * process.c (wait_reading_process_output): Fix asynchrounous
14106 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 14107 (wait_reading_process_output): Add comment and URL.
261b6fd4 14108
e7cfd277
JD
141092011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14110
14111 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14112
a9b9b7f5
CY
141132011-11-21 Chong Yidong <cyd@gnu.org>
14114
14115 * window.c (Fnext_window, Fprevious_window): Doc fix.
14116
b0d15b4f
SM
141172011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14118
14119 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14120
fe7a3057
JB
141212011-11-20 Juanma Barranquero <lekktu@gmail.com>
14122
14123 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14124
d2999b1a
MR
141252011-11-20 Martin Rudalics <rudalics@gmx.at>
14126
14127 * window.c (Fset_window_combination_limit): Rename argument
14128 STATUS to LIMIT.
14129 (Vwindow_combination_limit): Remove "status" from doc-string.
14130
d5ff9cd0
AS
141312011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14132
14133 * m/ibms390.h: Remove.
14134 * m/ibms390x.h: Don't include "ibms390.h".
14135
a5bb9bd3
SM
141362011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14137
14138 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14139 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14140
cd1181db
JB
141412011-11-20 Juanma Barranquero <lekktu@gmail.com>
14142
14143 * casetab.c (Fset_case_table):
14144 * charset.c (Fcharset_after): Fix typos.
14145
615a3b8d 141462011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 14147
17e845af
PE
14148 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14149 Otherwise, valgrind does not work on some platforms.
14150 Problem reported by Andreas Schwab in
6a0bf43d
PE
14151 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14152 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14153 is set, removing the need for VIRT_ADDRESS_VARIES.
14154 (PURE_P): Use a more-efficient implementation that needs just one
14155 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14156 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14157 to 4 (xorl, subq, cmpq, setbe).
14158 * alloc.c (pure): Always extern now, since that's the
14159 VIRT_ADDR_VARIES behavior.
14160 (PURE_POINTER_P): Use a single comparison, not two, for
14161 consistency with the new puresize.h.
14162 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14163 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14164 Remove VIRT_ADDR_VARIES no longer needed.
14165
f8fe6f96
EZ
141662011-11-19 Eli Zaretskii <eliz@gnu.org>
14167
14168 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14169 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14170 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14171 behave as if the cursor position were at the window margin.
14172
14173 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14174 and the cursor position is out of bounds, behave as if the cursor
14175 position were at the window margin. (Bug#10075)
14176
df05a53c
CY
141772011-11-18 Chong Yidong <cyd@gnu.org>
14178
14179 * window.c (Fwindow_combination_limit): Make first argument
14180 non-optional, since it is meaningless for live windows like the
14181 selected window.
61ccba97 14182
2071918e
DA
141832011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14184
14185 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14186
b50a28de
SM
141872011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14188
14189 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14190 (graft_intervals_into_buffer): Simplify.
14191
015137db
EZ
141922011-11-18 Eli Zaretskii <eliz@gnu.org>
14193
14194 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14195 hash values of the two rows.
14196 (copy_row_except_pointers): Preserve the used[] arrays and the
14197 hash values of the two rows. (Bug#10035)
68c95424 14198 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
14199
14200 * xdisp.c (row_hash): New function, body extracted from
14201 compute_line_metrics.
14202 (compute_line_metrics): Call row_hash, instead of computing the
14203 hash code inline.
14204
14205 * dispnew.c (verify_row_hash): Call row_hash for computing the
14206 hash code of a row, instead of duplicating code from xdisp.c.
14207
14208 * dispextern.h (row_hash): Add prototype.
14209
a2addb04
TH
142102011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14211
14212 * frame.c (delete_frame): Don't delete the terminal when the last
14213 X frame is closed if emacs is built with GTK toolkit.
14214
df85d315
JB
142152011-11-17 Juanma Barranquero <lekktu@gmail.com>
14216
14217 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14218
a0c2d0ae
MR
142192011-11-17 Martin Rudalics <rudalics@gmx.at>
14220
14221 * window.c (Vwindow_splits): Rename to
14222 Vwindow_combination_resize. Suggested by Juri Linkov.
14223 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14224 of Vwindow_splits.
14225
58179cce
JB
142262011-11-16 Juanma Barranquero <lekktu@gmail.com>
14227
7877f373
JB
14228 * nsfns.m (Fns_font_name):
14229 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 14230
b6f67890
MR
142312011-11-16 Martin Rudalics <rudalics@gmx.at>
14232
14233 * window.h (window): Rename slot "nest" to "combination_limit".
14234 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14235 (Fset_window_nest): Rename to Fset_window_combination_limit.
14236 (Vwindow_nest): Rename to Vwindow_combination_limit.
14237 (recombine_windows, make_parent_window, make_window)
14238 (Fsplit_window_internal, saved_window)
14239 (Fset_window_configuration, save_window_save): Rename all
14240 occurrences of window_nest to window_combination_limit.
14241
c7015153
JB
142422011-11-15 Juanma Barranquero <lekktu@gmail.com>
14243
14244 * image.c (imagemagick_load_image): Fix typo.
14245
322ad6ec
EZ
142462011-11-14 Eli Zaretskii <eliz@gnu.org>
14247
14248 * xdisp.c (display_line): Move the call to
14249 highlight_trailing_whitespace before the call to
14250 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
14251 faces of all the glyphs to compute ROW's hash value.
14252 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 14253
f067b8ec
JB
142542011-11-14 Juanma Barranquero <lekktu@gmail.com>
14255
14256 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14257 just return (bug#10044).
14258
1e5b2111
EZ
142592011-11-12 Eli Zaretskii <eliz@gnu.org>
14260
7ef3cbd5
EZ
14261 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14262 with user-defined heap size. Bump the default size of the temacs
14263 heap to 27MB, to avoid memory warning when running temacs.
14264 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14265
1e5b2111
EZ
14266 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14267 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
14268 (verify_row_hash) [XASSERTS]: New function.
14269 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14270 that the hash value of glyph rows is correct.
1e5b2111 14271
89d61221
MR
142722011-11-12 Martin Rudalics <rudalics@gmx.at>
14273
14274 * window.h (window): Remove splits slot.
14275 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14276 (Fdelete_other_windows_internal, make_parent_window)
14277 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14278 (Fset_window_configuration, save_window_save): Don't deal with
14279 split status of windows.
14280 (saved_window): Remove splits slot.
14281 (Vwindow_splits): Rewrite doc-string.
14282
97f18cc8
JD
142832011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14284
14285 * xfns.c (unwind_create_frame):
14286 * nsfns.m (unwind_create_frame):
14287 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14288 Vframe_list (Bug#9999).
14289
22a648b4
DA
142902011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14291
0b381c7e 14292 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 14293
659afede
KH
142942011-11-11 Kenichi Handa <handa@m17n.org>
14295
14296 * callproc.c (Fcall_process): Set the member dst_multibyte of
14297 process_coding.
14298
9ac0394b
KH
142992011-11-11 Johan Bockgård <bojohan@gnu.org>
14300
14301 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14302 avoid a crash (bug#9496).
14303
2fbdc249
CY
143042011-11-09 Chong Yidong <cyd@gnu.org>
14305
14306 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14307 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14308
ac6b1f81
PE
143092011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14310
14311 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14312
09db192c
PE
143132011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14314
14315 Avoid some portability problems by eschewing 'extern inline' functions.
14316 The trivial performance wins aren't worth the portability hassles; see
14317 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14318 et seq.
14319 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14320 (window_box_width, window_box_left, window_box_left_offset)
14321 (window_box_right, window_box_right_offset): Undo previous change,
14322 by removing the "extern"s.
14323 * intervals.c (adjust_intervals_for_insertion)
14324 (adjust_intervals_for_deletion): Undo previous change,
14325 making these static again.
14326 (offset_intervals, temp_set_point_both, temp_set_point)
14327 (copy_intervals_to_string): No longer inline.
14328 * xdisp.c (window_text_bottom_y, window_box_width)
14329 (window_box_height, window_box_left_offset)
14330 (window_box_right_offset, window_box_left, window_box_right)
14331 (window_box): No longer inline.
14332
105216ed
CY
143332011-11-08 Chong Yidong <cyd@gnu.org>
14334
14335 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
14336 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14337 Signal an error if not a live window.
105216ed
CY
14338 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14339 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14340
ae9e237f
JB
143412011-11-07 Juanma Barranquero <lekktu@gmail.com>
14342
14343 * lisp.h (syms_of_abbrev): Remove declaration.
14344 Reported by CHENG Gao <chenggao@royau.me>.
14345
c7aa8333
EZ
143462011-11-07 Eli Zaretskii <eliz@gnu.org>
14347
14348 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14349 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14350 of temacs in GUI mode.
14351
be7f5545
MR
143522011-11-07 Martin Rudalics <rudalics@gmx.at>
14353
14354 * window.h: Declare delete_all_child_windows instead of
14355 delete_all_subwindows.
14356 * window.c (Fwindow_nest, Fset_window_nest)
14357 (Fset_window_new_total, Fset_window_new_normal)
14358 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14359 (delete_all_subwindows): Rename to delete_all_child_windows.
14360 (Fdelete_other_windows_internal, Fset_window_configuration):
14361 Call delete_all_child_windows instead of delete_all_subwindows.
14362 * frame.c (delete_frame): Call delete_all_child_windows instead
14363 of delete_all_subwindows.
14364
ca78dc43
PE
143652011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14366
14367 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14368 This is also needed for porting to any host where GC_MARK_STACK is
14369 not GC_MAKE_GCPROS_NOOPS.
14370 (which_symbols): Use it.
14371
a0241d01
KH
143722011-11-07 Kenichi Handa <handa@m17n.org>
14373
14374 * coding.c (coding_set_destination): Check coding->src_pos only
14375 when coding->src_object is a buffer (bug#9910).
14376
14377 * process.c (send_process): Set the member src_multibyte of coding
14378 to 0 (bug#9911) when sending a unibyte text.
14379
14380 * callproc.c (Fcall_process): Set the member src_multibyte of
14381 process_coding to 0 (bug#9912).
14382
a64bfdfa 143832011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
14384
14385 * xmenu.c (cleanup_widget_value_tree): New function.
14386 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14387 calling free_menubar_widget_value_tree directly (Bug#9830).
14388
cb41b32a
PE
143892011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14390
14391 Fix some portability problems with 'inline'.
14392 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14393 (window_box_width, window_box_left, window_box_left_offset)
14394 (window_box_right, window_box_right_offset): Declare extern.
14395 Otherwise, these inline functions do not conform to C99 and
14396 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14397 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14398 * intervals.c (adjust_intervals_for_insertion)
14399 (adjust_intervals_for_deletion): Now extern, because otherwise the
14400 extern inline functions 'offset_intervals' couldn't refer to it.
14401 (static_offset_intervals): Remove.
14402 (offset_intervals): Rewrite using the old contents of
14403 static_offset_intervals. The old version didn't conform to C99
14404 because an extern inline function contained a reference to an
14405 identifier with static linkage.
14406
b7041366
AS
144072011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14408
14409 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14410 GC.
14411
88a37c4d
EZ
144122011-11-06 Eli Zaretskii <eliz@gnu.org>
14413
14414 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14415 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14416 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14417 return Qleft_to_right.
14418
49745b39
CY
144192011-11-06 Chong Yidong <cyd@gnu.org>
14420
14421 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14422 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14423 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14424 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14425 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14426 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14427 (Fwindow_vscroll): Doc fix.
14428 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14429 argument, since it makes no sense to pass a live window and for
14430 consistency with window-child.
14431
1f05cd82
CS
144322011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14433
14434 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14435 support MSVC.
14436
22610910
JR
144372011-11-05 Jason Rumney <jasonr@gnu.org>
14438
14439 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14440 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14441 fonts (Bug#6029).
14442 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14443 bitwise arithmetic preventing use of unicode-sip and non-truetype
14444 opentype fonts.
14445
a06776b2
EZ
144462011-11-05 Eli Zaretskii <eliz@gnu.org>
14447
3ad924ba
EZ
14448 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14449 "emacs"-only part.
14450
a06776b2
EZ
14451 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14452 initialization code to keep similarity to xfns.c after changes
14453 from 2011-11-05.
14454
c9e7db78
JD
144552011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14456
a97f8f3f
JD
14457 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14458 (unwind_create_frame): New function (Bug#9943).
14459 (Fx_create_frame): Restructure code to be more similar to the one in
14460 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14461 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14462 Move terminal->reference_count++ just before making the frame official
14463 (Bug#9943).
14464
14465 * nsterm.m (x_free_frame_resources): New function.
14466 (x_destroy_window): Move code to x_free_frame_resources.
14467
c9e7db78 14468 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
14469 (Fx_create_frame, x_create_tip_frame):
14470 Move terminal->reference_count++ just before making the frame
75f1671a 14471 official. Move initialization of image_cache_refcount and
c9e7db78
JD
14472 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14473
a6fc3b5c
EZ
144742011-11-05 Eli Zaretskii <eliz@gnu.org>
14475
14476 Support MSVC build with newer versions of Visual Studio.
14477 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14478 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14479 nt/gmake.defs.
14480
14481 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14482 which are not supported by MSVC.
14483 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14484 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14485 bitfields.
14486 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14487 types in bitfields.
14488 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14489
14490 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14491
58179cce 144922011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
14493
14494 Support MSVC build with newer versions of Visual Studio.
14495 * w32.c: Don't include w32api.h for MSVC.
14496 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14497
14498 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14499 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14500 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14501 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14502 e_* cousins.
14503 (alloca) [_MSC_VER]: Define to _alloca.
14504
14505 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14506
14507 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14508
a58c13ed
EZ
145092011-11-04 Eli Zaretskii <eliz@gnu.org>
14510
14511 * xdisp.c (note_mouse_highlight): If either of
14512 previous/next-single-property-change returns nil, treat that as
14513 the beginning or the end of the buffer. (Bug#9955)
14514
fe0b6370
JD
145152011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14516
a58c13ed 14517 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
14518 label is not null (Bug#9951).
14519 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14520 may be NULL.
14521
89bd5ee1
EZ
145222011-11-04 Eli Zaretskii <eliz@gnu.org>
14523
14524 * window.c (Fwindow_body_size): Mention in the doc string that the
14525 return value is in frame's canonical units. (Bug#9949)
14526
84c3edb9
EZ
145272011-11-03 Eli Zaretskii <eliz@gnu.org>
14528
4e2fb5c7
EZ
14529 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14530
84c3edb9 14531 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 14532 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 14533 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 14534
bc17a887
EZ
145352011-11-01 Eli Zaretskii <eliz@gnu.org>
14536
14537 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14538 Don't stop backward scan on the continuation glyph, even though
14539 its CHARPOS is positive.
6d5eb5b0
SM
14540 (mouse_face_from_buffer_pos, note_mouse_highlight):
14541 Rename cover_string to disp_string.
bc17a887 14542
4ee88440
MR
145432011-11-01 Martin Rudalics <rudalics@gmx.at>
14544
14545 * window.c (temp_output_buffer_show): Don't use
14546 Vtemp_buffer_show_specifiers.
14547 (Vtemp_buffer_show_specifiers): Remove unused variable.
14548
c2ff3c02
EZ
145492011-10-30 Eli Zaretskii <eliz@gnu.org>
14550
14551 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14552 past the beginning of the current glyph matrix.
14553
58179cce 145542011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
14555
14556 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14557 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14558 HAVE_GTK3 (Bug#9869).
b77a6a7f 14559
3b574623
JD
14560 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14561 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14562
b77a6a7f
JD
14563 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14564
14565 * xterm.c: Declare x_handle_net_wm_state to return int.
14566 (handle_one_xevent): Check if we are iconified but don't have
14567 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14568 (get_current_wm_state): Return non-zero if not hidden,
14569 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14570 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14571 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14572 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14573
196e41e4
PE
145742011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14575
14576 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14577 so that this new function doesn't get optimized away by a
14578 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14579
021f2e1a
AS
145802011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14581
14582 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14583
8b058d44
EZ
145842011-10-29 Eli Zaretskii <eliz@gnu.org>
14585
14586 Fix the `xbytecode' command.
14587 * .gdbinit (xprintbytestr): New command.
b50a28de 14588 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
14589 (xbytecode): Print the byte-code string as well.
14590
4452fb80
EZ
145912011-10-29 Kim Storm <storm@cua.dk>
14592
8b058d44
EZ
14593 * alloc.c (which_symbols): New function.
14594
21b72067
AS
145952011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14596
14597 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14598 line. (Bug#9903)
14599
83ed7b5c
GM
146002011-10-29 Glenn Morris <rgm@gnu.org>
14601
14602 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14603 Not clear what it was for, and it causes various bugs. (Bug#9839)
14604
5a7a728b
EZ
146052011-10-28 Eli Zaretskii <eliz@gnu.org>
14606
14607 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14608 possible random value that matches one of those tested as
14609 condition to clear the mouse face.
14610
d3d0842f
CY
146112011-10-28 Chong Yidong <cyd@gnu.org>
14612
14613 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14614
31b39d13
DN
146152011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14616
14617 * window.c (make_window): Initialize phys_cursor_on_p.
14618
9aba6043
SM
146192011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14620
14621 * lisp.h (struct Lisp_Symbol): Update comments.
14622
c20992f4
JB
146232011-10-28 Juanma Barranquero <lekktu@gmail.com>
14624
14625 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14626
db4f02f2
EZ
146272011-10-28 Eli Zaretskii <eliz@gnu.org>
14628
14629 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14630 <oslsachem@gmail.com> for helping to debug this.
14631
14632 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14633 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14634 (g_b_init_get_glyph_outline_w): New static variables.
14635 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14636 (GetGlyphOutlineW_Proc): New typedefs.
14637 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
14638 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14639 New functions.
14640 (w32font_open_internal, compute_metrics):
14641 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
14642 instead of calling the "wide" APIs directly.
14643
14644 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14645
14646 * w32.h (syms_of_w32font): Add prototype.
14647
87e68db4
JB
146482011-10-27 Juanma Barranquero <lekktu@gmail.com>
14649
14650 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14651 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14652 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14653 (Fmove_to_window_line): Doc fix.
14654
435c1d67
CY
146552011-10-27 Chong Yidong <cyd@gnu.org>
14656
14657 * process.c (make_process): Set gnutls_state to NULL.
14658
14659 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14660 non-NULL, regardless of GNUTLS_INITSTAGE.
14661 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14662 an error. Set process slots as soon as we allocate them.
14663
14664 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14665
9c6c6f49
CY
146662011-10-27 Chong Yidong <cyd@gnu.org>
14667
9aba6043
SM
14668 * gnutls.c (emacs_gnutls_deinit): New function.
14669 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
14670 (Fgnutls_deinit, Fgnutls_boot): Use it.
14671
14672 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14673 (deactivate_process): Call emacs_gnutls_deinit.
14674
657d08d3
JB
146752011-10-27 Juanma Barranquero <lekktu@gmail.com>
14676
14677 * image.c (x_create_x_image_and_pixmap):
14678 * w32.c (sys_rename, w32_delayed_load):
14679 * w32font.c (fill_in_logfont):
14680 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14681
5430d399
JB
146822011-10-26 Juanma Barranquero <lekktu@gmail.com>
14683
14684 * w32fns.c (w32_default_color_map): New function,
14685 extracted from Fw32_default_color_map.
a7ef684b 14686 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 14687
fe0055fa
PE
146882011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14689
14690 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14691
e6346438
SM
146922011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14693
14694 * keyboard.c (test_undefined): New function (bug#9751).
14695 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14696
e112cc37
ET
146972011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14698
14699 * sysdep.c (init_sys_modes): Fix the check for the controlling
14700 terminal (Bug#6649).
14701
7b5d6677
EZ
147022011-10-20 Eli Zaretskii <eliz@gnu.org>
14703
14704 * dispextern.h (struct bidi_it): New member next_en_type.
14705
14706 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14707 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14708 current character, check also for next_en_type being WEAK_EN.
14709 (bidi_resolve_weak): Don't enter the expensive loop if the current
14710 position is before next_en_pos. Record the bidi type of the first
14711 non-ET, non-BN character we find, in addition to its position.
14712 (bidi_level_of_next_char): Invalidate next_en_type when
14713 next_en_pos is over-stepped.
14714
7da0b018
PE
147152011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14716
14717 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14718 * editfns.c: Rewrite current-time-zone so that it invokes
14719 the equivalent of (format-time-string "%Z") to get the time zone name.
14720 This fixes a bug when the time zone name contains characters that
14721 need converting from the system time locale to Emacs internal format.
14722 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14723 that patch fixed format-time-string to do the conversion, but
14724 I forgot to fix current-time-zone.
14725 (format_time_string): New function, containing most of
14726 what Fformat_time_string used to contain.
14727 (Fformat_time_string): Rewrite in terms of format_time_string.
14728 This doesn't change this function's behavior.
14729 (current-time-zone): Rewrite to use format_time_string.
14730 This fixes the bug reported by Michael Schierl in
14731 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14732 Jason Rumney's 2007-06-07 change worked around this bug, but
14733 didn't fix it.
14734 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14735
8547b010
EZ
147362011-10-19 Eli Zaretskii <eliz@gnu.org>
14737
14738 * xdisp.c (start_display): If the character at POS is displayed
14739 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
14740 (try_window_reusing_current_matrix): If a line ends in a display
14741 vector or the next line starts in a display vector, continue
14742 redrawing the window even though the character position of
14743 start_row was reached.
8547b010
EZ
14744 (Bug#9771, part 2)
14745
4e948d15
CY
147462011-10-18 Chong Yidong <cyd@gnu.org>
14747
14748 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14749 with nobreak-char-display too.
14750
4787455f
EZ
147512011-10-18 Eli Zaretskii <eliz@gnu.org>
14752
14753 Fix part 3 of bug#9771.
14754 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
14755 (bidi_resolve_neutral): Don't enter the expensive loop looking for
14756 non-neutral characters if the current character is a paragraph
14757 separator (a.k.a. Newline). This avoids running the same
14758 expensive loop twice, once when we consume the preceding newline
14759 and the other time when the line actually needs to be displayed.
14760 Avoid the loop when we see neutrals on the base embedding level
14761 following a character whose directionality is the same as the
14762 paragraph's. This avoids running the expensive loop when a line
14763 ends in a long sequence of neutrals, like control characters.
14764 Add assertion against STRONG_AL type. Slightly rearrange code
14765 that determines the type of a neutral given the first non-neutral
14766 that follows it.
14767 (bidi_level_of_next_char): Set next_en_pos to zero when
14768 invalidating its info.
14769
2c91f553
EZ
147702011-10-17 Eli Zaretskii <eliz@gnu.org>
14771
14772 * xdisp.c (push_display_prop): Determine whether to record string
14773 or buffer position by IT->string, not by IT->method. Allow
14774 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
14775 (move_it_vertically_backward): Don't look for character position
14776 immediately after the newline when in a continuation line.
14777 (Bug#9771, part 1)
2c91f553 14778
c7b08b0d
MR
147792011-10-15 Martin Rudalics <rudalics@gmx.at>
14780
14781 * window.c (coordinates_in_window): Rewrite and delabelize
14782 vertical border check. (Bug#5357) (Bug#9618)
14783
6b02f655
SM
147842011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
14785
14786 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
14787 errors in XSetWindowBorder (bug#9310).
14788
81d40c92
DA
147892011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
14790
14791 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
14792 avoid crash when xmalloc overrun checking is enabled.
14793
d4172c3b
EZ
147942011-10-13 Eli Zaretskii <eliz@gnu.org>
14795
14796 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
14797 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
14798 cursor motion with <left> and <right> arrow keys.
14799
14800 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
14801 some callers set that themselves.
14802
b00eea75
EZ
148032011-10-12 Eli Zaretskii <eliz@gnu.org>
14804
14805 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
14806 display string and the previous row comes from the same string and
14807 is empty. (Bug#9739) (Bug#9738)
14808
8fe012c4
SM
148092011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
14810
14811 * doc.c (get_doc_string): Encode file name (bug#9735).
14812
0074aef2
EZ
148132011-10-12 Eli Zaretskii <eliz@gnu.org>
14814
79beb178
EZ
14815 * bidi.c (bidi_level_of_next_char):
14816 * xdisp.c (get_visually_first_element): Remove old incorrect
14817 comments regarding the Unicode Line Separator character.
14818
0074aef2
EZ
14819 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
14820
6e4b3fbe
DA
148212011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
14822
14823 * alloc.c (Fgc_status): Do not access beyond zombies array
14824 boundary if nzombies > MAX_ZOMBIES.
14825 * alloc.c (dump_zombies): Add missing format specifier.
14826
0324f3af
PE
148272011-10-12 Paul Eggert <eggert@cs.ucla.edu>
14828
b5525cac
PE
14829 * xdisp.c (set_cursor_from_row): Simplify conditionals,
14830 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
14831
0324f3af
PE
14832 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
14833 Some packages use them to denote characters with modifiers.
14834
e9b5f888
AS
148352011-10-11 Andreas Schwab <schwab@linux-m68k.org>
14836
14837 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
14838 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14839 matching a pp-number. Rename parameter var to var1.
14840
127827c0
SM
148412011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14842
14843 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14844
c8fd3bd0
GM
148452011-10-08 Glenn Morris <rgm@gnu.org>
14846
14847 * callint.c (Fcall_interactively): Give a more explicit error for the
14848 'c' case with a non-character input. (Bug#8479)
14849
352ec8ff
EZ
148502011-10-08 Eli Zaretskii <eliz@gnu.org>
14851
03669ccb
EZ
14852 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14853 lines.
7061c986
EZ
14854 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14855 lines that are hscrolled on the left.
03669ccb 14856
352ec8ff
EZ
14857 * dispnew.c (buffer_posn_from_coords): Account for a possible
14858 presence of header-line. (Bug#4426)
14859
a66cfb1c
SM
148602011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14861
6b02f655
SM
14862 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14863 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 14864
7c5ee88e
PE
148652011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14866
14867 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14868 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14869 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14870 this makes Emacs dump core during garbage collection on rare
14871 occasions. sizeof is obviously inferior to offsetof here, so
14872 stick with offsetof.
14873 (GC_POINTER_ALIGNMENT): New macro.
14874 (mark_memory): Omit 3rd (offset) arg; caller changed.
14875 Don't assume EMACS_INT alignment is the same as pointer alignment.
14876
df1bbe5b
SM
148772011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14878
14879 * keyboard.c (read_key_sequence_remapped): New var.
14880 (read_key_sequence): Compute remapping in the right buffer.
14881 (command_loop_1): Use read_key_sequence's remapping directly.
14882
51553db6
SM
148832011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14884
32c1fffd
SM
14885 * dired.c (file_name_completion): Don't expand file name.
14886 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14887 before checking file name handler.
14888
51553db6
SM
14889 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14890 they've been requested explicitly (bug#9591).
14891
b6bd1599 148922011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
14893
14894 * keymap.c (Fsingle_key_description): Use make_specified_string
14895 instead of build_string to build string from push_key_description.
14896 (Bug#5193)
14897
f701dc2a
PE
148982011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14899
4222c55d
PE
14900 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
14901 This fixes a Y2038 bug on 64-bit hosts.
14902 * buffer.c (reset_buffer):
14903 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
14904 (Fclear_buffer_auto_save_failure):
14905 Use 0, not -1, to represent an unset failure time, since time_t
14906 might not be signed.
14907
f701dc2a
PE
14908 Remove dependency on glibc malloc internals.
14909 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14910 Move back here from lisp.h, but with their new implementations.
14911 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14912 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
14913 * charset.c (charset_table_init): New static var.
14914 (syms_of_charset): Use it instead of xmalloc. This removes a
14915 dependency on glibc malloc internals. See Eli Zaretskii's comment in
14916 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
14917 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14918 Move back to alloc.c.
14919 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14920 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
14921
9ceebf39
JD
149222011-09-30 Jan Djärv <jan.h.d@swipnet.se>
14923
14924 * nsterm.m (windowDidResize): Call x_set_window_size only when
14925 ns_in_resize is true. Otherwise set pixelwidth/height and
14926 call change_frame_size (Bug#9628).
14927
cb993c58
PE
149282011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14929
3930c88b
PE
14930 Port --enable-checking=all to Fedora 14 x86-64.
14931 * charset.c (syms_of_charset): Also account for glibc malloc's
14932 internal overhead when calculating the initial malloc maximum.
14933
cb993c58
PE
14934 Port --enable-checking=all to Fedora 14 x86.
14935 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14936 Move to lisp.h.
14937 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
14938 (overrun_check_realloc, overrun_check_free):
14939 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
14940 That way, xmalloc returns a properly-aligned pointer even if
14941 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
14942 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
14943 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
14944 into account when calculating the initial malloc maximum.
14945 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14946 Move here from alloc.c, so that charset.c can use it too.
14947 Properly align; the old code wasn't right for common 32-bit hosts
14948 when configured with --enable-checking=all.
14949 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14950 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
14951
31bed486
EZ
149522011-09-29 Eli Zaretskii <eliz@gnu.org>
14953
04c70788 14954 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
14955 use EDOM.
14956
fbcaa2f3
EZ
149572011-09-28 Eli Zaretskii <eliz@gnu.org>
14958
14959 * xdisp.c (compute_display_string_end): If there's no display
14960 string at CHARPOS, return -1.
14961
14962 * bidi.c (bidi_fetch_char): When compute_display_string_end
14963 returns a negative value, treat the character as a normal
14964 character not covered by a display string. (Bug#9624)
14965
a239d4e9
JB
149662011-09-28 Juanma Barranquero <lekktu@gmail.com>
14967
14968 * lread.c (Fread_from_string): Fix typo in docstring.
14969
88652fd5
EZ
149702011-09-27 Eli Zaretskii <eliz@gnu.org>
14971
14972 * xdisp.c (handle_invisible_prop): If invisible text ends on a
14973 newline, reseat the iterator instead of bidi-iterating there one
14974 character at a time. (Bug#9610)
32c1fffd
SM
14975 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
14976 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 14977
ed497dd4
AS
149782011-09-27 Andreas Schwab <schwab@linux-m68k.org>
14979
14980 * lread.c (readevalloop): Use correct code for NBSP.
14981 (read1): Likewise. (Bug#9608)
14982
b2bf61aa
MA
149832011-09-25 Michael Albinus <michael.albinus@gmx.de>
14984
14985 * dbusbind.c (Fdbus_register_signal): When service is not
14986 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
14987
32bbb17c
GM
149882011-09-25 Glenn Morris <rgm@gnu.org>
14989
14990 * buffer.c (truncate-lines): Doc fix.
14991
94e0933e
CY
149922011-09-24 Chong Yidong <cyd@stupidchicken.com>
14993
14994 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
14995 (Fset_window_next_buffers): Doc fix.
14996
cddde921
GM
149972011-09-24 Glenn Morris <rgm@gnu.org>
14998
14999 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15000
1260aef1
PE
150012011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15002
25b4bfa0
PE
15003 Fix minor problems found by static checking.
15004 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
15005 * indent.c (Fvertical_motion): Fix == vs = typo.
15006
e3cbd34b
EZ
150072011-09-24 Eli Zaretskii <eliz@gnu.org>
15008
a66cfb1c
SM
15009 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15010 Default value is now t. Doc fix.
6bf7006f 15011
e3cbd34b 15012 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 15013 logic when moving up, not only when moving down. Fix the
e3cbd34b 15014 confusing name and values of the it_overshoot_expected variable;
32c1fffd 15015 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
15016
15017 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15018 CHARPOS is covered by a display string which includes newlines.
15019 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15020 is covered by a display string with embedded newlines.
15021
a3de0cbd
MA
150222011-09-24 Michael Albinus <michael.albinus@gmx.de>
15023
15024 * dbusbind.c (Fdbus_register_signal): Add match rule to
15025 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
15026 (Fdbus_register_method, Vdbus_registered_objects_table):
15027 Fix docstring.
a3de0cbd 15028
b260039d
JM
150292011-09-24 Jim Meyering <meyering@redhat.com>
15030
32c1fffd 15031 do not ignore write error for any output size
b260039d
JM
15032 The previous change was incomplete.
15033 While it makes emacs --batch detect the vast majority of stdout
15034 write failures, errors were still ignored whenever the output size is
15035 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15036 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15037 && echo FAIL: ignored write error
15038 FAIL: ignored write error
15039 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15040 && echo FAIL: ignored write error
15041 FAIL: ignored write error
15042 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15043
8eca8a7c
AS
150442011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15045
15046 * emacs.c (Fkill_emacs): In noninteractive mode exit
15047 non-successfully if a write error occurred on stdout. (Bug#9574)
15048
3341db62
EZ
150492011-09-21 Eli Zaretskii <eliz@gnu.org>
15050
15051 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15052 the xassert test.
15053
15054 * dispextern.h (struct it): Update the comment documenting what
15055 can it->OBJECT be.
15056
8c203dbf
EZ
150572011-09-20 Eli Zaretskii <eliz@gnu.org>
15058
15059 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15060 a display string, extend search for cursor position to end of row.
15061 (find_row_edges): If the row ends in a newline from a display
15062 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15063 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
15064 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15065 non-empty line. Fixes confusing cursor motion with arrow keys at
15066 the beginning of a line that starts with whitespace.
8c203dbf 15067
a4824228
LMI
150682011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15069
15070 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15071 (bug#9493).
15072
33ed493b
CY
150732011-09-18 Chong Yidong <cyd@stupidchicken.com>
15074
15075 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15076 boolean (Bug#9154).
15077
56cd55c8
EZ
150782011-09-18 Eli Zaretskii <eliz@gnu.org>
15079
15080 * xdisp.c (display_line): Record maximum and minimum buffer
15081 positions even if no glyphs were produced (e.g., by a zero-width
15082 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15083 buffer positions that will be removed from the glyph row because
15084 they don't fit.
c02dcedf
EZ
15085 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15086 column is beyond frame width: don't subtract 1 "pixel" when
15087 computing width of the stretch.
3e62b7e0
EZ
15088 (reseat_at_next_visible_line_start): Undo the change made on
15089 2011-09-17 that saved paragraph information and restored it after
15090 the call to `reseat'. (Bug#9545)
56cd55c8 15091
5ed99d36 150922011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
15093
15094 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15095 and turn window cursor on if cleared (Bug#9415).
15096
5ed99d36 150972011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
15098
15099 * search.c (boyer_moore): Take unibyte characters from pattern
15100 literally. (Bug#9458)
15101
9bade7b2
EZ
151022011-09-18 Eli Zaretskii <eliz@gnu.org>
15103
15104 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15105
e5e9d610
PE
151062011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15107
87e4427a
PE
15108 Fix minor problem found by static checking.
15109 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15110 initialized, to pacify gcc -Wuninitialized.
15111
e5e9d610
PE
15112 * fileio.c: Report proper errno when syscall falls.
15113 (Finsert_file_contents): Save and restore errno,
15114 so that report_file_error outputs the correct diagnostic.
15115 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15116
a1674f0b
EZ
151172011-09-18 Eli Zaretskii <eliz@gnu.org>
15118
15119 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15120
fbfb6dd4
EZ
151212011-09-17 Eli Zaretskii <eliz@gnu.org>
15122
15123 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15124 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15125
bb187662
EZ
151262011-09-17 Eli Zaretskii <eliz@gnu.org>
15127
1137e8b8 15128 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 15129 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
15130
15131 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15132 (bidi_find_paragraph_start): Search back for paragraph beginning
15133 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15134 (bidi_move_to_visually_next): Only trigger paragraph-related
15135 computations when the last character is a newline or at EOB, not
15136 just any NEUTRAL_B. (Bug#9470)
15137
bb187662
EZ
15138 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15139 truncated lines if point is covered by a display string. (Bug#9524)
15140
2e621251
PE
151412011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15142
15143 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15144 (cons_to_x_long): New function.
15145 (lisp_data_to_selection_data): Use it. Correct the test for
15146 short-versus-long data; it was negated. Break out of vector
15147 loop, for efficiency, when a long datum is discovered.
15148
91a15bc6
SM
151492011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15150
15151 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15152
b41c3a35
EZ
151532011-09-16 Eli Zaretskii <eliz@gnu.org>
15154
15155 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15156 GCC PR/17406) by declaring this function with external scope.
15157
7812ba2d
PE
151582011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15159
15160 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15161 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15162
cf7edc2a
AS
151632011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15164
15165 * editfns.c (Fformat): Correctly handle text properties on "%%".
15166
bd01620e
EZ
151672011-09-15 Eli Zaretskii <eliz@gnu.org>
15168
15169 * xterm.c (x_draw_composite_glyph_string_foreground):
15170 * w32term.c (x_draw_composite_glyph_string_foreground):
15171 * term.c (encode_terminal_code):
15172 * composite.c (composition_update_it, get_composition_id):
15173 * xdisp.c (get_next_display_element)
15174 (fill_composite_glyph_string): Add comments about special meaning
15175 of TAB characters in a composition.
15176
a02719a3
PE
151772011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15178
15179 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
15180 This occurs when processing a multibyte format.
15181 Problem reported by Wolfgang Jenker.
a02719a3 15182
72589a3c
JB
151832011-09-15 Johan Bockgård <bojohan@gnu.org>
15184
15185 * xdisp.c (try_cursor_movement): Only check for exact match if
15186 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15187
1c14176c
PE
151882011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15189
15190 Remove unused external symbols.
15191 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15192 * xdisp.c (calc_pixel_width_or_height): Now static.
15193 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15194 * indent.c (check_display_width):
15195 * w32term.c: Fix comment to match code.
15196 * xterm.c, xterm.h (x_catching_errors): Remove.
15197
d2eea5b5
PE
151982011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15199
15200 * xselect.c: Use signed conversions more consistently (Bug#9498).
15201 (selection_data_to_lisp_data): Assume incoming selection data are
15202 signed integers, not unsigned. This is to be consistent with
15203 outgoing selection data, which was modified to use signed integers
15204 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15205 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15206 expects long, not unsigned long.
15207
46888499
EZ
152082011-09-14 Eli Zaretskii <eliz@gnu.org>
15209
15210 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15211 computation of loop end. Reported by Johan Bockgård
15212 <bojohan@gnu.org>.
15213
ef8ef9fb
CY
152142011-09-13 Chong Yidong <cyd@stupidchicken.com>
15215
15216 * frame.c (Fother_visible_frames_p): Function deleted.
15217
fa819fed
EZ
152182011-09-12 Eli Zaretskii <eliz@gnu.org>
15219
15220 * indent.c (compute_motion): Process display vector front to back
15221 rather than the other way around. (Bug#2496)
15222
2ba8e008
SM
152232011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15224
15225 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15226
20f53c69
CY
152272011-09-11 Chong Yidong <cyd@stupidchicken.com>
15228
15229 * minibuf.c (Fread_from_minibuffer): Doc fix.
15230
d562d7a4
EZ
152312011-09-11 Eli Zaretskii <eliz@gnu.org>
15232
15233 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15234 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15235
1c4d7f3d
LMI
152362011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15237
15238 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15239 value for non-existent files.
15240
b885bf36
EZ
152412011-09-11 Eli Zaretskii <eliz@gnu.org>
15242
15243 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15244 set its "size" to -1. This will set the modtime_size field of
15245 the corresponding buffer to -1, which is what
15246 verify-visited-file-modtime expects for files that do not exist.
15247 (Bug#9139)
15248
6612f0bf
PE
152492011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15250
15251 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15252 here ...
15253 * lisp.h: ... from here. push_key_description is no longer
15254 defined in keyboard.c, so its declaration should not be in
15255 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15256 logically belongs with push_key_description.
15257
dfb3f755
PE
152582011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15259
15260 * buffer.h: Include <sys/types.h> instead of <time.h>.
15261 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15262 Problem reported by Herbert J. Skuhra.
15263
3134906c
LMI
152642011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15265
15266 * xml.c (parse_region): Make the parsing work for
15267 non-comment-starting XML files again (bug#9144).
15268
8d903f4e
AS
152692011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15270
15271 * image.c (gif_load): Fix calculation of bottom and right corner.
15272 (Bug#9468)
15273
80ad64f4
EZ
152742011-09-10 Eli Zaretskii <eliz@gnu.org>
15275
15276 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15277 redisplay in small windows.
15278
208a048d
EZ
152792011-09-09 Eli Zaretskii <eliz@gnu.org>
15280
15281 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15282
9b1c252e
MR
152832011-09-08 Martin Rudalics <rudalics@gmx.at>
15284
15285 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15286 Operate on live windows only.
15287
2949f33b
JB
152882011-09-08 Juanma Barranquero <lekktu@gmail.com>
15289
15290 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15291
e08dcafd
EZ
152922011-09-07 Eli Zaretskii <eliz@gnu.org>
15293
15294 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15295 only under bidi iteration.
15296
115b96bd
JD
152972011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15298
15299 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15300
c8199d0f
PE
153012011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15302
15303 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15304 Without this fix, the command to link temacs failed due to an
15305 undefined symbol __builtin_isnan. This is because
15306 /usr/include/iso/math_c99.h #defines isnan(x) to
15307 __builtin_isnan(x), but the bundled gcc, which identifies itself
15308 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15309 a __builtin_isnan.
15310 * floatfns.c (isnan): #undef, and then #define to a clone of
15311 what's in data.c.
15312 (Fisnan): Always define, since it's always available now.
15313 (syms_of_floatfns): Always define isnan at the Lisp level.
15314
e39b275c 153152011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
15316
15317 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15318
b2db44d9 153192011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 15320
f4af5137 15321 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
15322 The previous code assumed that file offsets (off_t values) fit in
15323 EMACS_INT variables, which is not true on typical 32-bit hosts.
15324 The code messed up by falsely reporting buffer overflow in cases
15325 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15326 when "big" contains more than 2**29 bytes, even though this
15327 inserts just one byte and does not overflow the buffer.
15328 (Finsert_file_contents): Store file offsets as off_t
15329 values, not as EMACS_INT values. Check for overflow when
15330 converting between EMACS_INT and off_t. When checking for
15331 buffer overflow or for overlap, take the offsets into account.
15332 Don't use EMACS_INT for small values where int suffices.
15333 When checking for overlap, fix a typo: ZV was used where
15334 ZV_BYTE was intended.
15335 (Fwrite_region): Don't assume off_t fits into 'long'.
15336 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15337
ecfc0a49
MA
153382011-09-05 Michael Albinus <michael.albinus@gmx.de>
15339
15340 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15341
6511acf2 153422011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 15343
0999621a 15344 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
15345
15346 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 15347 (esprintf, exprintf, evxprintf): New functions.
62f19c19 15348 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 15349 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
15350 (modify_event_symbol): Do not assume that the length of
15351 name_alist_or_stem is safe to alloca and fits in int.
15352 (Fexecute_extended_command): Likewise for function name and binding.
15353 (Frecursion_depth): Wrap around reliably on integer overflow.
15354 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15355 since some callers pass EMACS_INT values.
15356 (Fsingle_key_description): Don't crash if symbol name contains more
15357 than MAX_ALLOCA bytes.
15358 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15359 (get_minibuffer): Arg is now EMACS_INT, not int.
15360 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 15361 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
15362 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15363
2be7d702
PE
15364 * dbusbind.c (signature_cat): New function.
15365 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
15366 Do not overrun buffer; instead, report string overflow.
15367
9d1df220
PE
15368 * dispnew.c (add_window_display_history): Don't overrun buffer.
15369 Truncate instead; this is OK since it's just a log.
15370
33ef5c64
PE
15371 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15372 even if the time zone offset is outlandishly large.
15373 Don't mishandle offset == INT_MIN.
15374
66c6fdd5
PE
15375 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15376 when creating daemon; the previous buffer-overflow check was incorrect.
15377
d749b01b
PE
15378 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15379 which has the guts of the old verror function.
15380
b5cd1905
PE
15381 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15382 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15383
6e1a67fb
PE
15384 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15385 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 15386 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 15387 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
15388 length of string rather than counting it via multiple sprintfs;
15389 that's simpler and more reliable.
c21721cc
PE
15390 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15391 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15392 sprintf, in case result does not fit in int.
15393
c57b67fc
PE
15394 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15395 (fontset_from_font): Print it.
15396
8a401434
PE
15397 * frame.c (tty_frame_count): Now printmax_t, not int.
15398 (make_terminal_frame, set_term_frame_name): Print it.
15399 (x_report_frame_params): In X, window IDs are unsigned long,
15400 not signed long, so print them as unsigned.
15401 (validate_x_resource_name): Check for implausibly long names,
15402 and don't assume name length fits in 'int'.
15403 (x_get_resource_string): Don't blindly alloca invocation name;
15404 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15405 not fit in int.
15406
6e1a67fb
PE
15407 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15408 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
15409 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15410
0df02bf3
PE
15411 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15412 Use esprintf, not sprintf, in case result does not fit in int.
15413
48e30793
PE
15414 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15415 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15416 it as a large positive number.
15417 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15418 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15419
a66ff6d8
PE
15420 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15421 in case result does not fit in int.
15422
aca216ff
PE
15423 * print.c (float_to_string): Detect width overflow more reliably.
15424 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15425 buffer overrun. Don't assume list length fits in 'int'. Treat
15426 print length of 0 as 0, not as infinity; to be consistent with other
15427 uses of print length in this function. Don't overflow print length
15428 index. Don't assume hash table size fits in 'long', or that
15429 vectorlike size fits in 'unsigned long'.
15430
31c286f7
PE
15431 * process.c (make_process): Use printmax_t, not int, to format
15432 process-name gensyms.
15433
55e5faa1
PE
15434 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15435
80f2e268
PE
15436 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15437 to avoid potential buffer overrun.
15438
670741ab
PE
15439 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15440 if X resource line is longer than 512 bytes.
15441
b7163a50
PE
15442 * xfns.c (x_window): Make sprintf buffer a bit bigger
15443 to avoid potential buffer overrun.
15444
ae58ff1f
PE
15445 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15446
c43c8a6a
PE
15447 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15448
3f8236f4
PE
154492011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15450
53e9fe90 15451 Integer overflow fixes for scrolling, etc.
6511acf2
PE
15452 Without these, Emacs silently mishandles large integers sometimes.
15453 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
15454 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15455
6511acf2
PE
15456 * xdisp.c (try_window_id): Check Emacs fixnum range before
15457 converting to 'int'.
806add1d 15458
6511acf2 15459 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
15460 Check that an Emacs fixnum is in range before assigning it to 'int'.
15461 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15462 values converted from Emacs fixnums.
15463 (Frecenter): Don't wrap around a line count if it is out of 'int'
15464 range; instead, treat it as an extreme value.
15465 (Fset_window_configuration, compare_window_configurations):
15466 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15467
6511acf2
PE
15468 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15469 that can exceed INT_MAX. Check that EMACS_INT value is in range
15470 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
15471 (match_limit): Don't assume that a fixnum can fit in 'int'.
15472
6511acf2 15473 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
15474 exceed INT_MAX.
15475
6511acf2 15476 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
15477 (Fvertical_motion): Don't wrap around LINES values that don't fit
15478 in 'int'. Instead, treat them as extreme values. This is good
15479 enough for windows, which can't have more than INT_MAX lines anyway.
15480
fcb901a7
LMI
154812011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15482
0f2f6b6d
LMI
15483 * Require libxml/parser.h to avoid compilation warning.
15484
fcb901a7
LMI
15485 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15486
15487 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15488 since this reportedly can destroy thread storage.
15489
6e20a0d4
CY
154902011-08-30 Chong Yidong <cyd@stupidchicken.com>
15491
15492 * syntax.c (find_defun_start): Update all cache variables if
15493 exiting early (Bug#9401).
15494
148ae00e
EZ
154952011-08-30 Eli Zaretskii <eliz@gnu.org>
15496
f6cfbd8f
EZ
15497 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15498
148ae00e
EZ
15499 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15500 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15501 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15502
15503 * term.c (tty_append_glyph): New function.
15504 (produce_stretch_glyph): Static function and its prototype deleted.
15505
a66cfb1c
SM
15506 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15507 Add prototypes.
148ae00e 15508
c4a07a4c
PE
155092011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15510
15511 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15512 when checking :margin (Bug#9390).
15513 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 15514 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
15515 so that the name doesn't mislead. All uses changed.
15516
6bc8cd65
JB
155172011-08-28 Johan Bockgård <bojohan@gnu.org>
15518
15519 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15520 set_tty_hooks.
15521
dca4927e
EZ
155222011-08-27 Eli Zaretskii <eliz@gnu.org>
15523
15524 * xdisp.c (move_it_to): Don't bail out early when reaching
15525 position beyond to_charpos, if we are scanning backwards.
15526 (move_it_vertically_backward): When DY == 0, make sure we get to
15527 the first character in the line after the newline.
15528
f2cad773
PE
155292011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15530
15531 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15532 (ccl_driver): Do not generate an out-of-range pointer.
15533 (Fccl_execute_on_string): Remove unnecessary check for
15534 integer overflow, noted by Stefan Monnier in
15535 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15536 Remove a FIXME that didn't need fixing.
15537 Simplify the newly-introduced buffer reallocation code.
15538
0cae2cdb
JB
155392011-08-27 Juanma Barranquero <lekktu@gmail.com>
15540
15541 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15542
5fc295a4 155432011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 15544
70c60eb2 15545 Integer and memory overflow issues (Bug#9196).
726e0ab1 15546
d31850da
PE
15547 * doc.c (get_doc_string): Rework so that
15548 get_doc_string_buffer_size is the actual buffer size, rather than
15549 being 1 less than the actual buffer size; this makes xpalloc more
15550 convenient.
15551
a69fbedb
PE
15552 * image.c (x_allocate_bitmap_record, cache_image):
15553 * xselect.c (Fx_register_dnd_atom):
15554 Simplify previous changes by using xpalloc.
15555
fe5c5d37
PE
15556 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15557 since either will do and ptrdiff_t is convenient with xpalloc.
15558
0065d054
PE
15559 * charset.c (charset_table_size)
15560 (struct charset_sort_data.priority): Now ptrdiff_t.
15561 (charset_compare): Don't overflow if priorities differ greatly.
15562 (Fsort_charsets): Don't assume list length fits in int.
15563 Check for size-calculation overflow when allocating sort data.
15564 (syms_of_charset): Allocate an initial charset table that is
15565 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15566
15567 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15568
15569 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15570 The actual value is always <= INT_MAX, and leaving it unsigned made
15571 overflow checking harder.
15572
15573 * dispextern.h (struct glyph_matrix.rows_allocated)
15574 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15575 with xpalloc. The values are still always <= INT_MAX.
15576
15577 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15578
15579 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15580 (SAFE_NALLOCA): New macro.
15581
15582 * region-cache.c (struct boundary.pos, find_cache_boundary)
15583 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15584 (set_cache_region, invalidate_region_cache)
15585 (revalidate_region_cache, know_region_cache, region_cache_forward)
15586 (region_cache_backward, pp_cache):
15587 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15588 so that ptrdiff_t * can be passed to xpalloc.
15589 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15590 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15591 (pp_cache): Don't assume cache_len fits in int.
15592 * region-cache.h: Adjust extern decls to match.
15593
15594 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15595 EMACS_INT, since either will do, for xpalloc.
15596
15597 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15598 (xnmalloc, xnrealloc, xpalloc): New functions.
15599
726e0ab1
PE
15600 * bidi.c (bidi_shelve_header_size): New constant.
15601 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15602 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15603
51f30bc5 15604 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
15605 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15606 (overlay_strings):
15607 Don't update size of array until after memory allocation succeeds,
15608 because xmalloc/xrealloc may not return.
0065d054
PE
15609 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15610 now that we have proper integer overflow checking.
15611 (record_overlay_string, overlay_strings): Catch overflows when
15612 calculating size of overlay_str_buf.
726e0ab1 15613
0065d054
PE
15614 * callproc.c (Fcall_process): Check for size overflow when
15615 calculating size of args2.
15616 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15617 Normally we prefer signed values, but sticking with ptrdiff_t would
15618 require adding more-complicated checks.
726e0ab1
PE
15619
15620 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15621 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15622 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 15623 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
15624
15625 * character.c (Fstring): Check for size-calculation overflow.
15626
15627 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15628 unnecessary integer overflow. Check for size overflow.
15629 (encode_coding_object): Don't update size until xmalloc succeeds.
15630
15631 * composite.c (get_composition_id): Check for overflow in glyph
15632 length calculations.
15633
15634 Integer and memory overflow fixes for display code.
15635 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15636 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15637 (scrolling_window): Check for overflow in size calculations.
15638 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15639 Don't assume glyph table len fits in int.
15640 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15641 (row_table_size): Now ptrdiff_t, not int.
15642 (scrolling_window): Avoid overflow in size calculations.
15643 Don't update size until allocation succeeds.
15644 * fns.c (concat): Check for overflow in size calculations.
15645 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15646 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15647 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15648
15649 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15650 (get_doc_string): Check for size calculation overflow.
15651 Don't update size until allocation succeeds.
15652 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15653 EMACS_INT, where ptrdiff_t will do.
15654 (Fsubstitute_command_keys): Check for string overflow.
15655
15656 * editfns.c (set_time_zone_rule): Don't assume environment length
15657 fits in int.
15658 (message_length): Now ptrdiff_t, not int.
15659 (Fmessage_box): Don't update size until allocation succeeds.
15660 Don't assume message length fits in int.
15661 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15662
0065d054
PE
15663 * emacs.c (main): Do not reallocate argv, since there is a null at
15664 the end that can be overwritten, and this way there's no need to
15665 worry about size-calculation overflow.
15666 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
15667
15668 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15669 alloc succeeds.
15670 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15671
15672 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15673 (x_set_scroll_bar_width, x_figure_window_size):
15674 Check for integer overflow.
15675 (x_set_alpha): Do not assume XINT fits in int.
15676
15677 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15678 This is for the members text_lines, text_cols, total_lines, total_cols,
15679 where the system imposes an 'int' limit.
15680
15681 * fringe.c (Fdefine_fringe_bitmap):
15682 Don't update size until alloc works.
15683
15684 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15685 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15686
15687 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15688 Check for size-calculation overflow.
15689 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15690 do, as we prefer signed integers.
15691 (id_to_widget.max_size, id_to_widget.used)
15692 (xg_store_widget_in_map, xg_remove_widget_from_map)
15693 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15694 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15695 Use and return ptrdiff_t, not int.
15696 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15697 * gtkutil.h: Change prototypes to match the above.
15698
15699 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15700 are duplicate now that they've been promoted to lisp.h.
15701 (x_allocate_bitmap_record, x_alloc_image_color)
15702 (make_image_cache, cache_image, xpm_load):
15703 Don't update size until alloc is done.
15704 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15705 (x_detect_edges):
3256efce 15706 Check for size calculation overflow.
726e0ab1
PE
15707 (ct_colors_allocated_max): New constant.
15708 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15709 overflow.
3256efce 15710
726e0ab1
PE
15711 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15712 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15713 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15714 Use ptrdiff_t, not int, to count maps.
15715 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
15716 calculations. Don't update size until allocation succeeds.
15717 Redo calculations to avoid overflow.
726e0ab1
PE
15718 * keyboard.h: Change prototypes to match the above.
15719
15720 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15721 to count maps.
15722 (current_minor_maps): Check for size calculation overflow.
15723 * keymap.h: Change prototypes to match the above.
15724
15725 * lread.c (read1, init_obarray): Don't update size until alloc done.
15726
15727 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15728 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15729
726e0ab1
PE
15730 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15731 Now ptrdiff_t, not int.
15732 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15733 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15734
15735 * process.c (Fnetwork_interface_list): Check for overflow
15736 in size calculation.
15737
15738 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15739
15740 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15741 overflow. Don't bother calling xmalloc when xrealloc will do.
15742
15743 * search.c (Freplace_match): Check for size calculation overflow.
15744 (Fset_match_data): Don't assume list lengths fit in 'int'.
15745
15746 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15747 for command line length. Do not attempt to address one before the
15748 beginning of an array, as that's not portable.
15749
15750 * term.c (max_frame_lines): Remove; unused.
15751 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15752 not int.
15753 (encode_terminal_code, calculate_costs): Check for size
15754 calculation overflow.
15755 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
15756 table lengths and related sizes. Don't update size until alloc
15757 done. Redo calculations to avoid overflow.
15758 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
15759
15760 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
15761 subtracting pointers.
15762 (gobble_line): Check for overflow more carefully. Don't update size
15763 until alloc done.
15764
15765 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
15766 Don't update size until alloc done.
15767 Redo size calculations to avoid overflow.
15768 Check for size calculation overflow.
0065d054 15769 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
15770
15771 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
15772 Use ptrdiff_t, not int, for sizes.
15773 (store_mode_line_noprop_char): Don't update size until alloc done.
15774
0065d054
PE
15775 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
15776 Use ptrdiff_t, not int, for sizes.
15777 (Finternal_make_lisp_face, cache_face):
15778 Check for size calculation overflow.
15779 (cache_face): Treat size calculation overflows as if they were
15780 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
15781
15782 * xfns.c (x_encode_text, x_set_name_internal)
15783 (Fx_change_window_property): Use ptrdiff_t, not int, to count
15784 sizes, since they can exceed INT_MAX in size. Check for size
15785 calculation overflow.
15786
0065d054
PE
15787 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
15788 (xg_select): Check for size calculation overflow.
726e0ab1
PE
15789 Don't update size until alloc done.
15790
0065d054 15791 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 15792 as sprintf is limited to int lengths.
1d526e2f 15793
252c5ee1
PE
15794 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
15795 (X_LONG_MIN): New macros.
864d7ce7
PE
15796 Use them to make the following changes clearer.
15797 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
15798 This change doesn't affect the value now, but it may help remind
15799 future maintainers not to raise the value too much later.
15800 (SELECTION_QUANTUM): Remove, replacing with ...
15801 (selection_quantum): ... new function, which avoids overflow.
15802 All uses changed.
15803 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
15804 assumption that selection length fits in 'int'.
15805 (x_reply_selection_request, x_handle_selection_request)
15806 (x_get_window_property, receive_incremental_selection)
15807 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
15808 (lisp_data_to_selection_data, clean_local_selection_data):
15809 Use ptrdiff_t, not int, to record length of selection.
15810 (x_reply_selection_request, x_get_window_property)
15811 (receive_incremental_selection, x_property_data_to_lisp):
15812 Redo calculations to avoid overflow.
15813 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 15814 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
15815 something.
15816 (x_get_window_property, receive_incremental_selection)
15817 (lisp_data_to_selection_data, x_property_data_to_lisp):
15818 Check for size-calculation overflow.
15819 (x_get_window_property, receive_incremental_selection)
15820 (lisp_data_to_selection_data, Fx_register_dnd_atom):
15821 Don't store size until memory allocation succeeds.
15822 (x_get_window_property): Plug memory leak on memory exhaustion.
15823 Don't double-block input; malloc is safe here. Don't assume 2**34
15824 - 4 fits in unsigned long. Add an xassert to check
15825 XGetWindowProperty overflow. Be more careful about overflow
15826 calculations, and distinguish size from memory overflow better.
15827 (receive_incremental_selection): When tracing, don't assume
15828 unsigned int is less than INT_MAX.
15829 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
15830 harmful) conversions of unsigned short to int.
15831 (lisp_data_to_selection_data): Don't assume that integers
15832 in the range -65535 through -1 fit in an X unsigned short.
15833 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
15834 result parameters unless successful. Rely on cons_to_unsigned
15835 to report problems with elements; the old code wasn't right anyway.
15836 (x_check_property_data): Check for int overflow; we cannot use
15837 a wider type due to X limits.
15838 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15839
726e0ab1 15840 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 15841
0065d054
PE
15842 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15843 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
15844 (x_color_cells): Don't store size until memory allocation succeeds.
15845 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 15846 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
15847 (x_term_init): Don't assume length fits in int (sprintf is limited
15848 to int size).
bc18e09d 15849
ebfa62c0
PE
15850 Use ptrdiff_t for composition IDs.
15851 * character.c (lisp_string_width):
15852 * composite.c (composition_table_size, n_compositions)
15853 (get_composition_id, composition_gstring_from_id):
15854 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15855 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15856 * window.c (Frecenter):
15857 Use ptrdiff_t, not int, for composition IDs.
15858 * composite.c (get_composition_id): Check for integer overflow.
15859 * composite.h: Adjust prototypes to match the above changes.
15860
d3411f89
PE
15861 Use ptrdiff_t for hash table indexes.
15862 * category.c (hash_get_category_set):
15863 * ccl.c (ccl_driver):
15864 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15865 * coding.c (coding_system_charset_list, detect_coding_system):
15866 * coding.h (struct coding_system.id):
15867 * composite.c (get_composition_id, gstring_lookup_cache):
15868 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15869 * image.c (xpm_get_color_table_h):
15870 * lisp.h (hash_lookup, hash_put):
15871 * minibuf.c (Ftest_completion):
15872 Use ptrdiff_t for hash table indexes, not int (which is too
15873 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15874 32-bit --with-wide-int hosts).
15875
e097a6fa
PE
15876 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15877 Add a FIXME comment about memory leaks.
15878 (syms_of_charset): Don't assume xmalloc returns.
15879
5637687f
PE
15880 Don't assume that stated character widths fit in int.
15881 * character.c (Fchar_width, c_string_width, lisp_string_width):
15882 * character.h (CHAR_WIDTH):
15883 * indent.c (MULTIBYTE_BYTES_WIDTH):
15884 Use sanitize_char_width to avoid undefined and/or bad behavior
15885 with outlandish widths.
a66cfb1c 15886 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
15887 now that we have two such functions. All uses changed.
15888 (sanitize_char_width): New inline function.
15889
a2271ba2
PE
15890 Don't assume that tab-width fits in int.
15891 * character.h (sanitize_width): New inline function.
15892 (SANE_TAB_WIDTH): New macro.
15893 (ASCII_CHAR_WIDTH): Use it.
15894 * indent.c (sane_tab_width): Remove. All uses replaced by
15895 SANE_TAB_WIDTH (current_buffer).
15896 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
15897
18c52557
PE
15898 * fileio.c: Integer overflow issues with file modes.
15899 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
15900
caeeedc1
PE
15901 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
15902 Remove unreachable code.
15903 (read_hex, load_charset_map_from_file): Check for integer overflow.
15904
6df6ae42 15905 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
15906 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
15907 (x_send_scroll_bar_event): Likewise. Check that the size does not
15908 exceed limits imposed by XClientMessageEvent, as well as the usual
15909 ptrdiff_t and size_t limits.
15910
b13995db
PE
15911 * keyboard.c: Overflow, signedness and related fixes.
15912 (make_lispy_movement): Use same integer type in forward decl
15913 that is used in the definition.
15914 (read_key_sequence, keyremap_step):
15915 Change bufsize argument back to int, undoing my 2011-03-30 change.
15916 We prefer signed types, and int is wide enough here.
15917 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
15918 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
15919 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
15920 length, not size_t. Use ptrdiff_t for index, not int.
15921 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
15922 possibility of integer overflow.
15923
13464394
PE
15924 Overflow, signedness and related fixes for images.
15925
15926 * dispextern.h (struct it.stack[0].u.image.image_id)
15927 (struct_it.image_id, struct image.id, struct image_cache.size)
15928 (struct image_cache.used, struct image_cache.ref_count):
15929 * gtkutil.c (update_frame_tool_bar):
15930 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
15931 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
15932 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
15933 * nsmenu.m (update_frame_tool_bar):
15934 * xdisp.c (calc_pixel_width_or_height):
15935 * xfns.c (image_cache_refcount):
15936 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
15937 on typical 64-bit hosts.
15938
15939 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15940 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
15941 Omit unnecessary casts to int.
15942 (parse_image_spec): Check that integers fall into 'int' range
15943 when the callers expect that.
15944 (image_ascent): Redo ascent calculation to avoid int overflow.
15945 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
15946 (lookup_image): Remove unnecessary tests.
15947 (xbm_image_p): Locals are now of int, not EMACS_INT,
15948 since parse_image_check makes sure they fit into int.
15949 (png_load, gif_load, svg_load_image):
15950 Prefer int to unsigned where either will do.
15951 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
15952 old tiff_error_handler and tiff_warning_handler.
15953 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
15954 stack buffer overflows. It uses only the features of vsnprintf
15955 that are common to both POSIX and native Microsoft.
15956 (tiff_error_handler, tiff_warning_handler): Use it.
15957 (tiff_load, gif_load, imagemagick_load_image):
15958 Don't assume :index value fits in 'int'.
15959 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
15960 (imagemagick_load_image): Check that crop parameters fit into
15961 the integer types that MagickCropImage accepts. Don't assume
15962 Vimagemagick_render_type has a nonnegative value. Don't assume
15963 size_t fits in 'long'.
15964 (gs_load): Use printmax_t to print the widest integers possible.
15965 Check for integer overflow when computing image height and width.
15966
c11821d4
EZ
159672011-08-26 Eli Zaretskii <eliz@gnu.org>
15968
15969 * xdisp.c (redisplay_window): Don't force window start if point
15970 will be invisible in the resulting window. (Bug#9324)
15971
0c95fcf7
EZ
159722011-08-25 Eli Zaretskii <eliz@gnu.org>
15973
15974 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
15975 the display spec is of the form `(space ...)'.
15976 (handle_display_spec): Return the value returned by
15977 handle_single_display_spec, not just 1 or zero.
15978 (handle_single_display_spec): If the display spec is of the form
15979 `(space ...)', and specifies display in the text area, return 2
15980 rather than 1.
fee65a97 15981 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
15982 accurately, and prefer exact match for point under bidi.
15983 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
15984
15985 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
15986 into disp_prop; all users changed.
15987
15988 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
15989 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
15990 for the text covered by the display property.
15991
e4ed06f1
CY
159922011-08-25 Chong Yidong <cyd@stupidchicken.com>
15993
15994 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
15995 Change return value to nil.
15996 (Frecord_buffer): Delete unused function.
15997
f67cdd7f
EZ
159982011-08-24 Eli Zaretskii <eliz@gnu.org>
15999
5980d4c6
EZ
16000 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16001 buffers, return left-to-right.
8610fe8b
EZ
16002 (set_cursor_from_row): Consider candidate row a win if its glyph
16003 represents a newline and point is on that newline. Fixes cursor
16004 positioning on the newline at EOL of R2L text within L2R
16005 paragraph, and vice versa.
16006 (try_cursor_movement): Check continued rows, in addition to
16007 continuation rows. Fixes unwarranted scroll when point enters a
16008 continued line of R2L text within an L2R paragraph, or vice versa.
16009 (cursor_row_p): Consider the case of point being equal to
16010 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16011 from the end of a short line to the beginning of a continued line
16012 of R2L text within L2R paragraph.
16013 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16014 composed characters.
5980d4c6 16015
f67cdd7f
EZ
16016 * bidi.c (bidi_check_type): Use xassert.
16017 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16018 members.
16019
bca633fb
EZ
160202011-08-23 Eli Zaretskii <eliz@gnu.org>
16021
16022 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16023 a character.
16024
4a5885a7
CY
160252011-08-23 Chong Yidong <cyd@stupidchicken.com>
16026
16027 * nsfont.m (ns_otf_to_script): Fix typo.
16028
0902a04e
KH
160292011-08-22 Kenichi Handa <handa@m17n.org>
16030
16031 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16032 extra slot even if the purpose is char-code-property-table.
16033
1a2e6670
EZ
160342011-08-23 Eli Zaretskii <eliz@gnu.org>
16035
8ddde651
EZ
16036 * xdisp.c (redisplay_window): When computing centering_position,
16037 account for the height of the header line. (Bug#8874)
16038
425cc014
EZ
16039 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16040 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16041 candidate is selected by the mouse, and that candidate has a
16042 composed character under the mouse.
16043
1a2e6670
EZ
16044 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16045 coordinates reported by pos-visible-in-window-p for a composed
16046 character in column zero.
16047
8b76d6f8
SM
160482011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16049
16050 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16051
dac347dd
EZ
160522011-08-22 Eli Zaretskii <eliz@gnu.org>
16053
16054 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16055 consider it a hit if to_charpos is anywhere in the range of the
16056 composed buffer positions.
16057
e013fb34
CY
160582011-08-22 Chong Yidong <cyd@stupidchicken.com>
16059
16060 * image.c (gif_load): Don't assume that each subimage has the same
16061 dimensions as the base image. Handle disposal method that is
16062 "undefined" by the gif spec (Bug#9335).
16063
bd1ba3e8
CY
160642011-08-20 Chong Yidong <cyd@stupidchicken.com>
16065
16066 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 16067 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 16068
54a1215b
EZ
160692011-08-19 Eli Zaretskii <eliz@gnu.org>
16070
823564e5
EZ
16071 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16072 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16073 from an Org mode buffer to a Speedbar frame.
16074
54a1215b
EZ
16075 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16076 a composition, take its buffer position from IT->cmp_it.charpos.
16077 Fixes cursor positioning at the beginning of a line that begins
16078 with a composed character.
16079
9778ebcc
EZ
160802011-08-18 Eli Zaretskii <eliz@gnu.org>
16081
0be6ee06
EZ
16082 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16083 character bidirectional type, use STRONG_L instead. Fixes crashes
16084 in a buffer produced by `describe-categories'.
16085
9778ebcc
EZ
16086 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16087 members before the level stack, so they would be saved and
16088 restored when copying iterator state. Fixes incorrect reordering
16089 around TABs covered by display properties.
16090
156bffbe
AS
160912011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16092
6b02f655 16093 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 16094
72ad093b
CY
160952011-08-17 Chong Yidong <cyd@stupidchicken.com>
16096
16097 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
16098 (internal_condition_case_2, internal_condition_case_n):
16099 Remove unnecessary aborts (Bug#9081).
72ad093b 16100
35774242
EZ
161012011-08-17 Eli Zaretskii <eliz@gnu.org>
16102
16103 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16104 has no `load' handler, try opening the file locally. (Bug#9311)
16105
db76dd85
KB
161062011-08-16 Ken Brown <kbrown@cornell.edu>
16107
16108 * gmalloc.c: Expand comment.
16109
b215eee5
EZ
161102011-08-16 Eli Zaretskii <eliz@gnu.org>
16111
16112 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16113 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16114
a4579d33
KB
161152011-08-16 Ken Brown <kbrown@cornell.edu>
16116
16117 Fix memory allocation problems in Cygwin build (Bug#9273).
16118
16119 * unexcw.c ( __malloc_initialized): Declare external variable.
16120 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16121
8b76d6f8
SM
16122 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16123 New variables.
a4579d33
KB
16124 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16125 dumped emacs.
16126 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16127 in the static heap.
16128 [CYGWIN] (special_realloc): New function.
16129 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16130 requests to realloc storage in the static heap.
16131
3ebec551
PE
161322011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16133
16134 * bidi.c (bidi_initialize): Remove unused local.
16135
9fd8be00
EZ
161362011-08-15 Eli Zaretskii <eliz@gnu.org>
16137
6b02f655
SM
16138 * bidimirror.h:
16139 * biditype.h: Remove file.
16140 * makefile.w32-in ($(BLD)/bidi.$(O)):
16141 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
16142
16143 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16144
16145 * chartab.c: Improve commentary for the uniprop_table API.
16146
32413314
EZ
16147 * bidi.c (bidi_paragraph_init): Support zero value of
16148 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
16149 (bidi_initialize): Use uniprop_table instead of including
16150 biditype.h and bidimirror.h.
32413314 16151
9fd8be00
EZ
16152 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16153 coordinates of the iterator when restoring from ppos_it.
16154 (Bug#9296)
16155
5cf2b69b
KH
161562011-08-14 Kenichi Handa <handa@m17n.org>
16157
16158 * process.c (create_process): Call setup_process_coding_systems
72ad093b 16159 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 16160
daf17d00
EZ
161612011-08-14 Eli Zaretskii <eliz@gnu.org>
16162
16163 * xdisp.c (move_it_in_display_line_to): Don't invoke
16164 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16165 ppos_it. Fixes vertical cursor motion when line beginning is
16166 covered by an image. (Bug#9296)
16167
08e3161a
JD
161682011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16169
16170 * nsterm.h (ns_run_ascript): Declare.
16171 (NSAPP_DATA2_RUNASSCRIPT): Define.
16172
16173 * nsfns.m (as_script, as_result, as_status): New static variables.
16174 (ns_run_ascript): New function.
5e617bc2 16175 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
16176 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16177 the event loop. Get status from as_status (Bug#7276).
16178
16179 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16180 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16181 the event loop (Bug#7276).
16182
a3720aa2
AS
161832011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16184
16185 * gnutls.c (QCgnutls_bootprop_priority)
16186 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16187 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16188 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16189 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16190 (QCgnutls_bootprop_verify_hostname_error)
16191 (QCgnutls_bootprop_callbacks_verify): Rename from
16192 Qgnutls_bootprop_..., all uses changed.
16193
16194 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16195 uses changed.
16196
0a0d27fb
PE
161972011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16198
19d5c50c
PE
16199 * xfaces.c (Qframe_set_background_mode): Now static.
16200 * dispextern.h (Qframe_set_background_mode): Remove decl.
16201
0a0d27fb
PE
16202 * process.c (Fnetwork_interface_info): Declare local only if needed.
16203
377538cb
JD
162042011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16205
16206 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16207 (Fnetwork_interface_list): Allocate in increments of bytes instead
16208 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16209 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16210 sockaddr.
16211 (struct ifflag_def): notrailers is smart on OSX.
16212 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16213 Get hardware address with getifaddrs if available.
16214
08fff70c
EZ
162152011-08-12 Eli Zaretskii <eliz@gnu.org>
16216
16217 * xdisp.c (iterate_out_of_display_property): xassert that
16218 IT->position is set to within IT->object's boundaries. Break from
16219 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
16220 when IT->position is set up wrongly due to some bug.
16221 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
16222 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16223 entry. Force push_it to save on the stack the current
16224 buffer/string position, to be restored by pop_it. Fix flags in
16225 the iterator structure wrt the object coming from a display
16226 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16227 properties. (Bug#9284)
16228
7be1c708 162292011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 16230
7be1c708
CY
16231 * fontset.c (fontset_get_font_group): Add proper type checks.
16232 (Bug#9172)
aac0c6e3 16233
7be1c708 162342011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 16235
7be1c708
CY
16236 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16237 and LC_VERSION_MIN_MACOSX.
16238 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16239 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 16240
97bb72a6
EZ
162412011-08-08 Eli Zaretskii <eliz@gnu.org>
16242
16243 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
16244 no-display-properties-and-no-overlays under bidi display.
16245 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 16246 properties and overlays.
97bb72a6 16247
d5617611
CY
162482011-08-08 Chong Yidong <cyd@stupidchicken.com>
16249
37e11a63
CY
16250 * editfns.c (Fset_time_zone_rule): Document relationship with the
16251 setenv function.
16252
d5617611
CY
16253 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16254 the font entity extracted from the cache (Bug#8109).
16255
58872834
CY
162562011-08-07 Chong Yidong <cyd@stupidchicken.com>
16257
16258 * composite.c (autocmp_chars): Don't reset point. That is done by
16259 restore_point_unwind (Bug#5984).
16260
75bfc667
JL
162612011-08-07 Juri Linkov <juri@jurta.org>
16262
16263 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16264 to show the arg `TIME' instead of `TIMEVAL'.
16265
d1410150
EZ
162662011-08-06 Eli Zaretskii <eliz@gnu.org>
16267
16268 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16269 display property strides EOL and includes a newline, as in
16270 longlines-mode. (Bug#9254)
75b771e4
EZ
16271 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16272 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
16273
16274 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16275 is non-zero, even if the data buffer is NULL. Fixes a crash in
16276 vertical-motion with longlines-mode. (Bug#9254)
16277
35928349
EZ
162782011-08-05 Eli Zaretskii <eliz@gnu.org>
16279
ec7cc85b
EZ
16280 * bidi.c <bidi_cache_total_alloc>: Now static.
16281 (bidi_initialize): Initialize bidi_cache_total_alloc.
16282
8b76d6f8 16283 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
16284 cache. (Bug#9221)
16285
16286 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16287 amount allocated this far in `bidi_cache_total_alloc'.
16288 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16289 non-zero, only free the data buffer without restoring the cache
16290 contents. All callers changed.
16291
16292 * dispextern.h (bidi_unshelve_cache): Update prototype.
16293
16294 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16295 (move_it_in_display_line, move_it_to)
16296 (move_it_vertically_backward, move_it_by_lines): Replace the call
16297 to xfree to an equivalent call to bidi_unshelve_cache.
16298 (move_it_in_display_line_to): Fix logic of returning
412b6358 16299 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 16300
e2e2423b
EZ
163012011-08-05 Eli Zaretskii <eliz@gnu.org>
16302
16303 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16304 came from a string character with a `cursor' property. (Bug#9229)
16305
ae9e757a
JD
163062011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16307
16308 * Makefile.in (LIB_PTHREAD): New variable.
16309 (LIBES): Add LIB_PTHREAD (Bug#9216).
16310
16311 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16312 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16313
213bd7f2
AS
163142011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16315
6b02f655 16316 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 16317
99aaf75f
JD
163182011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16319
16320 * xterm.c (x_find_topmost_parent): New function.
16321 (x_set_frame_alpha): Find topmost parent window with
16322 x_find_topmost_parent and set the property there also (bug#9181).
16323 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16324
c74e9d86
PE
163252011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16326
16327 * callproc.c (Fcall_process): Avoid vfork clobbering
16328 the local vars buffer, coding_systems, current_dir.
16329
640c8776
SM
163302011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16331
16332 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16333
f26d0e4c
PE
163342011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16335
8a10d76c
PE
16336 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16337 so that it is not optimized away.
16338
f26d0e4c
PE
16339 * xdisp.c (compute_display_string_pos): Remove unused local.
16340
55439c61
EZ
163412011-08-02 Eli Zaretskii <eliz@gnu.org>
16342
16343 Fix slow cursor motion and scrolling in large buffers with
16344 selective display, like Org Mode buffers. (Bug#9218)
16345
16346 * dispextern.h (struct bidi_it): New member disp_prop_p.
16347
16348 * xdisp.c: Remove one-slot cache of display string positions.
16349 (compute_display_string_pos): Accept an additional argument
5e617bc2 16350 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
16351 for a display string or property. If found, set DISP_PROP_P
16352 non-zero.
16353
16354 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
16355 DISP_PROP_P, and pass it to compute_display_string_pos.
16356 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
16357 non-zero. All callers of bidi_fetch_char changed.
16358
fb33fa43
SM
163592011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16360
16361 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16362
b099e063
DM
163632010-12-03 Don March <don@ohspite.net>
16364
16365 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16366 last character M-[char] is translated to ESC [char] (bug#7541).
16367
5cc7f7af
KH
163682011-08-02 Kenichi Handa <handa@m17n.org>
16369
d0fffa3f 16370 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
16371
16372 * chartab.c (uniprop_table): Make it non-static.
16373
525d5e6e
EZ
163742011-08-01 Eli Zaretskii <eliz@gnu.org>
16375
16376 * xdisp.c (forward_to_next_line_start): Accept additional argument
16377 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16378 on the newline.
16379 (reseat_at_next_visible_line_start): Use the bidi iterator state
16380 returned by forward_to_next_line_start to restore the state of
16381 it->bidi_it after backing up to previous newline. (Bug#9212)
16382
31011111
AS
163832011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16384
16385 * regex.c (re_comp): Protoize.
16386 (re_exec): Fix return type.
16387 (regexec): Fix type of `ret'. (Bug#9203)
16388
476371c4
PE
163892011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16390
e5d76069
PE
16391 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16392 This is needed if max-image-size is a floating-point number.
16393
9a79b20c
AS
163942011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16395
16396 * print.c (print_object): Print empty symbol as ##.
16397
16398 * lread.c (read1): Read ## as empty symbol.
16399
d8c2fa78
AA
164002011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16401
16402 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16403 setting frame foreground color (Bug#9175).
16404 (x_set_background_color): Likewise.
16405
ffe57a7a
AA
16406 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16407 contents (Bug#9176).
16408 (EmacsTooltip -init): Remove bezels and add shadows to
16409 tooltip windows.
16410
bf3492a5
AA
16411 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16412 or scroll bar (Bug#8470).
16413
d55e9c53
AA
16414 * nsfont.m (nsfont_open): Remove assignment to voffset and
16415 unnecessary vars hshink, expand, hd, full_height, min_height.
16416 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16417
16418 * nsterm.h (nsfont_info): Remove voffset field.
16419
d8c2fa78 164202011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
16421
16422 Implement strike-through and overline on NextStep (Bug#8863).
16423
16424 * nsfont.m (nsfont_open): Use underline position provided by font,
16425 instead of hard-coded value of 2.
16426 (nsfont_draw): Call ns_draw_text_decoration instead.
16427
16428 * nsterm.h: Add declaration for ns_draw_text_decoration.
16429
16430 * nsterm.m (ns_draw_text_decoration): New function for drawing
16431 underline, overline, and strike-through.
16432 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16433 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 16434 accommodate underlining, etc.
4843aac3 16435
4cc60b9b
EZ
164362011-07-28 Eli Zaretskii <eliz@gnu.org>
16437
bc7ece87
EZ
16438 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16439 default.
4cc60b9b 16440
476371c4
PE
164412011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16442
66606eea
PE
16443 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16444 Without this fix, if a signal arrives just after memory fills up,
16445 'malloc' might be invoked reentrantly.
16446
476371c4
PE
16447 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16448 In other words, assume that every image size is allowed, on non-X
16449 hosts. This assumption is probably wrong, but it lets Emacs compile.
16450
f3fcc40d
AS
164512011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16452
16453 * regex.c (re_iswctype): Convert return values to boolean.
16454
350c992f
EZ
164552011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16456
16457 * xdisp.c (compute_display_string_pos): Don't use cached display
16458 string position if the buffer had its restriction changed.
16459 (Bug#9184)
16460
5266b4bb
PE
164612011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16462
16463 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16464
2573a837 164652011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 16466
41f55ccd 16467 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 16468
39e378da
PE
16469 * bidi.c: Integer size and overflow fixes.
16470 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16471 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16472 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16473 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16474 (bidi_find_other_level_edge):
16475 Use ptrdiff_t instead of EMACS_INT where either will do.
16476 This works better on 32-bit hosts configured --with-wide-int.
16477 (bidi_cache_ensure_space): Check for size-calculation overflow.
16478 Use % rather than repeated addition, for better worst-case speed.
16479 Don't set bidi_cache_size until after xrealloc returns, because it
16480 might not return.
16481 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
16482 (bidi_cache_ensure_space): Also check that the bidi cache size
16483 does not exceed that of the largest Lisp string or buffer. See Eli
16484 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 16485
5e927815
PE
16486 * alloc.c (__malloc_size_t): Remove.
16487 All uses replaced by size_t. See Andreas Schwab's note
16488 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16489
ca4aa935
PE
16490 * image.c: Improve checking for integer overflow.
16491 (check_image_size): Assume that f is nonnull, since
16492 it is always nonnull in practice. This is one less thing to
16493 worry about when checking for integer overflow later.
16494 (x_check_image_size): New function, which checks for integer
16495 overflow issues inside X.
16496 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16497 This removes the need for a memory_full check.
16498 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16499 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16500 (xbm_read_bitmap_data): Change locals back to 'int', since
16501 their values must fit in 'int'.
16502 (xpm_load_image, png_load, tiff_load):
16503 Invoke x_create_x_image_and_pixmap earlier,
16504 to avoid much needless work if the image is too large.
16505 (tiff_load): Treat overly large images as if
16506 x_create_x_image_and_pixmap failed, not as malloc failures.
16507 (gs_load): Use x_check_image_size.
16508
5f8f9cc2
PE
16509 * gtkutil.c: Omit integer casts.
16510 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16511 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16512
5adf60bc
PE
16513 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16514
c8907a93
PE
16515 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16516 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16517 would wrongly return t on a 64-bit host.
16518
e3c25c68
PE
16519 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16520 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16521 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16522 and therefore cause GCC to emit a bogus diagnostic in some cases.
16523
3f791afe
PE
16524 * image.c: Integer signedness and overflow and related fixes.
16525 This is not an exhaustive set of fixes, but it's time to
16526 record what I've got.
16527 (lookup_pixel_color, check_image_size): Remove redundant decls.
16528 (check_image_size): Don't assume that arbitrary EMACS_INT values
16529 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16530 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16531 (tiff_load, imagemagick_load_image):
16532 Check for overflow in size calculations.
16533 (x_create_x_image_and_pixmap): Remove unnecessary test for
16534 xmalloc returning NULL; that can't happen.
16535 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16536 (xpm_color_bucket): Use better integer hashing function.
16537 (xpm_cache_color): Don't possibly over-allocate memory.
16538 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16539 (gif_memory_source):
16540 Use ptrdiff_t, not int or size_t, to record sizes.
16541 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16542 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16543 either works, as we prefer signed integers.
16544 (tiff_read_from_memory, tiff_write_from_memory):
16545 Return tsize_t, not size_t, since that's what the TIFF API wants.
16546 (tiff_read_from_memory): Don't fail simply because the read would
16547 go past EOF; instead, return a short read.
16548 (tiff_load): Omit no-longer-needed casts.
16549 (Fimagemagick_types): Don't assume size fits into 'int'.
16550
3cc5a532
PE
16551 Improve hashing quality when configured --with-wide-int.
16552 * fns.c (hash_string): New function, taken from sxhash_string.
16553 Do not discard information about ASCII character case; this
16554 discarding is no longer needed.
16555 (sxhash-string): Use it. Change sig to match it. Caller changed.
16556 * lisp.h: Declare it.
16557 * lread.c (hash_string): Remove, since we now use fns.c's version.
16558 The fns.c version returns a wider integer if --with-wide-int is
16559 specified, so this should help the quality of the hashing a bit.
16560
b312a492
PE
16561 * emacs.c: Integer overflow minor fix.
16562 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16563 Define only if GNU_LINUX.
16564 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16565
dfd153ae
PE
16566 * dispnew.c: Integer signedness and overflow fixes.
16567 Remove unnecessary forward decls, that were a maintenance hassle.
16568 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16569 All uses changed.
16570 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16571 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16572 (prepare_desired_row, line_draw_cost):
16573 Use int, not unsigned, where either works.
16574 (save_current_matrix, restore_current_matrix):
16575 Use ptrdiff_t, not size_t, where either works.
16576 (init_display): Check for overflow more accurately, and without
16577 relying on undefined behavior.
16578
a81d11a3
PE
16579 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16580 Remove, replacing with the new symbols in lisp.h. All uses changed.
16581 * fileio.c (make_temp_name):
16582 * filelock.c (lock_file_1, lock_file):
16583 * xdisp.c (message_dolog):
16584 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16585 Use pMd etc. instead.
16586 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16587 replacing the pWIDE etc. symbols removed from editfns.c.
16588
3300e6fd
PE
16589 * keyboard.h (num_input_events): Now uintmax_t.
16590 This is (very slightly) less likely to mess up due to wraparound.
16591 All uses changed.
16592
fd05c7e9
PE
16593 * buffer.c: Integer signedness fixes.
16594 (alloc_buffer_text, enlarge_buffer_text):
16595 Use ptrdiff_t rather than size_t when either will do, as we prefer
16596 signed integers.
16597
903fe15d
PE
16598 * alloc.c: Integer signedness and overflow fixes.
16599 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16600 (__malloc_size_t): Default to size_t, not to int.
16601 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16602 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16603 Prefer ptrdiff_t to size_t when either would do, as we prefer
16604 signed integers.
16605 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16606 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16607 Now const. Initialize with values that are in range even if char
16608 is signed.
16609 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16610 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16611 These functions do the right thing with sizes > 2**32.
16612 (check_depth): Now ptrdiff_t, not int.
16613 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16614 Adjust to new way of storing sizes. Check for size overflow bugs
16615 in rest of code.
16616 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16617 slightly wrong anyway, as it missed one instance of
16618 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16619 (refill_memory_reserve): Omit needless cast to size_t.
16620 (mark_object_loop_halt): Mark as externally visible.
16621
ac82cc6a
PE
16622 * xselect.c: Integer signedness and overflow fixes.
16623 (Fx_register_dnd_atom, x_handle_dnd_message):
16624 Use ptrdiff_t, not size_t, since we prefer signed.
16625 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16626 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16627 x_dnd_atoms_size and x_dnd_atoms_length.
16628
c2d1e36d
PE
16629 * doprnt.c: Prefer signed to unsigned when either works.
16630 * eval.c (verror):
16631 * doprnt.c (doprnt):
16632 * lisp.h (doprnt):
16633 * xdisp.c (vmessage):
16634 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16635 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16636 prefer signed arithmetic to avoid comparison confusion.
16637 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16638 but is a bit tricky.
16639
0e926e56
PE
16640 Assume freestanding C89 headers, string.h, stdlib.h.
16641 * data.c, doprnt.c, floatfns.c, print.c:
16642 Include float.h unconditionally.
16643 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16644 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16645 * regex.c: Likewise for stddef.h, string.h.
16646 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16647 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16648 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16649 (STDC_HEADERS): Remove obsolete defines.
16650 * sysdep.c: Include limits.h unconditionally.
16651
9cfdb3ec
PE
16652 Assume support for memcmp, memcpy, memmove, memset.
16653 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16654 * regex.c (memcmp, memcpy):
16655 Remove; we assume C89 now.
16656
16657 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16658 (__malloc_safe_bcopy): Remove; no longer needed.
16659
cf950e6b 16660 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
16661 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16662 well either way, and we prefer signed to unsigned.
16663
dbf38e02
LMI
166642011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16665
16666 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16667 closes the connection while we're reading (bug#9182).
16668
d6f0886c 166692011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 16670
d6f0886c
JD
16671 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16672 are specified (Bug#9168).
24e0f6b1 16673
2eb1f9e6
PE
166742011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16675
16676 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16677 Found by GCC static checking and --with-wide-int on a 32-bit host.
16678
22381272 166792011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
16680
16681 * xdisp.c (compute_display_string_pos): Fix logic of caching
16682 previous display string position. Initialize cached_prev_pos to
16683 -1. Fixes slow-down at the beginning of a buffer.
16684
f25e39b4
EZ
166852011-07-24 Eli Zaretskii <eliz@gnu.org>
16686
16687 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16688 for attrs[LFACE_FONTSET_INDEX].
16689
04c4b52e
PE
166902011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16691
16692 * xml.c (parse_region): Remove unused local
16693 that was recently introduced.
16694
c1734fbd
EZ
166952011-07-23 Eli Zaretskii <eliz@gnu.org>
16696
be18c5a5
EZ
16697 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16698 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16699
c1734fbd
EZ
16700 * xdisp.c (move_it_in_display_line_to): Record the best matching
16701 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
16702 exit if none of the characters scanned was an exact match.
16703 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
16704 when exact match is impossible due to invisible text, and the
16705 lines are truncated.
16706
a258d627
JD
167072011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16708
16709 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16710 for OSX >= 10.7.
16711
b6d5a689
EZ
167122011-07-22 Eli Zaretskii <eliz@gnu.org>
16713
0f74f785
EZ
16714 Fix a significant slow-down of cursor motion with C-n, C-p,
16715 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16716 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 16717 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
16718 (next_element_from_buffer): Call compute_stop_pos_backwards to
16719 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
16720 base_level_stop.
16721 (reseat): Don't look for prev_stop, as that could mean a very long
16722 run.
16723 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16724 <cached_disp_overlay_modiff>: Cache for last found display string
16725 position.
551918c1 16726 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
16727 about the same buffer in the same area of character positions, and
16728 the buffer wasn't changed since the time the display string
16729 position was cached.
551918c1 16730
b2d0c91a
EZ
167312011-07-22 Eli Zaretskii <eliz@gnu.org>
16732
16733 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16734 is an integer, which is important for empty lines. (Bug#9149)
16735
043604ee
CY
167362011-07-22 Chong Yidong <cyd@stupidchicken.com>
16737
16738 * frame.c (Fmodify_frame_parameters): In tty case, update the
16739 default face if necessary (Bug#4238).
16740
da4adb04
CY
167412011-07-21 Chong Yidong <cyd@stupidchicken.com>
16742
16743 * editfns.c (Fstring_to_char): No need to explain what a character
16744 is in the docstring (Bug#6576).
16745
9abd0532
LMI
167462011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16747
16748 * xml.c (parse_region): Make sure we always return a tree.
16749
36881d16
HK
167502011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16751
16752 * xml.c (parse_region): If a document contains only comments,
16753 return that, too.
16754
1e98674d
LMI
167552011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16756
16757 * xml.c (make_dom): Return comments, too.
16758
590bd467
PE
167592011-07-19 Paul Eggert <eggert@cs.ucla.edu>
16760
16761 Port to OpenBSD.
16762 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
16763 and the surrounding thread.
16764 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
16765 rather than fgets, and retry after EINTR. Otherwise, 'emacs
16766 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
16767 timer goes off.
16768 * s/openbsd.h (BROKEN_SIGIO): Define.
16769 * unexelf.c (unexec) [__OpenBSD__]:
16770 Don't update the .mdebug section of the Alpha COFF symbol table.
16771
f41628b2
LMI
167722011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16773
16774 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
16775 (bug#8460).
16776
b59b67c5
PE
167772011-07-18 Paul Eggert <eggert@cs.ucla.edu>
16778
15e3a074
PE
16779 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
16780 This fixes some race conditions on the permissions of any newly
16781 created file.
16782
41bed37d
PE
16783 * alloc.c (valid_pointer_p): Use pipe, not open.
16784 This fixes some permissions issues when debugging.
16785
b59b67c5
PE
16786 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
16787 If fchown fails to set both uid and gid, try to set just gid,
16788 as that is sometimes allowed. Adjust the file's mode to eliminate
16789 setuid or setgid bits that are inappropriate if fchown fails.
16790
925a6be7
SM
167912011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16792
16793 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
16794 to compare Lisp_Objects.
16795 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
16796 global_gnutls_log_level, don't mistake it for a Lisp_Object.
16797 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
16798
52968808
AS
167992011-07-17 Andreas Schwab <schwab@linux-m68k.org>
16800
0a6a104b
AS
16801 * lread.c (read_integer): Unread even EOF character.
16802 (read1): Likewise. Properly record start position of symbol.
16803
52968808
AS
16804 * lread.c (read1): Read `#:' as empty uninterned symbol if no
16805 symbol character follows.
16806
9e381cdd
PE
168072011-07-17 Paul Eggert <eggert@cs.ucla.edu>
16808
16809 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
16810 This works around a problem with the previous change to Fcopy_file.
16811 Recent glibc declares fchown with __attribute__((warn_unused_result)),
16812 and without this change, GCC might complain about discarding
16813 fchown's return value.
16814
b5641435
JB
168152011-07-16 Juanma Barranquero <lekktu@gmail.com>
16816
16817 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
16818
a8031457
PE
168192011-07-16 Paul Eggert <eggert@cs.ucla.edu>
16820
16821 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
16822
dd889327
LMI
168232011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
16824
750c33f7
LMI
16825 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
16826 it's used from the C level.
16827
dd889327
LMI
16828 * process.c: Use the same condition for POLL_FOR_INPUT in both
16829 keyboard.c and process.c (bug#1858).
16830
87e86684
LM
168312011-07-09 Lawrence Mitchell <wence@gmx.li>
16832
16833 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
16834 (Fgnutls_boot): Use it.
16835
64348f40
AS
168362011-07-15 Andreas Schwab <schwab@linux-m68k.org>
16837
16838 * doc.c (Fsubstitute_command_keys): Revert last change.
16839
1d698799
LMI
168402011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16841
f863868c
LMI
16842 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16843 quotes the next character, and doesn't affect other longer
16844 sequences (bug#8935).
16845
1d698799
LMI
16846 * lread.c (syms_of_lread): Clarify that is isn't only
16847 `eval-buffer' and `eval-defun' that's affected by
16848 `lexical-binding' (bug#8460).
16849
aa4b6df6
EZ
168502011-07-15 Eli Zaretskii <eliz@gnu.org>
16851
16852 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 16853 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 16854
5d856da6
PE
168552011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16856
ad6042bb
PE
16857 Fix minor problems found by static checking.
16858 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16859 (elsz): Now a signed constant, not a size_t var. We prefer signed
16860 types to unsigned, to avoid integer comparison confusion. Without
16861 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16862 "cannot optimize loop, the loop counter may overflow", a symptom
16863 of the confusion.
f00bbb22 16864 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
16865 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16866
6468f31c
LMI
168672011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16868
49080b10
LMI
16869 * search.c (Fre_search_backward): Mention `case-fold-search' in
16870 all the re_search_* functions (bug#8138).
16871
6468f31c
LMI
16872 * keyboard.c (Fopen_dribble_file): Document when the file is
16873 closed (bug#8056).
16874
c965adc5
EZ
168752011-07-14 Eli Zaretskii <eliz@gnu.org>
16876
df9733bf
EZ
16877 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16878 bidi_cache_idx.
16879
0bb23927
EZ
16880 Support bidi reordering of display and overlay strings.
16881 * xdisp.c (compute_display_string_pos)
16882 (compute_display_string_end): Accept additional argument STRING.
16883 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16884 (reseat_to_string): Initialize bidi_it->string.s and
16885 bidi_it->string.schars.
16886 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
16887 NULL (avoids a crash in bidi_paragraph_init).
16888 Initialize itb.string.lstring.
0bb23927
EZ
16889 (init_iterator): Call bidi_init_it only of a valid
16890 buffer position was specified. Initialize paragraph_embedding to
16891 L2R.
16892 (reseat_to_string): Initialize the bidi iterator.
16893 (display_string): If we need to ignore text properties of
16894 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16895 original value of -1 will not work with bidi.)
16896 (compute_display_string_pos): First arg is now struct
16897 `text_pos *'; all callers changed. Support display properties on
16898 Lisp strings.
16899 (compute_display_string_end): Support display properties on Lisp
16900 strings.
16901 (init_iterator, reseat_1, reseat_to_string): Initialize the
16902 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
16903 when iterating on a string not from display properties).
640c8776
SM
16904 (compute_display_string_pos, compute_display_string_end):
16905 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
16906 arrow keys.
16907 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
16908 base_level_stop; instead, set base_level_stop to BEGV.
16909 Fixes crashes in vertical-motion.
0bb23927
EZ
16910 (next_element_from_buffer): Improve commentary for when
16911 the iterator is before prev_stop.
16912 (init_iterator): Initialize bidi_p from the default value of
16913 bidi-display-reordering, not from buffer-local value. Use the
16914 buffer-local value only if initializing for buffer iteration.
16915 (handle_invisible_prop): Support invisible properties on strings
16916 that are being bidi-reordered.
16917 (set_iterator_to_next): Support bidi reordering of C strings and
16918 Lisp strings.
16919 (next_element_from_string): Support bidi reordering of Lisp
16920 strings.
16921 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
16922 (display_string): Support display of R2L glyph rows.
16923 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
16924 (init_iterator): Don't initialize it->bidi_p for strings
16925 here.
16926 (reseat_to_string): Initialize it->bidi_p for strings here.
16927 (next_element_from_string, next_element_from_c_string)
16928 (next_element_from_buffer): Add xassert's for correspondence
16929 between IT's object being iterated and it->bidi_it.string
16930 structure.
16931 (face_before_or_after_it_pos): Support bidi iteration.
16932 (next_element_from_c_string): Handle the case of the first string
16933 character that is not the first one in the visual order.
16934 (get_visually_first_element): New function, refactored from common
16935 parts of next_element_from_buffer, next_element_from_string, and
16936 next_element_from_c_string.
16937 (tool_bar_lines_needed, redisplay_tool_bar)
16938 (display_menu_bar): Force left-to-right direction. Add a FIXME
16939 comment for making that be controlled by a user option.
16940 (push_it, pop_it): Save and restore the state of the
16941 bidi iterator. Save and restore the bidi_p flag.
16942 (pop_it): Iterate out of display property for string iteration as
16943 well.
16944 (iterate_out_of_display_property): Support iteration over strings.
16945 (handle_single_display_spec): Set up it->bidi_it for iteration
16946 over a display string, and call bidi_init_it.
16947 (handle_single_display_spec, next_overlay_string)
16948 (get_overlay_strings_1, push_display_prop): Set up the bidi
16949 iterator for displaying display or overlay strings.
16950 (forward_to_next_line_start): Don't use the shortcut if
16951 bidi-iterating.
16952 (back_to_previous_visible_line_start): If handle_display_prop
16953 pushed the iterator stack, restore the internal state of the bidi
16954 iterator by calling bidi_pop_it same number of times.
16955 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
16956 and we are bidi-iterating, don't decrement the iterator position;
16957 instead, set the first_elt flag in the bidi iterator, to produce
16958 the same effect.
16959 (reseat_1): Remove redundant setting of string_from_display_prop_p.
16960 (push_display_prop): xassert that we are iterating a buffer.
16961 (push_it, pop_it): Save and restore paragraph_embedding member.
16962 (handle_single_display_spec, next_overlay_string)
16963 (get_overlay_strings_1, reseat_1, reseat_to_string)
16964 (push_display_prop): Set up the `unibyte' member of bidi_it.string
16965 correctly. Don't assume unibyte strings are not bidi-reordered.
16966 (compute_display_string_pos)
16967 (compute_display_string_end): Fix handling the case of C string.
16968 (push_it, pop_it): Save and restore from_disp_prop_p.
16969 (handle_single_display_spec, push_display_prop): Set the
16970 from_disp_prop_p flag.
16971 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
16972 (pop_it): Call iterate_out_of_display_property only if we are
16973 popping after iteration over a string that came from a display
16974 property. Fix a typo in popping stretch info. Add an assertion
16975 for verifying that the iterator position is in sync with the bidi
16976 iterator.
16977 (handle_single_display_spec, get_overlay_strings_1)
16978 (push_display_prop): Fix initialization of paragraph direction for
16979 string when that of the parent object is not yet determined.
16980 (reseat_1): Call bidi_init_it to resync the bidi
16981 iterator with IT's position. (Bug#7616)
16982 (find_row_edges): If ROW->start.pos gives position
16983 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
16984 (handle_stop, back_to_previous_visible_line_start, reseat_1):
16985 Reset the from_disp_prop_p flag.
16986 (SAVE_IT, RESTORE_IT): New macros.
16987 (pos_visible_p, face_before_or_after_it_pos)
16988 (back_to_previous_visible_line_start)
16989 (move_it_in_display_line_to, move_it_in_display_line)
16990 (move_it_to, move_it_vertically_backward, move_it_by_lines)
16991 (try_scrolling, redisplay_window, display_line): Use them when
16992 saving a temporary copy of the iterator and restoring it back.
16993 (back_to_previous_visible_line_start, reseat_1)
16994 (init_iterator): Empty the bidi cache "stack".
16995 (move_it_in_display_line_to): If iterator ended up at
16996 EOL, but we never saw any buffer positions smaller than
16997 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
16998 motion in bidi-reordered lines.
16999 (move_it_in_display_line_to): Record prev_method and prev_pos
17000 immediately before the call to set_iterator_to_next. Fixes cursor
17001 motion in bidi-reordered lines with stretch glyphs and strings
17002 displayed in margins. (Bug#8133) (Bug#8867)
17003 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17004 TO_CHARPOS.
640c8776
SM
17005 (pos_visible_p): Support positions in bidi-reordered lines.
17006 Save and restore bidi cache.
0bb23927
EZ
17007
17008 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17009 (bidi_paragraph_info): Delete unused struct.
17010 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17011 (bidi_cache_start): New variable.
17012 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17013 to zero.
17014 (bidi_cache_fetch_state, bidi_cache_search)
17015 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17016 (bidi_cache_find, bidi_peek_at_next_level)
17017 (bidi_level_of_next_char, bidi_find_other_level_edge)
17018 (bidi_move_to_visually_next): Compare cache index with
17019 bidi_cache_start rather than with zero.
17020 (bidi_fetch_char): Accept new argument STRING; all callers
17021 changed. Support iteration over a string. Support strings with
17022 display properties. Support unibyte strings. Fix the type of
17023 `len' according to what STRING_CHAR_AND_LENGTH expects.
17024 (bidi_paragraph_init, bidi_resolve_explicit_1)
17025 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
17026 (bidi_level_of_next_char, bidi_move_to_visually_next):
17027 Support iteration over a string.
0bb23927
EZ
17028 (bidi_set_sor_type, bidi_resolve_explicit_1)
17029 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17030 can now be zero (for strings); special values 0 and -1 were
17031 changed to -1 and -2, respectively.
17032 (bidi_char_at_pos): New function.
17033 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17034 Call it instead of FETCH_MULTIBYTE_CHAR.
17035 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17036 initialized to valid values.
17037 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17038 values.
17039 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17040 the test for valid cached positions. Fix the logic for looking up
17041 the sentinel state in the cache. GCPRO the Lisp string we are
17042 iterating.
17043 (bidi_push_it, bidi_pop_it): New functions.
17044 (bidi_initialize): Initialize the bidi cache start stack pointer.
17045 (bidi_cache_ensure_space): New function, refactored from part of
17046 bidi_cache_iterator_state. Don't assume the required size is just
17047 one BIDI_CACHE_CHUNK away.
17048 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17049 (bidi_count_bytes, bidi_char_at_pos): New functions.
17050 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17051 always valid if bidi_cache_idx is valid.
17052 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17053 is valid if it's going to be used.
17054 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17055 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
17056 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17057 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
17058 (bidi_find_other_level_edge, bidi_cache_start_stack):
17059 All variables related to cache indices are now EMACS_INT.
c965adc5 17060
0bb23927
EZ
17061 * dispextern.h (struct bidi_string_data): New structure.
17062 (struct bidi_it): New member `string'. Make flag members be 1-bit
17063 fields, and put them last in the struct.
640c8776
SM
17064 (compute_display_string_pos, compute_display_string_end):
17065 Update prototypes.
0bb23927
EZ
17066 (bidi_push_it, bidi_pop_it): Add prototypes.
17067 (struct iterator_stack_entry): New members bidi_p,
17068 paragraph_embedding, and from_disp_prop_p.
17069 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
17070 (bidi_shelve_cache, bidi_unshelve_cache):
17071 Declare prototypes.
0bb23927
EZ
17072
17073 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17074 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17075 and vector-like objects.
17076
17077 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17078 cache around display iteration.
17079
17080 * window.c (Fwindow_end, window_scroll_pixel_based)
17081 (displayed_window_lines, Frecenter): Save and restore the bidi
17082 cache around display iteration.
17083
3bbd2265
LMI
170842011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17085
17086 * editfns.c (Fdelete_region): Clarify the use of the named
17087 parameters (bug#6788).
17088
adc47434
MR
170892011-07-14 Martin Rudalics <rudalics@gmx.at>
17090
17091 * indent.c (Fvertical_motion): Set and restore w->pointm when
17092 saving and restoring the window's buffer (Bug#9006).
17093
837c31f8
LMI
170942011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17095
17096 * editfns.c (Fstring_to_char): Clarify just what is returned
17097 (bug#6576). Text by Eli Zaretskii.
17098
ac389d0c
JB
170992011-07-13 Juanma Barranquero <lekktu@gmail.com>
17100
17101 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17102
0be0ce47
EZ
171032011-07-13 Eli Zaretskii <eliz@gnu.org>
17104
17105 * buffer.c (mmap_find): Fix a typo.
17106
cd18e7e3
JB
171072011-07-13 Johan Bockgård <bojohan@gnu.org>
17108
17109 Fix execution of x selection hooks.
17110 * xselect.c (Qx_lost_selection_functions)
17111 (Qx_sent_selection_functions): New vars.
17112 (syms_of_xselect): DEFSYM them.
17113 (x_handle_selection_request): Pass Qx_sent_selection_functions
17114 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17115 (x_handle_selection_clear,x_clear_frame_selections):
17116 Pass Qx_lost_selection_functions rather than
17117 Vx_lost_selection_functions to Frun_hook_with_args.
17118
47ea7f44
PE
171192011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17120
ac389d0c 17121 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
17122 The old code sometimes used this field without initializing it.
17123
47ea7f44
PE
17124 * alloc.c (gc_sweep): Don't read past end of array.
17125 In theory, the old code could also have corrupted Emacs internals,
17126 though it'd be very unlikely.
17127
bc985c87
AS
171282011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17129
17130 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 17131 argument. (Bug#4026)
bc985c87 17132
0cf34688
LMI
171332011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17134
b3dadd76
LMI
17135 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17136 key" (bug#4257).
17137
0cf34688
LMI
17138 * window.c (Fset_window_start): Doc fix (bug#4199).
17139 (Fset_window_hscroll): Ditto.
17140
270768cd
PE
171412011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17142
077e3dda 17143 Fix minor new problems caught by GCC 4.6.1.
270768cd 17144 * term.c (init_tty): Remove unused local.
490011a6 17145 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 17146 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 17147 not used otherwise.
270768cd 17148
b1f58454
CY
171492011-07-12 Chong Yidong <cyd@stupidchicken.com>
17150
17151 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17152
22b9578d
LMI
171532011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17154
6e70ab07
LMI
17155 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17156 are the mini-buffer and the echo area (bug#3320).
17157
22b9578d
LMI
17158 * term.c (init_tty): Remove support for supdup, c10 and perq
17159 terminals, which are no longer supported (bug#1482).
17160
8974cc9f
JB
171612011-07-10 Johan Bockgård <bojohan@gnu.org>
17162
17163 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17164
a560d974
JD
171652011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17166
17167 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17168 for non-popups (Bug#3642).
17169
1dae0f0a
AS
171702011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17171
268c2c36 17172 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 17173 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
17174 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17175 * cm.c (losecursor): Likewise.
1dae0f0a
AS
17176 * data.c (fmod): Likewise.
17177 * dispnew.c (swap_glyphs_in_rows): Likewise.
17178 * emacs.c (memory_warning_signal): Likewise.
17179 * floatfns.c (float_error): Likewise.
17180 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17181 (otf_open, font_otf_capability, generate_otf_features)
17182 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17183 Likewise.
17184 * image.c (pbm_read_file): Likewise.
17185 * indent.c (string_display_width): Likewise.
17186 * intervals.c (check_for_interval, search_for_interval)
17187 (inc_interval_count, count_intervals, root_interval)
17188 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17189 * lread.c (defalias): Likewise.
268c2c36 17190 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
17191 * regex.c (set_image_of_range_1, set_image_of_range)
17192 (regex_grow_registers): Likewise.
17193 * sysdep.c (strerror): Likewise.
17194 * termcap.c (valid_filename_p, tprint, main): Likewise.
17195 * tparam.c (main): Likewise.
17196 * unexhp9k800.c (run_time_remap, save_data_space)
17197 (update_file_ptrs, read_header, write_header, calculate_checksum)
17198 (copy_file, copy_rest, display_header): Likewise.
17199 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17200 Likewise.
17201 * xdisp.c (check_it): Likewise.
17202 * xfaces.c (register_color, unregister_color, unregister_colors):
17203 Likewise.
17204 * xfns.c (print_fontset_result): Likewise.
17205 * xrdb.c (member, fatal, main): Likewise.
17206
99033785
PE
172072011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17208
17209 Fix minor problems found by static checking (Bug#9031).
17210 * chartab.c (char_table_set_range, map_sub_char_table):
17211 Remove unused locals.
17212 (uniprop_table): Now static.
17213 * composite.c (_work_char): Remove unused static var.
17214
9cb2ac56
JB
172152011-07-09 Juanma Barranquero <lekktu@gmail.com>
17216
17217 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17218
f25661f0
JD
172192011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17220
17221 * gtkutil.c (qttip_cb): Remove code without function.
17222
8278c4fe
EZ
172232011-07-09 Eli Zaretskii <eliz@gnu.org>
17224
17225 * w32.c (pthread_sigmask): New stub.
17226
1692ae2d 172272011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 17228
8a6ebd58 17229 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
17230 sigprocmask is portable only for single-threaded applications, and
17231 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
17232 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17233 (LIBES): Use it.
17234 * callproc.c (Fcall_process):
17235 * process.c (create_process):
17236 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17237 Use pthread_sigmask, not sigprocmask.
123403e4 17238
1b854618
JD
172392011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17240
17241 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17242 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17243 wrong (Bug#8591).
17244
3fe4b549
JD
172452011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17246
0ce7e563
JD
17247 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17248 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17249 (xg_hide_tooltip): Fix comment.
17250
3fe4b549
JD
17251 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17252 in registerServicesMenuSendTypes.
17253 (validRequestorForSendType): Don't check ns_return_types.
17254
17255 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17256 ns_return_type.
17257
5df75e47
JR
172582011-07-08 Jason Rumney <jasonr@gnu.org>
17259
22610910
JR
17260 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17261 SH_SHOW for hidden windows (Bug#5482).
17262
5df75e47
JR
17263 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17264 frame struct members of non-existent frames (Bug#6284).
17265
699c10bd
JD
172662011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17267
4393663b
JD
17268 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17269 variable firstTime not needed on OSX >= 10.6.
17270 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17271 >= 10.5. Use setKnobProportion, setDoubleValue.
17272
17273 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17274 (MAC_OS_X_VERSION_10_5): Define if not defined.
17275 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17276 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17277 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17278
17279 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 17280 cString and lossyCString on OSX >= 10.4.
4393663b 17281
58179cce 17282 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
17283 sizeToFit on OSX >= 10.2.
17284
17285 * nsimage.m (allocInitFromFile): Don't use deprecated method
17286 bestRepresentationForDevice on OSX >= 10.6.
17287
17288 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17289 to avoid warning.
17290
17291 * emacs.c: Declare unexec_init_emacs_zone.
17292
a63e0781
JD
17293 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17294
699c10bd
JD
17295 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17296
17297 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17298 on svcsMenu (Bug#8842).
17299
17300 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17301 ns_return_types.
17302 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17303
17304 * nsterm.m (QUTF8_STRING): Declare.
17305 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17306 (validRequestorForSendType): Return type is (id).
17307 Change indexOfObjectIdenticalTo to indexOfObject.
17308 Check if we have local selection before returning self (Bug#8842).
17309 (writeSelectionToPasteboard): Put local selection into paste board
17310 if we have a local selection (Bug#8842).
17311 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17312
17313 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17314 (ns_get_local_selection): Declare.
17315
54e10184
LMI
173162011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17317
9888ff71
LMI
17318 * keymap.c (describe_map_tree): Don't insert a double newline at
17319 the end of the buffer (bug#1169) and return whether we inserted
17320 something.
17321
54e10184
LMI
17322 * callint.c (Fcall_interactively): Change "reading args" to
17323 "providing args" to try to clarify what it does (bug#1010).
17324
15fa4783
KH
173252011-07-07 Kenichi Handa <handa@m17n.org>
17326
17327 * composite.c (composition_compute_stop_pos): Ignore a static
17328 composition starting before CHARPOS (Bug#8915).
17329
17330 * xdisp.c (handle_composition_prop): Likewise.
17331
a8815b00
EZ
173322011-07-07 Eli Zaretskii <eliz@gnu.org>
17333
17334 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17335 (Bug#9015)
17336
ef7b981d 173372011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
17338
17339 * character.h (unicode_category_t): New enum type.
17340
17341 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17342 (Qchar_code_property_table): New variable.
17343 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17344 (UNIPROP_COMPRESSED_FORM_P): New macros.
17345 (char_table_ascii): Uncompress the compressed values.
17346 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17347 Uncompress the compressed values.
ac389d0c 17348 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
17349 (char_table_ref_and_range): Uncompress the compressed values.
17350 (sub_char_table_set): New arg is_uniprop. Callers changed.
17351 Uncompress the compressed values.
17352 (sub_char_table_set_range): Args changed. Callers changed.
17353 (char_table_set_range): Adjuted for the above change.
17354 (map_sub_char_table): Delete args default_val and parent. Add arg
17355 top. Give decoded values to a Lisp function.
640c8776 17356 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
17357 values to a Lisp function. Gcpro more variables.
17358 (uniprop_table_uncompress)
17359 (uniprop_decode_value_run_length): New functions.
17360 (uniprop_decoder, uniprop_decoder_count): New variables.
17361 (uniprop_get_decoder, uniprop_encode_value_character)
17362 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17363 New functions.
17364 (uniprop_encoder, uniprop_encoder_count): New variables.
17365 (uniprop_get_encoder, uniprop_table)
17366 (Funicode_property_table_internal, Fget_unicode_property_internal)
17367 (Fput_unicode_property_internal): New functions.
17368 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17369 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 17370 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
17371 char-code-property-alist.
17372
640c8776 17373 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
17374 Vunicode_category_table.
17375
640c8776 17376 * font.c (font_range): Adjust for the change of
c805dec0
KH
17377 Vunicode_category_table.
17378
76b397fb
DN
173792011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17380
17381 * m/iris4d.h: Remove file, move contents ...
17382 * s/irix6-5.h: ... here.
17383
22b4128e
PE
173842011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17385
17386 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
17387 * alloc.c (mark_buffer):
17388 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17389 (clone_per_buffer_values): Don't assume that
22b4128e
PE
17390 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17391 This isn't true in general, and it's particularly not true
17392 if Emacs is configured with --with-wide-int.
17393 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17394 New macros, used in the buffer.c change.
17395
869795d6
JD
173962011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17397
17398 * xsettings.c: Use both GConf and GSettings if both are available.
17399 (store_config_changed_event): Add comment.
17400 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17401 (store_tool_bar_style_changed): New functions.
5e617bc2 17402 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
17403 (struct xsettings): Move font inside HAVE_XFT.
17404 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 17405 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 17406 Move inside HAVE_XFT.
640c8776 17407 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
17408 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17409 also.
17410 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 17411 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 17412 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
17413 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17414 (parse_settings): Move check for font inside HAVE_XFT.
17415 (read_settings, apply_xft_settings): Add comment.
17416 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17417 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17418 call store_font_name_changed.
17419 (xft_settings_event): Add comment.
17420 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17421 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17422 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17423 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17424 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
17425 (xsettings_get_system_font, xsettings_get_system_normal_font):
17426 Add comment.
869795d6 17427
d8ed26bd
PE
174282011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17429
17430 Random fixes. E.g., (random) never returned negative values.
17431 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17432 subseconds part to the entropy, as that's a bit more random.
17433 Prefer signed to unsigned, since the signedness doesn't matter and
17434 in general we prefer signed. When given a limit, use a
17435 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17436 latter isn't right if USE_2_TAGS_FOR_INTS.
17437 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17438 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17439
cabf1cac
SM
174402011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17441
17442 * textprop.c (text_property_stickiness):
17443 Obey Vtext_property_default_nonsticky.
17444 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17445 * w32fns.c (syms_of_w32fns):
17446 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17447
6e9b2be9
PE
174482011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17449
17450 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17451 This is more efficient than Ffile_directory_p and avoids a minor race.
17452
90186c68
LMI
174532011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17454
7c301272
LMI
17455 * buffer.c (Foverlay_put): Say what the return value is
17456 (bug#7835).
17457
c4f2d8d4
LMI
17458 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17459 is a directory before asking whether to use the file name
17460 (bug#7564).
ad637907
LMI
17461 (barf_or_query_if_file_exists): Make the "File is a directory"
17462 error be more correct.
c4f2d8d4 17463
90186c68
LMI
17464 * fns.c (Frequire): Remove the mention of the .gz files, since
17465 that's installation-specific, but keep the mention of
17466 `get-load-suffixes'.
17467
da64016e
PE
174682011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17469
17470 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17471 Report string overflow if the output is too long.
17472
7d47b580
JB
174732011-07-04 Juanma Barranquero <lekktu@gmail.com>
17474
a555cb87
JB
17475 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17476 (syms_of_gnutls): Remove duplicate DEFSYM for
17477 Qgnutls_bootprop_verify_hostname_error, an error for
17478 Qgnutls_bootprop_verify_error (which is no longer used).
17479
7d47b580
JB
17480 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17481 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17482 Also (re)move comments that are misplaced or no longer relevant.
17483
1e49bfab
LMI
174842011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17485
17486 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17487
1485f4c0
CY
174882011-07-03 Chong Yidong <cyd@stupidchicken.com>
17489
17490 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17491 and background color parameters if they have been changed.
17492
a9ab721e
LMI
174932011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17494
17495 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17496
cf7cff57
PE
174972011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17498
2e13213d
PE
17499 * xsettings.c (SYSTEM_FONT): Define only when used.
17500 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17501
cf7cff57
PE
17502 * keymap.c (access_keymap_1): Now static.
17503
7a8e04f7
CY
175042011-07-02 Chong Yidong <cyd@stupidchicken.com>
17505
17506 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17507 leave any prefix arg for the up event (Bug#1586).
17508
61352f62
LMI
175092011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17510
69bb1ef7
LMI
17511 * lread.c (syms_of_lread): Mention single symbols defined by
17512 `defvar' or `defconst' (bug#7154).
17513
61352f62 17514 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 17515 (Frequire): Mention get-load-suffixes.
61352f62 17516
28545e04
MR
175172011-07-02 Martin Rudalics <rudalics@gmx.at>
17518
17519 * window.h (window): Remove clone_number slot.
17520 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17521 Remove.
17522 (make_parent_window, make_window, saved_window)
17523 (Fset_window_configuration, save_window_save): Don't deal with
17524 clone numbers.
17525 * buffer.c (Qclone_number): Remove declaration.
17526 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17527
3349e122
SM
175282011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17529
17530 Add multiple inheritance to keymaps.
17531 * keymap.c (Fmake_composed_keymap): New function.
17532 (Fset_keymap_parent): Simplify.
17533 (fix_submap_inheritance): Remove.
17534 (access_keymap_1): New function extracted from access_keymap to handle
17535 embedded parents and handle lists of maps.
17536 (access_keymap): Use it.
17537 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17538 (Fcopy_keymap): Handle embedded parents.
17539 (Fcommand_remapping, define_as_prefix): Simplify.
17540 (Fkey_binding): Simplify.
17541 (syms_of_keymap): Move minibuffer-local-completion-map,
17542 minibuffer-local-filename-completion-map,
17543 minibuffer-local-must-match-map, and
17544 minibuffer-local-filename-must-match-map to Elisp.
17545 (syms_of_keymap): Defsubr make-composed-keymap.
17546 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17547 (parse_menu_item): Trivial simplification.
17548
3279eb87
GM
175492011-07-01 Glenn Morris <rgm@gnu.org>
17550
17551 * Makefile.in (SETTINGS_LIBS): Fix typo.
17552
39cb9e56 175532011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
17554
17555 * coding.c (Fencode_coding_string): Record the last coding system
17556 used, as the function doc string says (bug#8738).
17557
0949d2b6
JD
175582011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17559
17560 * xsettings.c (store_monospaced_changed): Take new font as arg and
17561 check for change against current_mono_font.
17562 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17563 (emacs_settings_constructor, emacs_settings_get_property)
17564 (emacs_settings_set_property, emacs_settings_class_init)
17565 (emacs_settings_init, gsettings_obj): Remove.
17566 (something_changedCB): New function for HAVE_GSETTINGS.
17567 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17568 with value as argument.
17569 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17570 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 17571 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
17572 "changed".
17573
17574 * xgselect.c: Add defined (HAVE_GSETTINGS).
17575 (xgselect_initialize): Ditto.
17576
17577 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17578 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17579 xg_select.
17580
bbc6b304
PE
175812011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17582
17583 * eval.c (struct backtrace): Simplify and port the data structure.
17584 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17585 signed bit field, as this assumption is not portable and it makes
17586 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17587 "char debug_on_exit : 1" as this is not portable either; instead,
17588 use the portable "unsigned int debug_on_exit : 1". Remove unused
17589 member evalargs. Remove obsolete comments about cc bombing out.
17590
9851bfc5
JD
175912011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17592
51bb811f 17593 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
17594 Let HAVE_GSETTINGS override HAVE_GCONF.
17595 (store_monospaced_changed): New function.
17596 (EMACS_SETTINGS): A new type derived from GObject to handle
17597 GSettings notifications.
17598 (emacs_settings_constructor, emacs_settings_get_property)
17599 (emacs_settings_set_property, emacs_settings_class_init):
17600 New functions.
17601 (gsettings_client, gsettings_obj): New variables.
17602 (GSETTINGS_SCHEMA): New define.
17603 (something_changedCB): Call store_monospaced_changed.
17604 (init_gsettings): New function.
17605 (xsettings_initialize): Call init_gsettings.
17606 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17607 to NULL.
17608
640c8776 17609 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
17610 GCONF_CFLAGS/LIBS.
17611
5386012d
MR
176122011-06-29 Martin Rudalics <rudalics@gmx.at>
17613
17614 * window.c (resize_root_window, grow_mini_window)
17615 (shrink_mini_window): Rename Qresize_root_window to
17616 Qwindow_resize_root_window and Qresize_root_window_vertically to
17617 Qwindow_resize_root_window_vertically.
17618
f13e0b08
PE
176192011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17620
17621 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17622
94515237
JB
176232011-06-27 Juanma Barranquero <lekktu@gmail.com>
17624
17625 * makefile.w32-in: Redesign dependencies so they reflect more
17626 clearly which files are directly included by each source file,
17627 and not through other includes.
17628
e43b6e43
MR
176292011-06-27 Martin Rudalics <rudalics@gmx.at>
17630
17631 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17632 (sort_overlays, overlay_strings): When an overlay's clone number
17633 matches the window's clone number process the overlay even if
17634 the overlay's window property doesn't match the current window.
17635
d68443dc
MR
17636 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17637 (Fwindow_hchild): Rename to Fwindow_left_child.
17638 (Fwindow_next): Rename to Fwindow_next_sibling.
17639 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
17640 (resize_window_check): Rename to window_resize_check.
17641 (resize_window_apply): Rename to window_resize_apply.
17642 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17643 (Fdelete_other_windows_internal, resize_frame_windows)
17644 (Fsplit_window_internal, Fdelete_window_internal)
17645 (grow_mini_window, shrink_mini_window)
17646 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 17647
c7e73be5
JD
176482011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17649
17650 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17651 (emacs_fixed_set_min_size): Remove.
17652 (emacs_fixed_new): Take frame as argument.
17653
17654 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17655 (_EmacsFixedPrivate): Remove minwidth/height.
17656 Add struct frame *f.
17657 (emacs_fixed_init): Initialize priv->f.
17658 (get_parent_class, emacs_fixed_set_min_size): Remove.
17659 (emacs_fixed_new): Set priv->f to argument.
17660 (emacs_fixed_get_preferred_width)
17661 (emacs_fixed_get_preferred_height): Use min_width/height from
17662 frames size_hint to set minimum and natural (Bug#8919).
17663 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17664 and use min_width/height from frames size_hint to set
17665 min_width/height (Bug#8919).
17666
17667 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
17668 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17669 Fix indentation.
c7e73be5 17670
cf99dcf8
EZ
176712011-06-26 Eli Zaretskii <eliz@gnu.org>
17672
17673 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17674 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17675 called at ZV.
17676
029529ac
CY
176772011-06-26 Chong Yidong <cyd@stupidchicken.com>
17678
17679 * process.c (wait_reading_process_output): Bypass select if
17680 waiting for a cell while ignoring keyboard input, and input is
17681 pending. Suggested by Jan Djärv (Bug#8869).
17682
7a7ef429
PE
176832011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17684
17685 Use gnulib's dup2 module instead of rolling our own.
17686 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17687
11fdef7d 176882011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
17689
17690 * dispnew.c (scrolling_window): Before scrolling, turn off a
17691 mouse-highlight in the window being scrolled.
17692
cd3520a4
JB
176932011-06-24 Juanma Barranquero <lekktu@gmail.com>
17694
17695 Move DEFSYM to lisp.h and use everywhere.
17696
17697 * character.h (DEFSYM): Move declaration...
17698 * lisp.h (DEFSYM): ...here.
17699
17700 * gnutls.c:
17701 * minibuf.c:
17702 * w32menu.c:
17703 * w32proc.c:
17704 * w32select.c: Don't include character.h.
17705
17706 * alloc.c (syms_of_alloc):
17707 * buffer.c (syms_of_buffer):
17708 * bytecode.c (syms_of_bytecode):
17709 * callint.c (syms_of_callint):
17710 * casefiddle.c (syms_of_casefiddle):
17711 * casetab.c (init_casetab_once):
17712 * category.c (init_category_once, syms_of_category):
17713 * ccl.c (syms_of_ccl):
17714 * cmds.c (syms_of_cmds):
17715 * composite.c (syms_of_composite):
17716 * dbusbind.c (syms_of_dbusbind):
17717 * dired.c (syms_of_dired):
17718 * dispnew.c (syms_of_display):
17719 * doc.c (syms_of_doc):
17720 * editfns.c (syms_of_editfns):
17721 * emacs.c (syms_of_emacs):
17722 * eval.c (syms_of_eval):
17723 * fileio.c (syms_of_fileio):
17724 * fns.c (syms_of_fns):
17725 * frame.c (syms_of_frame):
17726 * fringe.c (syms_of_fringe):
17727 * insdel.c (syms_of_insdel):
17728 * keymap.c (syms_of_keymap):
17729 * lread.c (init_obarray, syms_of_lread):
17730 * macros.c (syms_of_macros):
17731 * msdos.c (syms_of_msdos):
17732 * print.c (syms_of_print):
17733 * process.c (syms_of_process):
17734 * search.c (syms_of_search):
17735 * sound.c (syms_of_sound):
17736 * syntax.c (init_syntax_once, syms_of_syntax):
17737 * terminal.c (syms_of_terminal):
17738 * textprop.c (syms_of_textprop):
17739 * undo.c (syms_of_undo):
17740 * w32.c (globals_of_w32):
17741 * window.c (syms_of_window):
17742 * xdisp.c (syms_of_xdisp):
17743 * xfaces.c (syms_of_xfaces):
17744 * xfns.c (syms_of_xfns):
17745 * xmenu.c (syms_of_xmenu):
17746 * xsettings.c (syms_of_xsettings):
17747 * xterm.c (syms_of_xterm): Use DEFSYM.
17748
4228cf16
TZ
177492011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17750
cd3520a4 17751 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 17752
7fcccf1e
PE
177532011-06-23 Paul Eggert <eggert@cs.ucla.edu>
17754
7efb4e0e
PE
17755 Integer and buffer overflow fixes (Bug#8873).
17756
ff5844ad
PE
17757 * print.c (printchar, strout): Check for string overflow.
17758 (PRINTPREPARE, printchar, strout):
17759 Don't set size unless allocation succeeds.
17760
90532f02
PE
17761 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
17762 for sizes. Check for string overflow more accurately.
17763 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
17764
6d84508d
PE
17765 * macros.c: Integer and buffer overflow fixes.
17766 * keyboard.h (struct keyboard.kbd_macro_bufsize):
17767 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
17768 Use ptrdiff_t, not int, for sizes.
17769 Don't increment bufsize until after realloc succeeds.
17770 Check for size-calculation overflow.
17771 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
17772
437b2cb4
PE
17773 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
17774
8b9ac8b4
PE
17775 * lread.c: Integer overflow fixes.
17776 (read_integer): Radix is now EMACS_INT, not int,
17777 to improve quality of diagnostics for out-of-range radices.
17778 Calculate buffer size correctly for out-of-range radices.
17779 (read1): Check for integer overflow in radices, and in
17780 read-circle numbers.
82cb60d3
PE
17781 (read_escape): Avoid int overflow.
17782 (Fload, openp, read_buffer_size, read1)
17783 (substitute_object_recurse, read_vector, read_list, map_obarray):
17784 Use ptrdiff_t, not int, for sizes.
17785 (read1): Use EMACS_INT, not int, for sizes.
20270765 17786 Check for size overflow.
8b9ac8b4 17787
7fcccf1e
PE
17788 * image.c (cache_image): Check for size arithmetic overflow.
17789
bfbbd7e7
PE
17790 * lread.c: Integer overflow issues.
17791 (saved_doc_string_size, saved_doc_string_length)
17792 (prev_saved_doc_string_size, prev_saved_doc_string_length):
17793 Now ptrdiff_t, not int.
17794 (read1): Don't assume doc string length fits in int. Check for
17795 out-of-range doc string lengths.
17796 (read_list): Don't assume file position fits in int.
39019e54 17797 (read_escape): Check for hex character overflow.
bfbbd7e7 17798
4e323265
LL
177992011-06-22 Leo Liu <sdl.web@gmail.com>
17800
17801 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
17802 Move to minibuffer.el.
17803
85fece3e
PE
178042011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17805
20b84ce9 17806 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
17807 The following patches are for when GLYPH_DEBUG && !XASSERT.
17808 * dispextern.h (trace_redisplay_p, dump_glyph_string):
17809 * dispnew.c (flush_stdout):
17810 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
17811 Mark as externally visible.
17812 * dispnew.c (check_window_matrix_pointers): Now static.
17813 * dispnew.c (window_to_frame_vpos):
17814 * xfns.c (unwind_create_frame):
17815 * xterm.c (x_check_font): Remove unused local.
17816 * scroll.c (CHECK_BOUNDS):
17817 * xfaces.c (cache_fache): Rename local to avoid shadowing.
17818 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
17819 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
17820 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
17821 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
17822 Now static.
17823 (debug_method_add): Use va_list and vsprintf rather than relying
17824 on undefined behavior with wrong number of arguments.
17825 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
17826 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
17827 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
17828 since we're not interested in debugging glyphs with old libraries.
17829 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
17830 GCC 4.6.0's static checking.
17831
0766b489
PE
178322011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17833
31fd4b32
PE
17834 Integer overflow and signedness fixes (Bug#8873).
17835 A few related buffer overrun fixes, too.
17836
b79e8648
PE
17837 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
17838
0766b489
PE
17839 * dispextern.h (struct face.stipple):
17840 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17841 (x_bitmap_mask, x_allocate_bitmap_record)
17842 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17843 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17844 (x_create_bitmap_from_xpm_data):
17845 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17846 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17847 (.bitmaps_last):
17848 * xfaces.c (load_pixmap):
17849 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17850 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17851 (.bitmaps_last, struct x_output.icon_bitmap):
17852 Use ptrdiff_t, not int, for bitmap indexes.
17853 (x_allocate_bitmap_record): Check for size overflow.
17854 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17855
b081724f
PE
17856 Use ptrdiff_t, not int, for overlay counts.
17857 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17858 * editfns.c (overlays_around, get_pos_property):
17859 * textprop.c (get_char_property_and_overlay):
17860 * xdisp.c (next_overlay_change, note_mouse_highlight):
17861 * xfaces.c (face_at_buffer_position):
21514da7
PE
17862 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17863 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17864 (Fnext_overlay_change, Fprevious_overlay_change)
17865 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 17866 Use ptrdiff_t, not int, for sizes.
21514da7 17867 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 17868
3de73e5e
PE
17869 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17870
2606c57b
PE
17871 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17872 (x_session_initialize): Do not assume string length fits in int.
17873
aaafe47a
PE
17874 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17875 This is unlikely, but can occur if DPI is outlandish.
17876
2674ddc8 17877 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
17878 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17879
28154962
PE
17880 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17881 * xrdb.c (magic_file_p, search_magic_path):
17882 Omit last arg SUFFIX; it was always 0. All callers changed.
17883 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17884
7de51af5
PE
17885 * xfont.c (xfont_match): Avoid need for strlen.
17886
25ed6cc3
PE
17887 * xfns.c: Don't assume strlen fits in int.
17888 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17889
4eab31dd
PE
17890 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17891 not unsigned long, as we prefer signed integers. All callers changed.
17892 Detect integer overflow in repeat count.
17893 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 17894 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 17895
171e2a58
PE
17896 * termcap.c: Don't assume sizes fit in int and never overflow.
17897 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
17898 (gobble_line): Check for size-calculation overflow.
17899
ad39faca 17900 * minibuf.c (Fread_buffer):
6e5bb2dc 17901 * lread.c (intern, intern_c_string):
74ca2eb3
PE
17902 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
17903 Don't assume string length fits in int.
17904
52c61c22 17905 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
17906 * gtkutil.c (style_changed_cb): Avoid need for strlen.
17907
b5b8c9e5
PE
17908 * font.c: Don't assume string length fits in int.
17909 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
17910 Use ptrdiff_t, not int.
ccd6111c
PE
17911 (font_intern_prop): Don't assume string length fits in int.
17912 Don't assume integer property fits in fixnum.
17913 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 17914
882f0d81 17915 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 17916 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
17917 Reformulate so as not to need the command string.
17918 Invoke gzip -cd rather than gunzip, as it's more portable.
17919 (lock_info_type, lock_file_1, lock_file):
17920 Don't assume pid_t and time_t fit in unsigned long.
17921 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
17922 (current_lock_owner): Prefer signed type for sizes.
17923 Use memcpy, not strncpy, where memcpy is what is really wanted.
17924 Don't assume (via atoi) that time_t and pid_t fit in int.
17925 Check for time_t and/or pid_t out of range, e.g., via a network share.
17926 Don't alloca where an auto var works fine.
17927
93f4cf88
PE
17928 * fileio.c: Fix some integer overflow issues.
17929 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
17930 Don't assume string length fits in int.
17931 (directory_file_name): Don't assume string length fits in long.
17932 (make_temp_name): Don't assume pid fits in int, or that its print
17933 length is less than 20.
17934
f3e92b69
PE
17935 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
17936
1bfdaf10
PE
17937 * coding.c (make_subsidiaries): Don't assume string length fits in int.
17938
35016e9a
PE
17939 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
17940
3d1e65a1
PE
17941 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
17942 We prefer signed integers, even for size calculations.
17943
0b963a93
PE
17944 * emacs.c: Don't assume string length fits in 'int'.
17945 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
17946 (main): Don't invoke strlen when not needed.
17947
573f4b54
PE
17948 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
17949 (XD_DEBUG_MESSAGE): Don't waste a byte.
17950
989f33ba
PE
17951 * callproc.c (getenv_internal_1, getenv_internal)
17952 (Fgetenv_internal):
965d34eb
PE
17953 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
17954
e4d29b33
PE
17955 * lread.c (invalid_syntax): Omit length argument.
17956 All uses changed. This doesn't fix a bug, but it simplifies the
17957 code away from its former Hollerith-constant appearance, and it's
17958 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 17959 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 17960
eb49b136
PE
17961 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
17962 This didn't break anything, but it didn't help either.
17963 It's confusing to put a bogus integer in a place where the actual
17964 value does not matter.
9f62aeb1 17965 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 17966 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 17967
15375a22
PE
17968 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
17969 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
17970 implementation.
b61cc01c
PE
17971 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
17972 We prefer signed types, and the value cannot exceed the EMACS_INT
17973 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
17974 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
17975 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
17976 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 17977
53b2623d
PE
17978 * indent.c (sane_tab_width): New function.
17979 (current_column, scan_for_column, Findent_to, position_indentation)
17980 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 17981 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 17982
51cab52b 17983 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 17984
f2ed8a70
PE
17985 * lisp.h (lint_assume): New macro.
17986 * composite.c (composition_gstring_put_cache):
17987 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
17988
abe80cc6
PE
17989 * editfns.c, insdel.c:
17990 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 17991
b02c740e
PE
17992 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
17993
ebc96716
PE
17994 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
17995
b4e50fa0 17996 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 17997 Use much-faster test for byte-length change.
311d5d7c 17998 Don't assume string byte-length fits in 'int'.
a4cf38e4 17999 Check that character arg fits in 'int'.
85461888 18000 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 18001
c0c1ee9f
PE
18002 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18003
a498d7f4
PE
18004 * fns.c (concat): Catch string overflow earlier.
18005 Do not rely on integer wraparound.
18006
51cab52b
PE
18007 * dispextern.h (struct it.overlay_strings_charpos)
18008 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
18009 * xdisp.c (forward_to_next_line_start)
18010 (back_to_previous_visible_line_start)
18011 (reseat_at_next_visible_line_start, next_element_from_buffer):
18012 Don't arbitrarily truncate the value of 'selective' to int.
18013
76031fad
PE
18014 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18015
5eb55db9
PE
18016 * composite.c: Don't truncate sizes to 'int'.
18017 (composition_gstring_p, composition_reseat_it)
18018 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
18019 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18020 not EMACS_UINT, for indexes.
5eb55db9 18021
0703a717
PE
18022 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18023
d6202519
PE
18024 * buffer.c: Include <verify.h>.
18025 (struct sortvec.priority, struct sortstr.priority):
8961a454 18026 Now EMACS_INT, not int.
c20998a7 18027 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
18028 (struct sortstr.size, record_overlay_string)
18029 (struct sortstrlist.size, struct sortlist.used):
18030 Don't truncate size to int.
18031 (record_overlay_string): Check for size-calculation overflow.
d6202519 18032 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 18033
d5a19415
JM
180342011-06-22 Jim Meyering <meyering@redhat.com>
18035
029529ac 18036 Don't leak an XBM-image-sized buffer
d5a19415
JM
18037 * image.c (xbm_load): Free the image buffer after using it.
18038
a9041e6c
PE
180392011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18040
18041 Port to Sun C.
18042 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18043 that Sun C diagnosed.
18044 * fns.c (secure_hash): Fix pointer signedness issue.
18045 * intervals.c (static_offset_intervals): New function.
18046 (offset_intervals): Use it.
18047
7f3f739f
LL
180482011-06-21 Leo Liu <sdl.web@gmail.com>
18049
18050 * deps.mk (fns.o):
18051 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18052 sha512.h.
18053
18054 * fns.c (secure_hash): Rename from crypto_hash_function and change
18055 the first arg to accept symbols.
5b66d427 18056 (Fsecure_hash): New primitive.
7f3f739f
LL
18057 (syms_of_fns): New symbols.
18058
76147d94
DD
180592011-06-20 Deniz Dogan <deniz@dogan.se>
18060
18061 * process.c (Fset_process_buffer): Clarify return value in
18062 docstring.
18063
7d7d0045
CY
180642011-06-18 Chong Yidong <cyd@stupidchicken.com>
18065
18066 * dispnew.c (add_window_display_history): Use BVAR.
18067
18068 * xdisp.c (debug_method_add): Use BVAR.
18069 (check_window_end, dump_glyph_matrix, dump_glyph)
18070 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18071
18072 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18073 Likewise.
18074
18075 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18076 check till after the cache is created in init_frame_faces.
18077
ff2bc410
SM
180782011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18079
18080 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18081
28177add
PE
180822011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18083
dd3482fe
PE
18084 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18085 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18086 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18087
393d71f3 18088 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
18089 * fileio.c (Finsert_file_contents):
18090 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18091 Remove the old (too-loose) buffer overflow checks.
18092 They weren't needed, since make_gap checks for buffer overflow.
18093 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18094 The old code merely checked for Emacs fixnum overflow, and relied
18095 on undefined (wraparound) behavior. The new code avoids undefined
18096 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18097
2e6813b0 18098 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
18099 Tune. Don't use wider integers than needed. Don't use alloca.
18100 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 18101
599a9e4f
PE
18102 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18103
99561444
PE
18104 * insdel.c, lisp.h (buffer_overflow): New function.
18105 (insert_from_buffer_1, replace_range, replace_range_2):
18106 * insdel.c (make_gap_larger):
18107 * editfns.c (Finsert_char):
18108 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18109
28177add
PE
18110 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18111
e69dafad
PE
181122011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18113
4baa020d 18114 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 18115
b1c46f02
PE
18116 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18117 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18118
e69dafad
PE
18119 * fileio.c: Don't assume EMACS_INT fits in off_t.
18120 (emacs_lseek): New static function.
18121 (Finsert_file_contents, Fwrite_region): Use it.
18122 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18123
566684ea
PE
18124 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18125
e6966cd6
PE
18126 * fns.c: Don't overflow int when computing a list length.
18127 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18128 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18129 truncation on 64-bit hosts. Check for QUIT every
18130 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18131 faster and is responsive enough.
18132 (Flength): Report an error instead of overflowing an integer.
18133 (Fsafe_length): Return a float if the value is not representable
18134 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 18135 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 18136 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 18137
dd0b0efb
PE
18138 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18139 (header_size, word_size): New constants.
18140 (allocate_vectorlike): Don't check size overflow here.
18141 (allocate_vector): Check it here instead, since this is the only
18142 caller of allocate_vectorlike that could cause overflow.
18143 Check that the new vector's length is representable as a fixnum.
18144
86fe5cfe
PE
18145 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18146 The previous code was bogus. For example, next_almost_prime (32)
18147 returned 39, which is undesirable as it is a multiple of 3; and
18148 next_almost_prime (24) returned 25, which is a multiple of 5 so
18149 why was the code bothering to check for multiples of 7?
18150
80e88859
PE
18151 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18152
4a2f0ad6
PE
18153 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18154
f66c7cf8
PE
18155 Variadic C functions now count arguments with ptrdiff_t.
18156 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18157 Back then I didn't know that the Emacs coding style prefers signed int.
18158 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
18159 were being counted with int, which may truncate counts on 64-bit
18160 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
18161 * lisp.h (struct Lisp_Subr.function.aMANY)
18162 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18163 Arg counts are now ptrdiff_t, not size_t.
18164 All variadic functions and their callers changed accordingly.
18165 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18166 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18167 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18168 * callint.c (Fcall_interactively): Check arg count for overflow,
18169 to avoid potential buffer overrun. Use signed char, not 'int',
18170 for 'varies' array, so that we needn't bother to check its size
18171 calculation for overflow.
18172 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18173 * eval.c (apply_lambda):
18174 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18175 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18176 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18177
a1759b76
PE
18178 * callint.c (Fcall_interactively): Don't use index var as event count.
18179
d96be9fc
PE
18180 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18181 * mem-limits.h (SIZE): Remove; no longer used.
18182
a690a978 18183 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 18184
578c21e6
PE
18185 Remove unnecessary casts.
18186 * xterm.c (x_term_init):
18187 * xfns.c (x_set_border_pixel):
18188 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18189 These aren't needed now that we assume ANSI C.
18190
96f53c6c
PE
18191 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18192 It's more likely to cause problems (due to unsigned overflow)
18193 than to cure them.
18194
83c77d31
PE
18195 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18196
ee2079f1
PE
18197 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18198
6da65536
PE
18199 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18200
7147c4a4
PE
18201 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18202
193e32d9
PE
18203 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18204
e5533da6
PE
18205 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18206
9910e595
PE
18207 GLYPH_CODE_FACE returns EMACS_INT, not int.
18208 * dispextern.h (merge_faces):
18209 * xfaces.c (merge_faces):
01103c44
PE
18210 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18211 Don't assume EMACS_INT fits in int.
9910e595 18212
2638320e
PE
18213 * character.h (CHAR_VALID_P): Remove unused parameter.
18214 * fontset.c, lisp.h, xdisp.c: All uses changed.
18215
045eb8d9
PE
18216 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18217
c1f134b5
PE
18218 * fns.c (concat): Minor tuning based on overflow analysis.
18219 This doesn't fix any bugs. Use int to hold character, instead
18220 of constantly refetching from Emacs object. Use XFASTINT, not
18221 XINT, for value known to be a character. Don't bother comparing
18222 a single byte to 0400, as it's always less.
18223
395fcb93 18224 * floatfns.c (Fexpt):
327eeec8
PE
18225 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18226
abbd3d23
PE
18227 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18228 for characters.
18229
684a03ef
PE
18230 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18231
0fed43f3
PE
18232 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18233 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18234 incorrectly succeed when S was a string, because 4294967386 was
18235 truncated before it was used.
18236
8fd02eb7
PE
18237 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18238 Otherwise, an out-of-range integer could cause undefined behavior
18239 on a 64-bit host.
18240
f8c86b69
PE
18241 * composite.c: Use int, not EMACS_INT, for characters.
18242 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18243 EMACS_INT, for values that are known to be in character range.
18244 This doesn't fix any bugs but is the usual style inside Emacs and
18245 may generate better code on 32-bit machines.
18246
34206dd2
PE
18247 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18248 This is for reasons similar to the recent CHAR_STRING fix.
18249 * charset.c (Fencode_char): Check that character arg is actually
18250 a character. Pass an int to ENCODE_CHAR.
18251 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18252 wider than 'int', as a compile-time check to prevent future regressions
18253 in this area.
18254
c5958d4c 18255 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
18256
18257 Make sure a 64-bit char is never passed to CHAR_STRING.
18258 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18259 by silently ignoring the top 32 bits, allowing some values
18260 that were far too large to be valid characters.
18261 * character.h: Include <verify.h>.
18262 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18263 arguments are no wider than unsigned, as a compile-time check
18264 to prevent future regressions in this area.
18265 * data.c (Faset):
01103c44 18266 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
18267 (Fsubst_char_in_region):
18268 * fns.c (concat):
18269 * xdisp.c (decode_mode_spec_coding):
18270 Adjust to CHAR_STRING's new requirement.
18271 * editfns.c (Finsert_char, Fsubst_char_in_region):
18272 * fns.c (concat): Check that character args are actually
18273 characters. Without this test, these functions did the wrong
18274 thing with wildly out-of-range values on 64-bit hosts.
18275
d37ca623
PE
18276 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18277 These casts should not be needed on 32-bit hosts, either.
18278 * keyboard.c (read_char):
18279 * lread.c (Fload): Remove casts to unsigned.
18280
ea204efb
PE
18281 * lisp.h (UNSIGNED_CMP): New macro.
18282 This fixes comparison bugs on 64-bit hosts.
18283 (ASCII_CHAR_P): Use it.
18284 * casefiddle.c (casify_object):
01103c44 18285 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
18286 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18287 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18288 * dispextern.h (FACE_FROM_ID):
18289 * keyboard.c (read_char): Use UNSIGNED_CMP.
18290
41cb286c
PE
18291 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18292 not to EMACS_INT, to avoid GCC warning.
18293
4a1b9832
PE
18294 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18295
55daad71
PE
18296 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18297 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18298 isn't needed on 32-bit machines.
8f95c75c 18299
01103c44
PE
18300 * buffer.c (Fgenerate_new_buffer_name):
18301 Use EMACS_INT for count, not int.
0ceccced 18302 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
18303
18304 * data.c (Qcompiled_function): Now static.
18305
c6f072e7
PE
18306 * window.c (window_body_lines): Now static.
18307
20ce5912
PE
18308 * image.c (gif_load): Rename local to avoid shadowing.
18309
9c4c5f81
PE
18310 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18311 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18312 * alloc.c (make_save_value): Integer argument is now of type
18313 ptrdiff_t, not int.
18314 (mark_object): Use ptrdiff_t, not int.
18315 * lisp.h (pD): New macro.
18316 * print.c (print_object): Use it.
18317
c0c5c8ae
PE
18318 * alloc.c: Use EMACS_INT, not int, to count objects.
18319 (total_conses, total_markers, total_symbols, total_vector_size)
18320 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
18321 (total_free_floats, total_floats, total_free_intervals)
18322 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
18323 Now EMACS_INT, not int. All uses changed.
18324 (Fgarbage_collect): Compute overall total using a double, so that
18325 integer overflow is less likely to be a problem. Check for overflow
18326 when converting back to an integer.
5a25e253
PE
18327 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18328 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18329 These were 'int' variables that could overflow on 64-bit hosts;
18330 they were never used, so remove them instead of repairing them.
211a0b2a 18331 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
18332 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18333 Previously, this ceilinged at INT_MAX, but that doesn't work on
18334 64-bit machines.
e46bb31a 18335 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 18336
c78baabf 18337 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 18338 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
18339 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18340 when a (possibly-narrower) signed value would do just as well.
18341 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 18342
c9d624c6
PE
18343 * alloc.c: Catch some string size overflows that we were missing.
18344 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18345 for convenience in STRING_BYTES_MAX.
18346 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18347 The definition here is exact; the one in lisp.h was approximate.
18348 (allocate_string_data): Check for string overflow. This catches
18349 some instances we weren't catching before. Also, it catches
18350 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18351 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18352 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 18353
c9d624c6
PE
18354 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18355 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 18356 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 18357
353032ce
PE
18358 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18359
2bccce07
PE
18360 * alloc.c (Fmake_string): Check for out-of-range init.
18361
0ac30604
SM
183622011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18363
18364 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18365
c195f2de
JD
183662011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18367
18368 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18369 xg_get_default_scrollbar_width.
18370
18371 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18372 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18373 (style_changed_cb): Call update_theme_scrollbar_width and call
18374 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18375 all frames (Bug#8505).
18376 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18377 Call gtk_window_set_resizable if HAVE_GTK3.
18378 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18379 and height if HAVE_GTK3 (Bug#8505).
18380 (scroll_bar_width_for_theme): New variable.
18381 (update_theme_scrollbar_width): New function.
18382 (xg_get_default_scrollbar_width): Move code to
18383 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18384 (xg_initialize): Call update_theme_scrollbar_width.
18385
18386 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18387
18388 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18389
e10ac9f1
MR
183902011-06-12 Martin Rudalics <rudalics@gmx.at>
18391
18392 * frame.c (make_frame): Call other_buffer_safely instead of
18393 other_buffer.
18394
18395 * window.c (temp_output_buffer_show): Call display_buffer with
18396 second argument Vtemp_buffer_show_specifiers and reset latter
18397 immediately after the call.
18398 (Vtemp_buffer_show_specifiers): New variable.
18399 (auto_window_vscroll_p, next_screen_context_lines)
18400 (Vscroll_preserve_screen_position): Remove leading asterisks from
18401 doc-strings.
18402
2d3c217e 184032011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 18404
7b7f97e8 18405 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
18406 * buffer.c (Qclone_number): Remove for now, as it's unused.
18407 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18408 (record_buffer): Remove unused local.
18409 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18410 (set_frame_buffer_list): Remove; unused.
18411 * frame.h (other_visible_frames): Remove decl.
18412 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18413 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18414 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18415 if HAVE_GPM.
18416 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18417 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18418 Define only if HAVE_GPM.
18419 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18420 (update_hints_inhibit): Remove; never set. All uses removed.
18421 * widgetprv.h (emacsFrameClassRec): Remove decl.
18422 * window.c (delete_deletable_window): Now returns void, since it
18423 wasn't returning anything.
18424 (compare_window_configurations): Remove unused locals.
18425 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18426 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
18427 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18428 the same widths as pointers. This follows up on the 2011-05-06 patch.
18429 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18430 * xterm.h: Likewise.
18431 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18432
1384b89e
JB
184332011-06-12 Juanma Barranquero <lekktu@gmail.com>
18434
18435 * makefile.w32-in: Update dependencies.
18436 (LISP_H): Add lib/intprops.h.
18437
1100a63c
CY
184382011-06-11 Chong Yidong <cyd@stupidchicken.com>
18439
18440 * image.c (gif_load): Add animation frame delay to the metadata.
18441 (syms_of_image): Use DEFSYM. New symbol `delay'.
18442
6198ccd0
MR
184432011-06-11 Martin Rudalics <rudalics@gmx.at>
18444
18445 * window.c (delete_deletable_window): Re-add.
18446 (Fset_window_configuration): Rewrite to handle dead buffers and
18447 consequently deletable windows.
18448 (window_tree, Fwindow_tree): Remove. Supply functionality in
18449 window.el.
18450 (compare_window_configurations): Simplify code.
18451
b6e3633c
AS
184522011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18453
1ab0dee5
AS
18454 * image.c (imagemagick_load_image): Fix type mismatch.
18455 (Fimagemagick_types): Likewise.
18456
b6e3633c
AS
18457 * window.h (replace_buffer_in_windows): Declare.
18458
9397e56f
MR
184592011-06-11 Martin Rudalics <rudalics@gmx.at>
18460
18461 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18462 Qclone_number. Remove external declaration of Qdelete_window.
18463 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18464 code.
640c8776
SM
18465 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18466 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
18467 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18468 buffer list implementation.
18469 (other_buffer_safely): New function.
18470 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18471 calls to replace_buffer_in_windows and
18472 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18473 if allowed.
18474 (record_buffer): Inhibit quitting and rewrite using quittable
18475 functions. Run Qbuffer_list_update_hook if allowed.
18476 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
18477 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18478 Move switch-to-buffer to window.el.
9397e56f
MR
18479 (bury-buffer): Move to window.el.
18480 (Vbuffer_list_update_hook): New variable.
18481
18482 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18483 section.
18484
18485 * window.h (resize_frame_windows): Move up in code.
18486 (Fwindow_frame): Remove EXFUN.
18487 (replace_buffer_in_all_windows): Remove prototype.
18488 (replace_buffer_in_windows_safely): Add prototype.
18489
18490 * window.c: Declare Qdelete_window static again. Move down
18491 declaration of select_count.
18492 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18493 (Fother_window): Move to window.el.
18494 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18495 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18496 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18497 window.el.
18498 (replace_buffer_in_windows): Implement by calling
18499 Qreplace_buffer_in_windows.
18500 (replace_buffer_in_all_windows): Remove with some functionality
18501 moved into replace_buffer_in_windows_safely.
18502 (replace_buffer_in_windows_safely): New function.
18503 (select_window_norecord, select_frame_norecord): Move in front
18504 of run_window_configuration_change_hook. Remove now obsolete
18505 declarations.
640c8776
SM
18506 (Fset_window_buffer): Rewrite doc-string.
18507 Call Qrecord_window_buffer.
9397e56f
MR
18508 (keys_of_window): Move binding for other-window to window.el.
18509
b50691aa
CY
185102011-06-11 Chong Yidong <cyd@stupidchicken.com>
18511
18512 * dispextern.h (struct image): Replace data member, whose int_val
18513 and ptr_val fields were not used by anything, with a single
18514 lisp_val object.
18515
18516 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18517 (gif_clear_image, gif_load, imagemagick_load_image)
18518 (gs_clear_image, gs_load): Callers changed.
18519
3f754b86
PE
185202011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18521
cca69397
PE
18522 * buffer.h: Include <time.h>, for time_t.
18523 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18524
109e28d0
PE
18525 Fix minor problems found by static checking.
18526
60737f02
PE
18527 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18528
4b66faf3
PE
18529 Make identifiers static if they are not used in other modules.
18530 * data.c (Qcompiled_function, Qframe, Qvector):
18531 * image.c (QimageMagick, Qsvg):
18532 * minibuf.c (Qmetadata):
18533 * window.c (resize_window_check, resize_root_window): Now static.
18534 * window.h (resize_window_check, resize_root_window): Remove decls.
18535
109e28d0
PE
18536 * window.c (window_deletion_count, delete_deletable_window):
18537 Remove; unused.
46a4ce9e
PE
18538 (window_body_lines): Now static.
18539 (Fdelete_other_windows_internal): Mark vars as initialized.
18540 Make sure 'resize_failed' is initialized.
18541 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18542 (resize_window_apply): Remove unused local.
18543 * window.h (delete_deletable_window): Remove decl.
18544
109e28d0 18545 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
18546 (imagemagick_load_image): Fix pointer signedness problem by changing
18547 last arg from unsigned char * to char *. All uses changed.
18548 Also, fix a local for similar reasons.
18549 Remove unused locals. Remove locals to avoid shadowing.
18550 (fn_rsvg_handle_free): Remove; unused.
18551 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 18552 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 18553
3f754b86
PE
18554 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18555
2547adb1
CY
185562011-06-10 Chong Yidong <cyd@stupidchicken.com>
18557
18558 * image.c (gif_load): Fix omitted cast error introduced by
18559 2011-06-06 change.
18560
2c8e37d4
MR
185612011-06-10 Martin Rudalics <rudalics@gmx.at>
18562
18563 * window.h (resize_proportionally, orig_total_lines)
18564 (orig_top_line): Remove from window structure.
18565 (set_window_height, set_window_width, change_window_heights)
18566 (Fdelete_window): Remove prototypes.
18567 (resize_frame_windows): Remove duplicate declaration.
18568
440a42e3
EZ
185692011-06-10 Eli Zaretskii <eliz@gnu.org>
18570
18571 * window.h (resize_frame_windows, resize_window_check)
18572 (delete_deletable_window, resize_root_window)
18573 (resize_frame_windows): Declare prototypes.
18574
18575 * window.c (resize_window_apply): Make definition be "static" to
18576 match the prototype.
18577
562dd5e9
MR
185782011-06-10 Martin Rudalics <rudalics@gmx.at>
18579
18580 * window.c: Remove declarations of Qwindow_size_fixed,
18581 window_min_size_1, window_min_size_2, window_min_size,
18582 size_window, window_fixed_size_p, enlarge_window, delete_window.
18583 Remove static from declaration of Qdelete_window, it's
18584 temporarily needed by Fbury_buffer.
18585 (replace_window): Don't assign orig_top_line and
18586 orig_total_lines.
18587 (Fdelete_window, delete_window): Remove. Window deletion is
18588 handled by window.el.
640c8776
SM
18589 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18590 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
18591 (Fdelete_other_windows): Remove. Deleting other windows is
18592 handled by window.el.
18593 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18594 handled in window.el.
18595 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18596 Window minimum sizes are handled in window.el.
18597 (shrink_windows, size_window, set_window_height)
18598 (set_window_width, change_window_heights, window_height)
18599 (window_width, CURBEG, CURSIZE, enlarge_window)
18600 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18601 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18602 handled in window.el.
18603 (make_dummy_parent): Rename to make_parent_window and give it a
18604 second argument horflag.
18605 (make_window): Don't set resize_proportionally any more.
18606 (Fsplit_window): Remove. Windows are split in window.el.
18607 (save_restore_action, save_restore_orig_size)
18608 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18609 Resize mini windows in window.el.
18610 (grow_mini_window, shrink_mini_window): Implement by calling
18611 Qresize_root_window_vertically, resize_window_check and
18612 resize_window_apply.
640c8776
SM
18613 (saved_window, Fset_window_configuration, save_window_save):
18614 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
18615 resize_proportionally.
18616 (window_min_height, window_min_width): Move to window.el.
18617 (keys_of_window): Move bindings for delete-other-windows,
18618 split-window, delete-window and enlarge-window to window.el.
18619
18620 * buffer.c: Temporarily extern Qdelete_window.
18621 (Fbury_buffer): Temporarily call Qdelete_window instead of
18622 Fdelete_window (Fbury_buffer will move to window.el soon).
18623
18624 * frame.c (set_menu_bar_lines_1): Remove code handling
18625 orig_top_line and orig_total_lines.
18626
18627 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18628 set_window_height but set heights directly.
18629 (change_frame_size_1): Use resize_frame_windows.
18630
18631 * xdisp.c (init_xdisp): Don't use set_window_height but set
18632 heights directly.
18633
640c8776
SM
18634 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18635 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
18636 run_window_configuration_change_hook.
18637
18638 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18639 instead of change_window_heights and run
18640 run_window_configuration_change_hook.
18641
1a13852e
MR
186422011-06-09 Martin Rudalics <rudalics@gmx.at>
18643
18644 * window.c (replace_window): Rename second argument REPLACEMENT to
18645 NEW. New third argument SETFLAG. Rewrite.
18646 (delete_window, make_dummy_parent): Call replace_window with
18647 third argument 1.
18648 (window_list_1): Move down in code.
18649 (run_window_configuration_change_hook): Move set_buffer part
18650 before select_frame_norecord part in order to unwind correctly.
18651 Rename count1 to count.
18652 (recombine_windows, delete_deletable_window, resize_root_window)
18653 (Fdelete_other_windows_internal)
18654 (Frun_window_configuration_change_hook, make_parent_window)
18655 (resize_window_check, resize_window_apply, Fresize_window_apply)
18656 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
18657 (Fdelete_window_internal, Fresize_mini_window_internal):
18658 New functions.
1a13852e
MR
18659 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18660
f3d1777e
MR
186612011-06-08 Martin Rudalics <rudalics@gmx.at>
18662
496e208e
MR
18663 * window.h (window): Add some new members to window structure -
18664 normal_lines, normal_cols, new_total, new_normal, clone_number,
18665 splits, nest, prev_buffers, next_buffers.
18666 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 18667 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 18668
f3d1777e
MR
18669 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18670 Remove.
496e208e
MR
18671 (make_dummy_parent): Set new members of windows structure.
18672 (make_window): Move down in code. Handle new members of window
18673 structure.
18674 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18675 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18676 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18677 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
18678 (Fset_window_next_buffers, Fset_window_clone_number):
18679 New functions.
496e208e
MR
18680 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18681 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18682 Doc-string fixes.
18683 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18684 Argument WINDOW can be now internal window too.
18685 (Fwindow_use_time): Move up in code.
18686 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18687 Rewrite doc-string.
18688 (Fset_window_configuration, saved_window)
18689 (Fcurrent_window_configuration, save_window_save): Handle new
18690 members of window structure.
b9e809c2
MR
18691 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18692 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18693 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18694 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18695 Qget_mru_window, Qresize_root_window,
18696 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18697 Qauto_buffer_name; staticpro them.
f3d1777e 18698
abde8f8c
MR
186992011-06-07 Martin Rudalics <rudalics@gmx.at>
18700
18701 * window.c (Fwindow_total_size, Fwindow_left_column)
18702 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18703 (Fwindow_list_1): New functions.
18704 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
18705 (Fwindow_width, Fscroll_left, Fscroll_right):
18706 Use window_body_cols instead of window_box_text_cols.
18707 (delete_window, Fset_window_configuration):
18708 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
18709 (delete_all_subwindows): Take a window as argument and not a
18710 structure. Rewrite.
190b47e6
MR
18711 (window_loop): Remove handling of GET_LRU_WINDOW and
18712 GET_LARGEST_WINDOW.
18713 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
18714
18715 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
18716 window_box_text_cols. delete_all_subwindows now takes a
18717 Lisp_Object as argument.
abde8f8c 18718
640c8776
SM
18719 * indent.c (compute_motion, Fcompute_motion):
18720 Use window_body_cols instead of window_box_text_cols.
abde8f8c 18721
fa8a67e6
MR
18722 * frame.c (delete_frame): Call delete_all_subwindows with root
18723 window as argument.
18724
a54e3482
DC
187252011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18726
18727 * fns.c (Fputhash): Document return value.
18728
60002bf5
CY
187292011-06-06 Chong Yidong <cyd@stupidchicken.com>
18730
18731 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18732
0c671da6 187332011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 18734
b862a52a 18735 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 18736
be44ca6c
PE
18737 Check for overflow when converting integer to cons and back.
18738 * charset.c (Fdefine_charset_internal, Fdecode_char):
18739 Use cons_to_unsigned to catch overflow.
18740 (Fencode_char): Use INTEGER_TO_CONS.
18741 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18742 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18743 * data.c (long_to_cons, cons_to_long): Remove.
18744 (cons_to_unsigned, cons_to_signed): New functions.
18745 These signal an error for invalid or out-of-range values.
18746 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18747 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18748 * font.c (Ffont_variation_glyphs):
18749 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18750 * lisp.h: Include <intprops.h>.
18751 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18752 (cons_to_signed, cons_to_unsigned): New decls.
18753 (long_to_cons, cons_to_long): Remove decls.
18754 * undo.c (record_first_change): Use INTEGER_TO_CONS.
18755 (Fprimitive_undo): Use CONS_TO_INTEGER.
18756 * xfns.c (Fx_window_property): Likewise.
18757 * xselect.c: Include <limits.h>.
18758 (x_own_selection, selection_data_to_lisp_data):
18759 Use INTEGER_TO_CONS.
18760 (x_handle_selection_request, x_handle_selection_clear)
18761 (x_get_foreign_selection, Fx_disown_selection_internal)
18762 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
18763 (lisp_data_to_selection_data): Use cons_to_unsigned.
18764 (x_fill_property_data): Use cons_to_signed.
18765 Report values out of range.
18766
d1f3d2af
PE
18767 Check for buffer and string overflow more precisely.
18768 * buffer.h (BUF_BYTES_MAX): New macro.
18769 * lisp.h (STRING_BYTES_MAX): New macro.
18770 * alloc.c (Fmake_string):
18771 * character.c (string_escape_byte8):
18772 * coding.c (coding_alloc_by_realloc):
18773 * doprnt.c (doprnt):
18774 * editfns.c (Fformat):
18775 * eval.c (verror):
18776 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
18777 since they may not be the same number.
18778 * editfns.c (Finsert_char):
18779 * fileio.c (Finsert_file_contents):
18780 Likewise for BUF_BYTES_MAX.
18781
dd52fcea
PE
18782 * image.c: Use ptrdiff_t, not int, for sizes.
18783 (slurp_file): Switch from int to ptrdiff_t.
18784 All uses changed.
18785 (slurp_file): Check that file size fits in both size_t (for
18786 malloc) and ptrdiff_t (for sanity and safety).
18787
7f9bbdbb
PE
18788 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
18789 if b->modtime has its maximal value.
18790
dfe18f82
PE
18791 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
18792
84acfcf0
PE
18793 Don't assume time_t can fit into int.
18794 * buffer.h (struct buffer.modtime): Now time_t, not int.
18795 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
18796 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
18797
ccd9a01a
PE
18798 Minor fixes for signed vs unsigned integers.
18799 * character.h (MAYBE_UNIFY_CHAR):
18800 * charset.c (maybe_unify_char):
18801 * keyboard.c (read_char, reorder_modifiers):
18802 XINT -> XFASTINT, since the integer must be nonnegative.
18803 * ftfont.c (ftfont_spec_pattern):
18804 * keymap.c (access_keymap, silly_event_symbol_error):
18805 XUINT -> XFASTINT, since the integer must be nonnegative.
18806 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
18807 since it makes no difference and we prefer signed.
18808 * keyboard.c (record_char): Use XUINT when all the neighbors do.
18809 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
18810 nonnegative.
18811
d6d100dd
SM
188122011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
18813
18814 * window.h (Fwindow_frame): Declare.
18815
2b6148e4
PE
188162011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18817
18818 * alloc.c: Simplify handling of large-request failures (Bug#8800).
18819 (SPARE_MEMORY): Always define.
18820 (LARGE_REQUEST): Remove.
18821 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
18822
f230ecc9
MR
188232011-06-06 Martin Rudalics <rudalics@gmx.at>
18824
727e958e
MR
18825 * lisp.h: Move EXFUNS for Fframe_root_window,
18826 Fframe_first_window and Fset_frame_selected_window to window.h.
18827
18828 * window.h: Move EXFUNS for Fframe_root_window,
18829 Fframe_first_window and Fset_frame_selected_window here from
18830 lisp.h.
18831
18832 * frame.c (Fwindow_frame, Fframe_first_window)
18833 (Fframe_root_window, Fframe_selected_window)
18834 (Fset_frame_selected_window): Move to window.c.
18835 (Factive_minibuffer_window): Move to minibuf.c.
18836 (Fother_visible_frames_p): New function.
18837
18838 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18839
f230ecc9
MR
18840 * window.c (decode_window, decode_any_window): Move up in code.
18841 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18842 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
18843 (Fwindow_buffer): Move up and rewrite doc-string.
18844 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18845 (Fwindow_prev): New functions.
727e958e
MR
18846 (Fwindow_frame): Move here from frame.c. Accept any window as
18847 argument.
18848 (Fframe_root_window, Fframe_first_window)
18849 (Fframe_selected_window): Move here from frame.c. Accept frame
18850 or arbitrary window as argument. Update doc-strings.
18851 (Fminibuffer_window): Move up in code.
18852 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
18853 (Fset_frame_selected_window): Move here from frame.c.
18854 Marginal rewrite.
727e958e
MR
18855 (Fselected_window, select_window, Fselect_window): Move up in
18856 code. Minor doc-string fixes.
f230ecc9 18857
4d09bcf6
PE
188582011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18859
18860 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18861 Do not assume that spare memory exists; that assumption is valid
18862 only if SYSTEM_MALLOC.
18863 (LARGE_REQUEST): New macro, so that the issue of large requests
18864 is separated from the issue of spare memory.
18865
810928a2
AS
188662011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18867
172418ad
AS
18868 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18869 format. (Bug#8806)
18870
43f862f7
AS
18871 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18872
810928a2
AS
18873 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18874 before statements.
18875
a059fe24
JD
188762011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18877
18878 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18879
18880 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18881
18882 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18883 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18884
989bf368
JB
188852011-06-05 Juanma Barranquero <lekktu@gmail.com>
18886
18887 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18888
4b80f674
CY
188892011-06-04 Chong Yidong <cyd@stupidchicken.com>
18890
18891 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18892 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
18893 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18894 New error handlers.
4b80f674
CY
18895 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18896 Obey Vx_select_enable_clipboard_manager. Catch errors in
18897 x_clipboard_manager_save (Bug#8779).
18898 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 18899 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 18900
99a33b77 189012011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
18902
18903 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
18904
99a33b77 189052011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
18906
18907 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
18908 in the current matrix if keep_current_p is non-zero.
18909
8264569d
EZ
189102011-06-04 Eli Zaretskii <eliz@gnu.org>
18911
18912 * bidi.c (bidi_level_of_next_char): Fix last change.
18913
57f97249
EZ
189142011-06-03 Eli Zaretskii <eliz@gnu.org>
18915
fec2107c 18916 Support bidi reordering of text covered by display properties.
57f97249 18917
fec2107c
EZ
18918 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
18919 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
18920 (bidi_cache_search, bidi_cache_iterator_state)
18921 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
18922 (bidi_level_of_next_char, bidi_move_to_visually_next):
18923 Support character positions inside a run of characters covered by a
fec2107c
EZ
18924 display string.
18925 (bidi_paragraph_init, bidi_resolve_explicit_1)
18926 (bidi_level_of_next_char): Call bidi_fetch_char and
18927 bidi_fetch_char_advance instead of FETCH_CHAR and
18928 FETCH_CHAR_ADVANCE.
18929 (bidi_init_it): Initialize new members.
18930 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
18931 definitions.
18932 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
18933 instead of using explicit *_CHAR codes.
d6d100dd
SM
18934 (bidi_resolve_explicit, bidi_resolve_weak):
18935 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
18936 bidirectional text is supported only in multibyte buffers.
18937 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
18938 it to initialize the frame_window_p member of struct bidi_it.
18939 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
18940 (bidi_resolve_explicit, bidi_resolve_weak)
18941 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
18942 bidi_it->nchars is non-positive.
18943 (bidi_level_of_next_char): Don't try to lookup the cache for the
18944 next/previous character if nothing is cached there yet, or if we
18945 were just reseat()'ed to a new position.
c40e2fb2 18946
0e14fe90
EZ
18947 * xdisp.c (set_cursor_from_row): Set start and stop points
18948 according to the row's direction when priming the loop that looks
18949 for the glyph on which to display cursor.
18950 (single_display_spec_intangible_p): Function deleted.
18951 (display_prop_intangible_p): Reimplement to call
18952 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
18953 Accept 3 additional arguments needed by handle_display_spec.
18954 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
18955 values: lists, `(when COND...)' forms, etc.
18956 (single_display_spec_string_p): Support property values that are
18957 lists with the argument STRING its top-level element.
18958 (display_prop_string_p): Fix the condition for processing a
18959 property that is a list to be consistent with handle_display_spec.
fec2107c 18960 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
18961 last portion of handle_display_prop.
18962 (compute_display_string_pos): Accept additional argument
18963 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
18964 value of a `display' property is a "replacing spec".
18965 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
18966 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
18967 the display property, but just return a value indicating whether
18968 the display property will replace the characters it covers.
18969 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
18970 frame_window_p members of struct bidi_it.
d6d100dd
SM
18971 (compute_display_string_pos, compute_display_string_end):
18972 New functions.
fec2107c
EZ
18973 (push_it): Accept second argument POSITION, where pop_it should
18974 jump to continue iteration.
18975 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 18976
fec2107c
EZ
18977 * keyboard.c (adjust_point_for_property): Adjust the call to
18978 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
18979
18980 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
18981 (bidi_init_it): Update prototypes.
18982 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
18983 (compute_display_string_pos, compute_display_string_end):
18984 Declare prototypes.
fec2107c
EZ
18985 (struct bidi_it): New members nchars and disp_pos. ch_len is now
18986 EMACS_INT.
fc6f18ce 18987
40087514 189882011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 18989
57f53182
PE
18990 Malloc failure behavior now depends on size of allocation.
18991 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
18992 * lisp.h: Change signatures accordingly.
18993 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
18994 All callers changed. (Bug#8762)
18995
18996 * gnutls.c: Use Emacs's memory allocators.
18997 Without this change, the gnutls library would invoke malloc etc.
18998 directly, which causes problems on non-SYNC_INPUT hosts, and which
18999 runs afoul of improving memory_full behavior. (Bug#8761)
19000 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19001 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19002 xfree instead of the default malloc, realloc, free.
19003 (Fgnutls_boot): No need to check for memory allocation failure,
19004 since xmalloc does that for us.
19005
ac32cd99 19006 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
19007 * category.c (hash_get_category_set):
19008 * ccl.c (ccl_driver):
19009 * charset.c (Fdefine_charset_internal):
19010 * charset.h (struct charset.hash_index):
19011 * composite.c (get_composition_id, gstring_lookup_cache)
19012 (composition_gstring_put_cache):
19013 * composite.h (struct composition.hash_index):
19014 * dispextern.h (struct image.hash):
19015 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19016 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19017 (hashfn_equal, hashfn_user_defined, make_hash_table)
19018 (maybe_resize_hash_table, hash_lookup, hash_put)
19019 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19020 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19021 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19022 * image.c (make_image, search_image_cache, lookup_image)
19023 (xpm_put_color_table_h):
19024 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 19025 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 19026 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 19027 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
19028 * alloc.c (allocate_vectorlike):
19029 Check for overflow in vector size calculations.
19030 * ccl.c (ccl_driver):
19031 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
19032 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19033 need to be updated by these changes.
40087514
PE
19034 * fns.c (make_hash_table, maybe_resize_hash_table):
19035 Check for integer overflow with large hash tables.
0de4bb68
PE
19036 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19037 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19038 (SXHASH_REDUCE): New macro.
19039 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19040 Use it instead of discarding useful hash info with large hash values.
19041 (sxhash_float): New function.
19042 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19043 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
19044 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19045 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
19046 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19047 Adjust signatures to match updated version of code.
19048 (consing_since_gc): Now EMACS_INT, since a single hash table can
19049 use more than INT_MAX bytes.
19050
698d32e2
DN
190512011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19052
19053 Make it possible to build with GCC-4.6+ -O2 -flto.
19054
19055 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19056
fd6fa53f
SM
190572011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19058
19059 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19060 Call minibuffer-inactive-mode.
19061
864db017
JB
190622011-05-31 Juanma Barranquero <lekktu@gmail.com>
19063
19064 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19065 Update dependencies.
19066
2ad0baf4
DN
190672011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19068
19069 * data.c (init_data): Remove code for UTS, this system is not
19070 supported anymore.
19071
4fcc2638
DN
190722011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19073
19074 Don't force ./temacs to start in terminal mode.
19075
19076 * frame.c (make_initial_frame): Initialize faces in all cases, not
19077 only when CANNOT_DUMP is defined.
19078 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19079
c56e0fd5
DN
190802011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19081
19082 * dispnew.c (add_window_display_history): Use const for the string
19083 pointer. Remove declaration, not needed.
19084
333d54da 190852011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 19086
55d4c1b2 19087 Use 'inline', not 'INLINE'.
333d54da 19088 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
19089 * alloc.c, fontset.c (INLINE): Remove.
19090 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19091 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19092 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19093 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19094 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19095
738db178
DN
190962011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19097
19098 Make it possible to run ./temacs.
19099
19100 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19101 syms_of_callproc does the same thing. Remove test for
19102 "initialized", do it in the caller.
19103 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19104
620c53a6
SM
191052011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19106
19107 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19108 (read_minibuf): Use get_minibuffer.
19109 (syms_of_minibuf): Use DEFSYM.
19110 (Qmetadata): New var.
19111 * data.c (Qbuffer): Don't make it static.
19112 (syms_of_data): Use DEFSYM.
19113
e003a292
PE
191142011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19115
19116 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19117 (CCL_CODE_MIN): New macro.
19118
ed008a6d
PE
191192011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19120
3687c2ef
PE
19121 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19122
ed008a6d
PE
19123 * eval.c (Qdebug): Now static.
19124 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19125 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19126 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19127
d66c4c7c
CY
191282011-05-29 Chong Yidong <cyd@stupidchicken.com>
19129
19130 * image.c: Various fixes to ImageMagick code comments.
19131 (Fimagemagick_types): Doc fix.
19132
5fbc2025
PE
191332011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19134
0196f88a
PE
19135 Minor fixes prompted by GCC 4.6.0 warnings.
19136
19137 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19138
5fbc2025
PE
19139 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19140 (x_clipboard_manager_save_all): Move extern decl to ...
19141 * xterm.h: ... here, so that it can be checked for consistency.
19142
1dd3c2d9
CY
191432011-05-29 Chong Yidong <cyd@stupidchicken.com>
19144
19145 * xselect.c (x_clipboard_manager_save_frame)
19146 (x_clipboard_manager_save_all): New functions.
19147 (Fx_clipboard_manager_save): Lisp function deleted.
19148
19149 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19150 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19151
19152 * xterm.h: Update prototype.
19153
5ba6571d
WX
191542011-05-28 William Xu <william.xwl@gmail.com>
19155
19156 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19157 exiting (Bug#8239).
19158
3eaff834
JM
191592011-05-28 Jim Meyering <meyering@redhat.com>
19160
e1900994 19161 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
19162 * fns.c (to_uchar): Define.
19163 (crypto_hash_function): Use it to convert some newly-signed
19164 variables to unsigned, to avoid sign-extension bugs. For example,
19165 without this change, (md5 "truc") would evaluate to
19166 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19167 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 19168 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 19169
0f6990a7
PE
191702011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19171
19172 Integer overflow fixes.
c8a9ca5a 19173
08686060
PE
19174 * dbusbind.c: Serial number integer overflow fixes.
19175 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
19176 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19177 to hold a serial number that is too large for a fixnum.
19178 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19179 Check for serial numbers out of range. Decode any serial number
59568bf0 19180 that was so large that it became a float. (Bug#8722)
08686060 19181
2d1fc3c7
PE
19182 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19183 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19184 Use XFASTINT rather than XUINT when numbers are nonnegative.
19185 (xd_append_arg, Fdbus_method_return_internal):
19186 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19187 arguments, check that Lisp number is nonnegative, rather than
59568bf0 19188 silently wrapping negative numbers around. (Bug#8722)
30217ff0 19189 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 19190 (Bug#8722)
2d1fc3c7 19191
c8a9ca5a
PE
19192 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19193
519e1d69
PE
19194 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19195
6df6ae42 19196 ccl: Add integer overflow checks.
30569699
PE
19197 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19198 (IN_INT_RANGE): New macros.
19199 (ccl_driver): Use them to check for integer overflow when
19200 decoding a CCL program. Many of the new checks are whether XINT (x)
19201 fits in int; it doesn't always, on 64-bit hosts. The new version
19202 doesn't catch all possible integer overflows, but it's an
847044ea 19203 improvement. (Bug#8719)
30569699 19204
c11285dc
PE
19205 * alloc.c (make_event_array): Use XINT, not XUINT.
19206 There's no need for unsigned here.
19207
fdccd48e
PE
19208 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19209 This follows up to the 2011-05-06 change that substituted uintptr_t
19210 for EMACS_INT. This case wasn't caught back then.
19211
37910ab2
PE
19212 Rework Fformat to avoid integer overflow issues.
19213 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19214 now (part of C89). Include <verify.h>.
19215 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19216 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19217 (Fformat): Avoid the prepass trying to compute sizes; it was only
19218 approximate and thus did not catch overflow reliably. Instead, walk
19219 through the format just once, formatting and computing sizes as we go,
19220 checking for integer overflow at every step, and allocating a larger
19221 buffer as needed. Keep track separately whether the format is
19222 multibyte. Keep only the most-recently calculated precision, rather
19223 than them all. Record whether each argument has been converted to
19224 string. Use EMACS_INT, not int, for byte and char and arg counts.
19225 Support field widths and precisions larger than INT_MAX. Avoid
19226 sprintf's undefined behavior with conversion specifications such as %#d
19227 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19228 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19229 formatting out-of-range floating point numbers with int
9173deec 19230 formats. (Bug#8668)
37910ab2 19231
2e6578fb
PE
19232 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19233
0ae6bdee
PE
19234 * data.c: Avoid integer truncation in expressions involving floats.
19235 * data.c: Include <intprops.h>.
19236 (arith_driver): When there's an integer overflow in an expression
19237 involving floating point, convert the integers to floating point
19238 so that the resulting value does not suffer from catastrophic
19239 integer truncation. For example, on a 64-bit host (* 4
19240 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19241 Do not rely on undefined behavior after integer overflow.
19242
de883a70
PE
19243 merge count_size_as_multibyte, parse_str_to_multibyte
19244 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 19245 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
19246 Check for integer overflow.
19247 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19248 since it's now a duplicate of the other. This is more of
19249 a character than a buffer op, so better that it's in character.c.
19250 * fns.c, print.c: Adjust to above changes.
19251
2ff916cb
PE
192522011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19253
19254 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19255
f1b54466
PE
192562011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19257
fb1ac845
PE
19258 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19259 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19260 (x_clipboard_manager_save): Now static.
19261 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19262
f1b54466
PE
19263 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19264 (crypto_hash_function): Now static.
19265 Fix pointer signedness problems. Avoid unnecessary initializations.
19266
a9f737ee
CY
192672011-05-27 Chong Yidong <cyd@stupidchicken.com>
19268
19269 * termhooks.h (Vselection_alist): Make it terminal-local.
19270
19271 * terminal.c (create_terminal): Initialize it.
19272
19273 * xselect.c: Support for clipboard managers.
19274 (Vselection_alist): Move to termhooks.h as terminal-local var.
19275 (LOCAL_SELECTION): New macro.
19276 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19277 (symbol_to_x_atom): Remove gratuitous arg.
19278 (x_handle_selection_request, lisp_data_to_selection_data)
19279 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
19280 (x_own_selection, x_get_local_selection, x_convert_selection):
19281 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
19282 (some_frame_on_display): Delete unused function.
19283 (Fx_own_selection_internal, Fx_get_selection_internal)
19284 (Fx_disown_selection_internal, Fx_selection_owner_p)
19285 (Fx_selection_exists_p): New optional frame arg.
19286 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19287 (x_handle_selection_clear): Don't treat other terminals with the
19288 same keyboard specially. Use the terminal-local Vselection_alist.
19289 (x_clear_frame_selections): Use Frun_hook_with_args.
19290
19291 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19292
19293 * xterm.h: Add support for those atoms.
19294
e067f0c1
CY
192952011-05-26 Chong Yidong <cyd@stupidchicken.com>
19296
19297 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19298 (converted_selections, conversion_fail_tag): New global variables.
19299 (x_selection_request_lisp_error): Free the above.
19300 (x_get_local_selection): Remove unnecessary code.
19301 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
19302 of converted selections stored in converted_selections.
19303 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
19304 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19305 (x_convert_selection): New function.
19306 (x_handle_selection_event): Simplify.
19307 (x_get_foreign_selection): Don't ignore incoming requests while
19308 waiting for an answer; this will fail when we implement
19309 SAVE_TARGETS, and seems unnecessary anyway.
19310 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19311 (Vx_sent_selection_functions): Doc fix.
19312
0f4aebc0
LL
193132011-05-26 Leo Liu <sdl.web@gmail.com>
19314
19315 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19316
e61124cd
YM
193172011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19318
19319 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19320
19321 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19322 for fringe update if it has periodic bitmap.
ac389d0c 19323 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
19324 and fringe_bitmap_periodic_p.
19325
19326 * fringe.c (get_fringe_bitmap_data): New function.
19327 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19328 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19329 row. Mark glyph row for fringe update if periodicity changed.
19330
19331 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19332 for fringe update unless it has periodic bitmap.
19333
f16d9837
KH
193342011-05-25 Kenichi Handa <handa@m17n.org>
19335
19336 * xdisp.c (get_next_display_element): Set correct it->face_id for
19337 a static composition.
19338
e1b90ef6
LL
193392011-05-24 Leo Liu <sdl.web@gmail.com>
19340
19341 * deps.mk (fns.o):
19342 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19343
19344 * fns.c (crypto_hash_function, Fsha1): New function.
19345 (Fmd5): Use crypto_hash_function.
19346 (syms_of_fns): Add Ssha1.
19347
7400048f
PE
193482011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19349
19350 * gnutls.c: Remove unused macros.
19351 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19352 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19353 Remove macros that are defined and never used.
19354 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19355
abb71cf4
CY
193562011-05-22 Chong Yidong <cyd@stupidchicken.com>
19357
19358 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19359 (Fx_get_selection_internal): Minor cleanup.
19360 (Fx_own_selection_internal): Rename arguments for consistency with
19361 select.el.
19362
6307db39
PE
193632011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19364
19365 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19366
f3d4e0a4
CY
193672011-05-22 Chong Yidong <cyd@stupidchicken.com>
19368
19369 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19370
4d8ade89
YM
193712011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19372
19373 * dispnew.c (scrolling_window): Don't exclude the case that the
19374 last enabled row in the desired matrix touches the bottom boundary.
19375
32078c8d
GM
193762011-05-21 Glenn Morris <rgm@gnu.org>
19377
19378 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
19379 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19380 and add some more files.
32078c8d 19381
7285dc67
EZ
193822011-05-20 Eli Zaretskii <eliz@gnu.org>
19383
19384 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19385 report_file_error introduced by the change from 2011-05-07.
19386
89d1bd22
PE
193872011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19388
19389 * systime.h (Time): Define only if emacs is defined.
19390 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19391 where the include path doesn't have X11/X.h by default. See
19392 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19393
cd394be1 193942011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
19395
19396 * composite.c (find_automatic_composition): Fix previous change.
19397
b9704ad9
GM
193982011-05-20 Glenn Morris <rgm@gnu.org>
19399
19400 * lisp.mk: New file, split from Makefile.in.
19401 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19402 (shortlisp): Remove.
19403 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19404
4a720484
GM
194052011-05-19 Glenn Morris <rgm@gnu.org>
19406
19407 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19408 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19409 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19410 (lisp): Set the order to that of loadup.el.
19411 (shortlisp): Make it a copy of $lisp.
19412 (SOME_MACHINE_LISP): Remove.
19413 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19414 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19415
a28d4396
KH
194162011-05-18 Kenichi Handa <handa@m17n.org>
19417
19418 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19419 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19420 (find_automatic_composition): Mostly rewrite for efficiency.
19421
a2b1fa8e
JB
194222011-05-18 Juanma Barranquero <lekktu@gmail.com>
19423
19424 * makefile.w32-in: Update dependencies.
19425
8e1f5610
CS
194262011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19427
19428 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 19429 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 19430
7025ee00 194312011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 19432
cdfa6eab
PE
19433 Fix some integer overflow issues, such as string length overflow.
19434
06d6db33
PE
19435 * insdel.c (count_size_as_multibyte): Check for string overflow.
19436
2b4560a8
PE
19437 * character.c (lisp_string_width): Check for string overflow.
19438 Use EMACS_INT, not int, for string indexes and lengths; in
19439 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19440 the resulting string length overflows an EMACS_INT; instead,
19441 report a string overflow if no precision given. When checking for
19442 precision exhaustion, use a check that cannot possibly have
19443 integer overflow. (Bug#8675)
19444 * character.h (lisp_string_width): Adjust to new signature.
19445
cb93f9be
PE
19446 * alloc.c (string_overflow): New function.
19447 (Fmake_string): Use it. This doesn't change behavior, but saves
19448 a few bytes and will simplify future changes.
19449 * character.c (string_escape_byte8): Likewise.
19450 * lisp.h (string_overflow): New decl.
19451
1a1f3366
PE
19452 Fixups, following up to the user-interface timestamp change.
19453 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19454 for UI timestamps, instead of unsigned long.
9fbd6841
PE
19455 * msdos.c (mouse_get_pos): Likewise.
19456 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
19457 * w32gui.h (Time): Define by including "systime.h" rather than by
19458 declaring it ourselves. (Bug#8664)
19459
d4e3e4d3
PE
19460 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19461 * image.c (clear_image_cache): Likewise.
19462
f6a24d19
PE
19463 * term.c (term_mouse_position): Don't assume time_t wraparound.
19464
08dc5ae6
PE
19465 Be more systematic about user-interface timestamps.
19466 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
19467 and sometimes 'EMACS_UINT', to represent these timestamps.
19468 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
19469 This makes the code easier to follow, and makes it easier to catch
19470 integer overflow bugs such as Bug#8664.
19471 * frame.c (Fmouse_position, Fmouse_pixel_position):
19472 Use Time, not unsigned long, for user-interface timestamps.
19473 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19474 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19475 * keyboard.h (last_event_timestamp): Likewise.
19476 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19477 * menu.h (xmenu_show): Likewise.
19478 * term.c (term_mouse_position): Likewise.
19479 * termhooks.h (struct input_event.timestamp): Likewise.
19480 (struct terminal.mouse_position_hook): Likewise.
19481 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19482 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19483 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19484 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19485 what it was before.
19486 * menu.h, termhooks.h: Include "systime.h", for Time.
19487
8e55734a
PE
19488 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19489 Don't assume that the difference between two unsigned long values
19490 can fit into an integer. At this point, we know button_down_time
19491 <= event->timestamp, so the difference must be nonnegative, so
19492 there's no need to cast the result if double-click-time is
19493 nonnegative, as it should be; check that it's nonnegative, just in
19494 case. This bug is triggered when events are more than 2**31 ms
86db42d2 19495 apart (about 25 days). (Bug#8664)
8e55734a 19496
841f1b75 19497 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 19498 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 19499
3e26f69c
PE
19500 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19501 that always fit in int. Use a sentinel instead of a counter, to
19502 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
19503 * frame.h (struct frame): Use int for menu_bar_items_used
19504 instead of EMACS_INT, since it always fits in int.
3e26f69c 19505
5cc152c0
PE
19506 * menu.c (grow_menu_items): Check for int overflow.
19507
d89eb65e
PE
19508 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19509
5235bd3e
PE
19510 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19511 Before, the code was not consistent. These values cannot exceed
19512 2**31 - 1 so there's no need to make them unsigned.
19513 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19514 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19515 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19516 as modifiers.
19517 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19518
bc827e23
PE
19519 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19520 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19521 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19522 presumably because the widths might not match.
19523
78eb494e
PE
19524 * window.c (size_window): Avoid needless test at loop start.
19525
04f2d78b
CB
195262011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19527
19528 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19529
d2fc7e3d 195302011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
19531
19532 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19533
d2fc7e3d 195342011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
19535
19536 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19537 `width' to `bar_area_x' and `bar_area_width', respectively.
19538 (x_scroll_run): Take account of fringe background extension.
19539
04f2d78b
CB
19540 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19541 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
19542 `bar_area_width', respectively.
19543 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19544 background extension.
19545
79b70037
GM
195462011-05-10 Jim Meyering <meyering@redhat.com>
19547
19548 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19549
2f142cc5
JB
195502011-05-10 Juanma Barranquero <lekktu@gmail.com>
19551
19552 * image.c (Finit_image_library): Return t for built-in image types,
19553 like pbm and xbm. (Bug#8640)
19554
57679c86
AS
195552011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19556
19557 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19558
888c9e86
EZ
195592011-05-07 Eli Zaretskii <eliz@gnu.org>
19560
b0512a1d
EZ
19561 * w32console.c (Fset_screen_color): Doc fix.
19562 (Fget_screen_color): New function.
19563 (syms_of_ntterm): Defsubr it.
19564
7285dc67
EZ
19565 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19566 unlink the temporary file if Fcall_process didn't create it in the
19567 first place.
19568 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19569 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
19570 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19571 cue to call_process_cleanup not to close that handle.
19572
4d3fcc8e
BK
195732011-05-07 Ben Key <bkey76@gmail.com>
19574
19575 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19576 one of two shell specific rules, either bootstrap-temacs-CMD or
19577 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19578 to the previous implementation of the bootstrap-temacs rule.
19579 The bootstrap-temacs-CMD rule is similar to the previous
19580 implementation of the bootstrap-temacs rule except that it
19581 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19582 variable.
19583
19584 These changes, along with some changes to nt/configure.bat,
19585 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19586 earlier fix to add support for --cflags and --ldflags options
19587 that include quotes so that it works whether make uses cmd or
19588 sh as the shell.
19589
b4289b64
MA
195902011-05-06 Michael Albinus <michael.albinus@gmx.de>
19591
19592 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19593 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19594 is a constant.
19595 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19596 a string. Handle both cases.
19597 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19598 (Fdbus_register_method): Use Qinvalid_function.
19599
af4c0e28
JB
196002011-05-06 Juanma Barranquero <lekktu@gmail.com>
19601
19602 * makefile.w32-in: Update dependencies.
19603 (LISP_H): Add inttypes.h and stdin.h.
19604 (PROCESS_H): Add unistd.h.
19605
c51453d9
EZ
196062011-05-06 Eli Zaretskii <eliz@gnu.org>
19607
19608 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19609 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19610
8ff0ac3c 196112011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 19612
4c4b566b
PE
19613 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19614
aab2b9b5
PE
19615 * term.c (vfatal): Remove stray call to va_end.
19616 It's not needed and the C Standard doesn't allow it here anyway.
19617
c378da0b
PE
19618 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19619 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19620
288b08c7
PE
19621 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19622 bytes.
19623
e3601888
PE
19624 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19625
db6c0e74
PE
19626 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19627
dd5963ea
PE
19628 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19629
88c9450f
PE
19630 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19631
2f9442b8
PE
19632 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19633
c032b5f8
PE
19634 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19635 * charset.c (Fdefine_charset_internal): Don't initialize
19636 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 19637 32-bit int (Bug#8600).
a108c10b
PE
19638
19639 * lread.c (read_integer): Be more consistent with string-to-number.
19640 Use string_to_number to do the actual conversion; this avoids
19641 rounding errors and fixes some other screwups. Without this fix,
19642 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19643 (digit_to_number): Move earlier, for benefit of read_integer.
19644 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 19645 not a digit in any supported base. (Bug#8602)
a108c10b 19646
ad5f9eea
PE
19647 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19648
aec1708a
PE
19649 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19650 to match comment at start of function. This also removes a
19651 GCC warning about overflow in a 32+64-bit port.
19652
47be4ab5
PE
19653 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19654
371cac43
PE
19655 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19656 Reported by Stefan Monnier in
19657 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
19658 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19659 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 19660
d01a7826
PE
19661 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19662 (EMACS_UINTPTR): Likewise, with uintptr_t.
19663
7fd47d5c
PE
19664 * lisp.h: Prefer 64-bit EMACS_INT if available.
19665 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19666 on 32-bit hosts that have 64-bit int, so that they can access
19667 large files.
122b0c86
PE
19668 However, temporarily disable this change unless the temporary
19669 symbol WIDE_EMACS_INT is defined.
7fd47d5c 19670
8727937b
PE
19671 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19672
8ac068ac
PE
19673 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19674 This removes an assumption that EMACS_INT and long are the same
19675 width as pointers. The assumption is true for Emacs porting targets
19676 now, but we want to make other targets possible.
19677 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19678 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19679 In the rest of the code, change types of integers that hold casted
19680 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19681 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19682 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19683 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19684 No need to cast type when ORing.
19685 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19686 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19687 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19688 assume EMACS_INT is the same width as char *.
19689 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19690 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19691 Remove no-longer-needed casts.
19692 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19693 (xg_tool_bar_help_callback, xg_make_tool_item):
19694 Use EMACS_INTPTR to hold an integer
19695 that will be cast to void *; this can avoid a GCC warning
19696 if EMACS_INT is not the same width as void *.
19697 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19698 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19699 (current_message_1, set_message_1):
19700 Use a local to convert to proper width without a cast.
19701 * xmenu.c (dialog_selection_callback): Likewise.
19702
ede49d71
PE
19703 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19704 Also, don't assume VALBITS / RAND_BITS is less than 5,
19705 and don't rely on undefined behavior when shifting a 1 left into
19706 the sign bit.
19707 * lisp.h (get_random): Change signature to match.
19708
2f30ecd0
PE
19709 * lread.c (hash_string): Use size_t, not int, for hash computation.
19710 Normally we prefer signed values; but hashing is special, because
19711 it's better to use unsigned division on hash table sizes so that
19712 the remainder is nonnegative. Also, size_t is the natural width
19713 for hashing into memory. The previous code used 'int', which doesn't
19714 retain enough info to hash well into very large tables.
19715 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19716
2a866e7b
PE
19717 * dbusbind.c: Don't possibly lose pointer info when converting.
19718 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19719 Use XPNTR rather than XHASH, so that the high-order bits of
19720 the pointer aren't lost when converting through void *.
19721
51639eac
PE
19722 * eval.c (Fautoload): Don't double-shift a pointer.
19723
92394119
PE
19724 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19725
dbdb9a7c
JB
197262011-05-06 Juanma Barranquero <lekktu@gmail.com>
19727
19728 * gnutls.c (DEF_GNUTLS_FN):
19729 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19730
db7a0b4f
AS
197312011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19732
19733 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19734 marker. (Bug#8610)
19735
cd394be1 197362011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
19737
19738 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19739 New version that can reserve upto 2GB of heap space.
19740
f7ff1b0f 197412011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
19742
19743 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19744
639c109b
TZ
197452011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19746
19747 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19748 `gnutls_certificate_set_x509_key_file'.
19749
d2127135
JB
197502011-05-05 Juanma Barranquero <lekktu@gmail.com>
19751
19752 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19753 Update dependencies.
19754
e968f4f3
JB
197552011-05-04 Juanma Barranquero <lekktu@gmail.com>
19756
19757 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
19758 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
19759 Remove unused parameter `fildes'.
19760 * process.c (read_process_output, send_process): Don't pass it.
19761
84d358f0
JB
197622011-05-04 Juanma Barranquero <lekktu@gmail.com>
19763
19764 Fix previous change: the library cache is defined in w32.c.
19765 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
19766 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
19767
0898ca10
JB
197682011-05-04 Juanma Barranquero <lekktu@gmail.com>
19769
19770 Implement dynamic loading of GnuTLS on Windows.
19771
19772 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
19773 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
19774 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19775 Declare.
19776
19777 * gnutls.c (Qgnutls_dll): Define.
19778 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
19779 (gnutls_*): Declare function pointers.
19780 (init_gnutls_functions): New function to initialize function pointers.
19781 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
19782 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
19783 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19784 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
19785 (emacs_gnutls_write, emacs_gnutls_read)
19786 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
19787 (Fgnutls_available_p): New function.
19788 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
19789 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
19790 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
19791
19792 * image.c: Include w32.h.
19793 (Vimage_type_cache): Delete.
19794 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
19795 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
19796 (w32_delayed_load): Move to w32.c.
19797
19798 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
19799
19800 * w32.c (QCloaded_from, Vlibrary_cache): Define.
19801 (w32_delayed_load): Move from image.c. When loading a library, record
19802 its filename in the :loaded-from property of the library id.
19803 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
19804 Initialize and staticpro them.
19805 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
19806
19807 * process.c: Include lisp.h before w32.h, not after.
19808 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
19809 instead of gnutls_record_check_pending.
19810
19811 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
19812
ff4de4aa
TZ
198132011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
19814
19815 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
19816 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
19817 as passed in.
19818
abe95abb
JD
198192011-05-03 Jan Djärv <jan.h.d@swipnet.se>
19820
19821 * xterm.c (x_set_frame_alpha): Do not set property on anything
19822 else than FRAME_X_OUTER_WINDOW (Bug#8608).
19823
e16e55d4
JB
198242011-05-02 Juanma Barranquero <lekktu@gmail.com>
19825
19826 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
19827
bafcf6a5
JB
198282011-05-02 Juanma Barranquero <lekktu@gmail.com>
19829
19830 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
19831 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
19832 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
19833 (gnutls_global_initialized, Qgnutls_bootprop_priority)
19834 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
19835 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
19836 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
19837 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
19838 (Qgnutls_bootprop_callbacks_verify): Make static.
19839
e7a6747f
AS
198402011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19841
19ed11ba
AS
19842 * callproc.c: Indentation fixup.
19843
e7a6747f 19844 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
19845 (wait_for_termination, interruptible_wait_for_termination):
19846 Move after wait_for_termination_1.
e7a6747f 19847
1ef14cb4
LMI
198482011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19849
19850 * sysdep.c (interruptible_wait_for_termination): New function
19851 which is like wait_for_termination, but allows keyboard
19852 interruptions.
19853
19854 * callproc.c (Fcall_process): Add (:file "file") as an option for
19855 the STDOUT buffer.
19856 (Fcall_process_region): Ditto.
19857
330d880c
EZ
198582011-04-30 Eli Zaretskii <eliz@gnu.org>
19859
8db90b73
EZ
19860 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19861 rather than `XVECTOR (FOO)->size'.
19862
330d880c
EZ
19863 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19864 inttypes.h, as a gnulib replacement is used if it not available in
19865 system headers.
19866
15cbd324
EZ
198672011-04-21 Eli Zaretskii <eliz@gnu.org>
19868
19869 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19870 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19871 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19872
19873 * coding.c (coding_alloc_by_realloc): Error out if destination
19874 will grow beyond MOST_POSITIVE_FIXNUM.
19875 (decode_coding_emacs_mule): Abort if there isn't enough place in
19876 charbuf for the composition carryover bytes. Reserve an extra
19877 space for up to 2 characters produced in a loop.
19878 (decode_coding_iso_2022): Abort if there isn't enough place in
19879 charbuf for the composition carryover bytes.
19880
198812011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 19882
ae940cca
EZ
19883 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19884 aborting when %lld or %lll format is passed.
19885 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19886 %llo or %llx format is passed. (Bug#8545)
19887
03ab8921
EZ
19888 * window.c (window_scroll_line_based): Use a marker instead of
19889 simple variables to record original value of point. (Bug#7952)
19890
afda1437
EZ
19891 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19892 produced by %s or %c overflows available buffer space. (Bug#8545)
19893
f76dee0c
PE
198942011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19895
19896 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 19897 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 19898
fdc5744d
JB
198992011-04-28 Juanma Barranquero <lekktu@gmail.com>
19900
19901 * w32.c (init_environment): Warn about defaulting HOME to C:\.
19902
638f053a
JB
199032011-04-28 Juanma Barranquero <lekktu@gmail.com>
19904
19905 * keyboard.c (Qdelayed_warnings_hook): Define.
19906 (command_loop_1): Run `delayed-warnings-hook'
19907 if Vdelayed_warnings_list is non-nil.
19908 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
19909 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
19910
d178f871
EZ
199112011-04-28 Eli Zaretskii <eliz@gnu.org>
19912
19913 * doprnt.c (doprnt): Don't return value smaller than the buffer
19914 size if the message was truncated. (Bug#8545).
19915
b124fd93
JB
199162011-04-28 Juanma Barranquero <lekktu@gmail.com>
19917
19918 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
19919 (Fx_window_property): #if-0 the whole functions, not just the bodies.
19920
e810457d
PE
199212011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19922
19923 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
19924
ea51cceb
JB
199252011-04-27 Juanma Barranquero <lekktu@gmail.com>
19926
19927 * makefile.w32-in: Update dependencies.
19928
94dcfacf
EZ
199292011-04-27 Eli Zaretskii <eliz@gnu.org>
19930
19931 Improve `doprnt' and its usage. (Bug#8545)
19932 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
19933 `format_end'. Remove support for %l as a conversion specifier.
19934 Don't use xrealloc. Improve diagnostics when the %l size modifier
19935 is used. Update the commentary.
19936
19937 * eval.c (verror): Simplify calculation of size_t.
19938
19939 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
19940 messages.
19941
f61f41d7
PE
199422011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
19943
19944 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
19945 change.
19946
96fb4434
PE
199472011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19948
19949 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
19950 This makes this file independent of the recent pseudovector change.
19951
671875da 199522011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 19953
69e9b5a3
PE
19954 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
19955
b5f869a7 19956 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 19957 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 19958 Remove unused local.
c8926152 19959 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 19960
841a1577 19961 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
19962 GCC 4.6.0 optimizes based on type-based alias analysis.
19963 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
19964 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
19965 != &v->size, and therefore "v->size = 1; b->size = 2; return
19966 v->size;" must therefore return 1. This assumption is incorrect
19967 for Emacs, since it type-puns struct Lisp_Vector * with many other
19968 types. To fix this problem, this patch adds a new type struct
f904488f 19969 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
19970 and pseudovectors, and helps optimizing compilers not get fooled
19971 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
19972 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
19973 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
19974 the size member.
eab3844f
PE
19975 (XSETPVECTYPE): Rewrite in terms of new macro.
19976 (XSETPVECTYPESIZE): New macro, specifying both type and size.
19977 This is a bit clearer, and further avoids the possibility of
19978 undesirable aliasing.
19979 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 19980 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
19981 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
19982 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
19983 (ASIZE): Now uses header.size rather than size.
19984 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
19985 to avoid the hassle of writing XVECTOR (foo)->header.size.
19986 (struct vectorlike_header): New type.
eab3844f
PE
19987 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
19988 object, to help avoid aliasing.
19989 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
19990 (SUBRP): Likewise, since Lisp_Subr is a special case.
19991 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
19992 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
19993 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 19994 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
19995 changed to be "header.size" and "header.next".
19996 * buffer.h (struct buffer): Likewise.
19997 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
19998 * frame.h (struct frame): Likewise.
19999 * process.h (struct Lisp_Process): Likewise.
20000 * termhooks.h (struct terminal): Likewise.
20001 * window.c (struct save_window_data, struct saved_window): Likewise.
20002 * window.h (struct window): Likewise.
20003 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20004 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20005 * buffer.c (init_buffer_once): Likewise.
20006 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20007 special case.
20008 * process.c (Fformat_network_address): Use local var for size,
20009 for brevity.
20010
0df1eac5
PE
20011 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20012
847ab9d1 20013 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
20014 * data.c (atof): Remove decl; no longer used or needed.
20015 (digit_to_number): Move to lread.c.
20016 (Fstring_to_number): Use new string_to_number function, to be
20017 consistent with how the Lisp reader treats infinities and NaNs.
20018 Do not assume that floating-point numbers represent EMACS_INT
20019 without losing information; this is not true on most 64-bit hosts.
20020 Avoid double-rounding errors, by insisting on integers when
20021 parsing non-base-10 numbers, as the documentation specifies.
20022 * lisp.h (string_to_number): New decl, replacing ...
20023 (isfloat_string): Remove.
bc0a5c13 20024 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 20025 (read1): Do not accept +. and -. as integers; this
452f4150
PE
20026 appears to have been a coding error. Similarly, do not accept
20027 strings like +-1e0 as floating point numbers. Do not report
20028 overflow for integer overflows unless the base is not 10 which
20029 means we have no simple and reliable way to continue.
20030 Break out the floating-point parsing into a new
20031 function string_to_number, so that Fstring_to_number parses
20032 floating point numbers consistently with the Lisp reader.
04f2d78b 20033 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
20034 (E_CHAR, EXP_INT): Remove, replacing with ...
20035 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20036 (string_to_number): New function, replacing isfloat_string.
20037 This function checks for valid syntax and produces the resulting
20038 Lisp float number too. Rework it so that string-to-number
bc0a5c13 20039 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
20040 so that overflow for non-base-10 numbers is reported only when
20041 there's no portable and simple way to convert to floating point.
452f4150 20042
67769ffc
PE
20043 * textprop.c (set_text_properties_1): Rewrite for clarity,
20044 and to avoid GCC warning about integer overflow.
20045
c20db43f
PE
20046 * intervals.h (struct interval): Use EMACS_INT for members
20047 where EMACS_UINT might cause problems. See
20048 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20049 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20050 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20051 All uses changed.
37aa2f85
PE
20052 (offset_intervals): Tell GCC not to worry about length overflow
20053 when negating a negative length.
c20db43f 20054
2538aa2f
PE
20055 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20056 (overrun_check_free): Likewise.
20057
f2d3008d
PE
20058 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20059 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20060 word size.
20061
ec8df744
PE
20062 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20063 (gnutls_make_error): Rename local to avoid shadowing.
20064 (gnutls_emacs_global_deinit): ifdef out; not used.
20065 (Fgnutls_boot): Use const for pointer to readonly storage.
20066 Comment out unused local. Fix pointer signedness problems.
20067
640ee02d
PE
20068 * lread.c (openp): Don't stuff size_t into an 'int'.
20069 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20070 about possible signed overflow.
20071
6048fb2a
PE
20072 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20073 (GDK_KEY_g): Don't define if already defined.
20074 (xg_prepare_tooltip): Avoid pointer signedness problem.
20075 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20076
fa3c87e1
PE
20077 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20078 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20079
2172544b
PE
20080 * xfns.c (Fx_window_property): Simplify a bit,
20081 to make a bit faster and to avoid GCC 4.6.0 warning.
20082 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20083
9b821a21
PE
20084 * fns.c (internal_equal): Don't assume size_t fits in int.
20085
3c616cfa
PE
20086 * alloc.c (compact_small_strings): Tighten assertion a little.
20087
c2982e87
PE
20088 Replace pEd with more-general pI, and fix some printf arg casts.
20089 * lisp.h (pI): New macro, generalizing old pEd macro to other
20090 conversion specifiers. For example, use "...%"pI"d..." rather
20091 than "...%"pEd"...".
20092 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 20093 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
20094 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20095 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20096 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20097 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20098 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20099 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20100 64-bit hosts.
20101 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20102 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20103 * print.c (safe_debug_print, print_object): Likewise.
20104 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20105 to int.
6f04d126
PE
20106 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20107 avoiding the 0 flag, which is not portable.
c2982e87
PE
20108 * process.c (Fmake_network_process): Use pI to avoid cast.
20109 * region-cache.c (pp_cache): Likewise.
20110 * xdisp.c (decode_mode_spec): Likewise.
20111 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20112 behavior on 64-bit hosts with printf arg.
6f04d126 20113 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
20114 (x_stop_queuing_selection_requests): Likewise.
20115 (x_get_window_property): Don't truncate byte count to an 'int'
20116 when tracing.
0b432f21 20117
5e073ec7
PE
20118 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20119 here, since it parses constructs like leading '-' and spaces,
20120 which are not wanted; and it overflows with large numbers.
20121 Instead, simply match F[0-9]+, which is what is wanted anyway.
20122
36372bf9
PE
20123 * alloc.c: Remove unportable assumptions about struct layout.
20124 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20125 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20126 (allocate_vectorlike, make_pure_vector): Use the new macros,
20127 plus offsetof, to remove unportable assumptions about struct layout.
20128 These assumptions hold on all porting targets that I know of, but
20129 they are not guaranteed, they're easy to remove, and removing them
20130 makes further changes easier.
20131
0b432f21
PE
20132 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20133 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
20134 (string_overrun_cookie): Now const. Use initializers that
20135 don't formally overflow signed char, to avoid warnings.
000098c1
PE
20136 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20137 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
20138 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20139 multiple of sizeof (EMACS_INT); it need not be, if
20140 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 20141 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 20142
895009e1
JB
201432011-04-26 Juanma Barranquero <lekktu@gmail.com>
20144
20145 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20146
6a7a1b0b
TZ
201472011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20148
20149 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 20150 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
20151 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20152
841a1577 201532011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
20154
20155 * lisp.h (Qdebug): List symbol.
895009e1 20156 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
20157 * keyboard.c (debug-on-event): New variable.
20158 (handle_user_signal): Break into debugger when debug-on-event
20159 matches the current signal symbol.
20160
f2d3ba6f
DN
201612011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20162
20163 * alloc.c (check_sblock, check_string_bytes)
20164 (check_string_free_list): Convert to standard C.
20165
42ce4c63
TZ
201662011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20167
20168 * w32.c (emacs_gnutls_push): Fix typo.
20169
825cd63c
EZ
201702011-04-25 Eli Zaretskii <eliz@gnu.org>
20171
fb11d64d
EZ
20172 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20173 "cast to pointer from integer of different size".
20174
825cd63c
EZ
20175 Improve doprnt and its use in verror. (Bug#8545)
20176 * doprnt.c (doprnt): Document the set of format control sequences
20177 supported by the function. Use SAFE_ALLOCA instead of always
20178 using `alloca'.
20179
20180 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20181 is one byte too soon. Don't use xrealloc; instead xfree and
20182 xmalloc anew.
20183
e061a11b
TZ
201842011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20185
20186 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20187 callbacks stage.
20188
20189 * gnutls.c: Renamed global_initialized to
20190 gnutls_global_initialized. Added internals for the
20191 :verify-hostname-error, :verify-error, and :verify-flags
20192 parameters of `gnutls-boot' and documented those parameters in the
20193 docstring. Start callback support.
9173deec
JB
20194 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20195 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20196 on error. Return error code.
e061a11b
TZ
20197 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20198 (emacs_gnutls_read): Likewise.
20199 (Fgnutls_boot): Return handshake error code.
20200 (emacs_gnutls_handle_error): New function.
20201 (wsaerror_to_errno): Likewise.
20202
20203 * w32.h (emacs_gnutls_pull): Add prototype.
20204 (emacs_gnutls_push): Likewise.
20205
20206 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20207 (emacs_gnutls_push): Likewise.
20208
202092011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20210
20211 * process.c (wait_reading_process_output): Check if GnuTLS
20212 buffered some data internally if no FDs are set for TLS
20213 connections.
20214
20215 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20216 (LIBS): Link to USER_LIBS.
20217 ($(BLD)/gnutls.$(0)): New target.
20218
fa6996bc
EZ
202192011-04-24 Eli Zaretskii <eliz@gnu.org>
20220
eb35682e
EZ
20221 * xdisp.c (handle_single_display_spec): Rename the
20222 display_replaced_before_p argument into display_replaced_p, to
20223 make it consistent with the commentary. Fix typos in the
20224 commentary.
20225
e2ad650c
EZ
20226 * textprop.c (syms_of_textprop): Remove dead code.
20227 (copy_text_properties): Delete obsolete commentary about an
20228 interface that was deleted long ago. Fix typos in the description
20229 of arguments.
20230
1b2de274
EZ
20231 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20232 to changes in oldXMenu/XMenu.h from 2011-04-16.
20233 <menu_help_message, prev_menu_help_message>: Constify.
20234 (IT_menu_make_room): menu->help_text is now `const char **';
20235 adjust.
20236
20237 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20238 to changes in oldXMenu/XMenu.h from 2011-04-16.
20239 (struct XMenu): Declare `help_text' `const char **'.
20240
20241 * xfaces.c <Qunspecified>: Make extern again.
20242
20243 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 20244 required by POSIX.
1b2de274 20245
762b15be
EZ
20246 * doc.c (get_doc_string): Improve the format passed to `error'.
20247
20248 * doprnt.c (doprnt): Improve commentary.
20249
20250 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20251
20252 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20253 them with etags.
20254
f1052e5d
EZ
20255 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20256 changes in globals.h immediately force recompilation.
762b15be
EZ
20257 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20258 $(CURDIR)/s/ms-w32.h.
20259 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 20260
fa6996bc
EZ
20261 * character.c (Fchar_direction): Function deleted.
20262 (syms_of_character): Don't defsubr it.
20263 <char-direction-table>: Deleted.
20264
e6c3da20
EZ
202652011-04-23 Eli Zaretskii <eliz@gnu.org>
20266
20267 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20268 * doprnt.c: Include limits.h.
20269 (SIZE_MAX): New macro.
04f2d78b
CB
20270 (doprnt): Return a size_t value. 2nd arg is now size_t.
20271 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
20272 Improve overflow protection. Support `l' modifier for integer
20273 conversions. Support %l conversion. Don't assume an EMACS_INT
20274 argument for integer conversions and for %c.
20275
20276 * lisp.h (doprnt): Restore prototype.
20277
20278 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20279 $(SRC)/character.h.
20280
20281 * Makefile.in (base_obj): Add back doprnt.o.
20282
20283 * deps.mk (doprnt.o): Add back prerequisites.
20284 (callint.o): Depend on character.h.
20285
20286 * eval.c (internal_lisp_condition_case): Include the handler
20287 representation in the error message.
20288 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20289 when breaking from the loop.
20290
20291 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20292
20293 * callint.c (Fcall_interactively): When displaying error message
20294 about invalid control letter, pass the character's codepoint, not
20295 a pointer to its multibyte form. Improve display of the character
20296 in octal and display also its hex code.
20297
20298 * character.c (char_string): Use %x to display the (unsigned)
20299 codepoint of an invalid character, to avoid displaying a bogus
20300 negative value.
20301
20302 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20303 `error', not SYMBOL_NAME itself.
20304
20305 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20306 character arguments to `error'.
20307
20308 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20309 to `error' in error message about FINAL_CHAR argument. Make sure
20310 FINAL_CHAR is a character, and use %c when it is passed as
20311 argument to `error'.
20312
4ffd0d6b 203132011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
20314
20315 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20316
20317 * w32.c: Include <time.h>.
20318 (sys_localtime): New function.
20319
4ffd0d6b 203202011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
20321
20322 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20323
4ffd0d6b 20324 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 20325
4ffd0d6b 203262011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 20327
4ffd0d6b
GM
20328 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20329 zombies (Bug#8467).
aac0c6e3 20330
04c56954
EZ
203312011-04-19 Eli Zaretskii <eliz@gnu.org>
20332
20333 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20334 gl_state.e_property when gl_state.object is Qt.
20335
20336 * insdel.c (make_gap_larger): Remove limitation of buffer size
20337 to <= INT_MAX.
20338
16a43933
CY
203392011-04-18 Chong Yidong <cyd@stupidchicken.com>
20340
20341 * xdisp.c (lookup_glyphless_char_display)
20342 (produce_glyphless_glyph): Handle cons cell entry in
20343 glyphless-char-display.
20344 (Vglyphless_char_display): Document it.
20345
20346 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20347 glyphless-char-display.
20348
4581706e
CY
203492011-04-17 Chong Yidong <cyd@stupidchicken.com>
20350
20351 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20352
20353 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20354
20355 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20356 definition for no-X builds.
20357
4887c6e2 203582011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 20359
fd35b6f9
PE
20360 Static checks with GCC 4.6.0 and non-default toolkits.
20361
5c1ccb01
PE
20362 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20363
006c5daa
PE
20364 * process.c (keyboard_bit_set): Define only if SIGIO.
20365 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20366 (send_process): Repair possible setjmp clobbering.
20367
efc736d3
PE
20368 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20369
4e2fe2e6
PE
20370 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20371
f97334a2
PE
20372 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20373
4e75f29d
PE
20374 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20375 Define only if needed.
20376
90efadd1
PE
20377 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20378 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 20379 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 20380
3c647824
PE
20381 * dispextern.h (struct redisplay_interface): Rename param
20382 to avoid shadowing.
e264f262 20383 * termhooks.h (struct terminal): Likewise.
761383f4 20384 * xterm.c (xembed_send_message): Likewise.
3c647824 20385
b58c5c4a
PE
20386 * insdel.c (make_gap_smaller): Define only if
20387 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20388
cad59032
PE
20389 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20390 it.
20391
c339dc2e
PE
20392 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20393 so that we aren't warned about unused symbols.
20394
91a3e27b
PE
20395 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20396
399c71d3 20397 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 20398
8ffc96f5
PE
20399 * xfns.c (x_real_positions): Mark locals as initialized.
20400
eef9bc79
PE
20401 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20402
098db9dd
PE
20403 * xterm.c: Fix problems found by static analysis with other toolkits.
20404 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
20405 (x_dispatch_event): Declare static if USE_GTK, and
20406 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 20407 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 20408 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
20409 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20410 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 20411
eb18f6cc
PE
20412 * xmenu.c (menu_help_callback): Pointer type fixes.
20413 Use const pointers when pointing at readonly data. Avoid pointer
20414 signedness clashes.
20415 (FALSE): Remove unused macro.
20416 (update_frame_menubar): Remove unused decl.
20417
1fe72bf8
PE
20418 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20419
60d9e1db
PE
20420 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20421 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20422 (single_menu_item): Rename local to avoid shadowing.
20423
39261c26
PE
20424 * keyboard.c (make_lispy_event): Remove unused local var.
20425
018c5e19
PE
20426 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20427 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20428
63d2b86e
PE
20429 * bitmaps: Change bitmaps from unsigned char back to the X11
20430 compatible char. Avoid the old compiler warnings about
20431 out-of-range initializers by using, for example, '\xab' rather
20432 than 0xab.
20433
aefd87e1
PE
20434 * xgselect.c (xgselect_initialize): Check vs interface
20435 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20436
bf501fb9
PE
20437 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20438
e9829fdf
PE
20439 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20440 to read-only memory.
20441
1086c095
PE
20442 * fns.c (vector): Remove; this old hack is no longer needed.
20443
2baccd04 20444 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 20445 Remove unused var.
dde42981 20446 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 20447
72391843 20448 * xrdb.c (x_load_resources): Omit unused local.
3565b346 20449
436c16df 20450 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 20451 (x_window): Rename locals to avoid shadowing.
dc5ddd85 20452 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 20453
92bb796d 20454 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 20455 (x_term_init): Remove local to avoid shadowing.
92bb796d 20456
764430a3 20457 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
20458
20459 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20460 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20461
d1dfb56c
EZ
204622011-04-16 Eli Zaretskii <eliz@gnu.org>
20463
c4354cb4
EZ
20464 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20465
d1dfb56c
EZ
20466 Fix regex.c, syntax.c and friends for buffers > 2GB.
20467 * syntax.h (struct gl_state_s): Declare character position members
20468 EMACS_INT.
20469
20470 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20471
04f2d78b
CB
20472 * textprop.c (verify_interval_modification, interval_of):
20473 Declare arguments EMACS_INT.
d1dfb56c
EZ
20474
20475 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20476 EMACS_INT.
20477
20478 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20479
20480 * indent.c (Fvertical_motion): Local variable it_start is now
20481 EMACS_INT.
20482
20483 * regex.c (re_match, re_match_2, re_match_2_internal)
20484 (bcmp_translate, regcomp, regexec, print_double_string)
20485 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20486 (re_compile_pattern, re_exec): Declare arguments and local
20487 variables `size_t' and `ssize_t' and return values `regoff_t', as
20488 appropriate.
20489 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20490 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20491 <compile_stack_type>: `size' and `avail' are now `size_t'.
20492
20493 * regex.h <regoff_t>: Use ssize_t, not int.
20494 (re_search, re_search_2, re_match, re_match_2): Arguments that
20495 specify buffer/string position and length are now ssize_t and
20496 size_t. Return type is regoff_t.
20497
613052cd
BK
204982011-04-16 Ben Key <bkey76@gmail.com>
20499
20500 * nsfont.m: Fixed bugs in ns_get_family and
20501 ns_descriptor_to_entity that were caused by using free to
20502 deallocate memory blocks that were allocated by xmalloc (via
20503 xstrdup). This caused Emacs to crash when compiled with
20504 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20505 --enable-checking=xmallocoverrun). xfree is now used to
20506 deallocate these memory blocks.
20507
4170f62f 205082011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 20509
71b41406
PE
20510 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20511
9587a89d
PE
20512 emacs_write: Accept and return EMACS_INT for sizes.
20513 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20514 et seq.
20515 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20516 Accept and return EMACS_INT.
20517 (emacs_gnutls_write): Return the number of bytes written on
20518 partial writes.
20519 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
20520 (emacs_read, emacs_write): Remove check for negative size, as the
20521 Emacs source code has been audited now.
9587a89d
PE
20522 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20523 (emacs_read, emacs_write): Use it.
273a5f82
PE
20524 * process.c (send_process): Adjust to the new signatures of
20525 emacs_write and emacs_gnutls_write. Do not attempt to store
20526 a byte offset into an 'int'; it might overflow.
9587a89d 20527 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 20528
3e047f51
PE
20529 * sound.c: Don't assume sizes fit in 'int'.
20530 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 20531 Return EMACS_INT, not int.
3e047f51 20532 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
20533 Accept EMACS_INT, not int.
20534 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
20535 record read return values.
20536
cc39a9db
BK
205372011-04-15 Ben Key <bkey76@gmail.com>
20538
c9d0ec6d
JB
20539 * keyboard.c (Qundefined): Don't declare static since it is used
20540 in nsfns.m.
20541 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20542 static since they are used in nsfont.m.
cc39a9db 20543
6c60eb9f
SM
205442011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20545
20546 * process.c (Qprocessp): Don't declare static.
20547 * lisp.h (Qprocessp): Declare again.
20548
7990b61a
JB
205492011-04-15 Juanma Barranquero <lekktu@gmail.com>
20550
20551 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20552
5d4cb038
PE
205532011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20554
8bd7b830 20555 Improve C-level modularity by making more things 'static'.
cd64ea1d 20556
e3b27b31
PE
20557 Don't publish debugger-only interfaces to other modules.
20558 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20559 (verify_bytepos, count_markers): Move decls to the only modules
20560 that need them.
20561 * region-cache.h (pp_cache): Likewise.
20562 * window.h (check_all_windows): Likewise.
20563 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20564
5d4cb038
PE
20565 * sysdep.c (croak): Now static, if
20566 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20567 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
20568
20569 * alloc.c (refill_memory_reserve): Now static if
20570 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20571 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 20572
e87b6180
PE
20573 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20574 Define only if USE_LUCID.
20575
ac64929e
PE
20576 * xrdb.c (x_customization_string, x_rm_string): Now static.
20577
6f37259d
PE
20578 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20579 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20580
1683e3ab
PE
20581 * xdisp.c (draw_row_with_mouse_face): Now static.
20582 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20583
de9c2632
PE
20584 * window.h (check_all_windows): Mark externally visible.
20585
2b96acb7
PE
20586 * window.c (window_deletion_count): Now static.
20587
20588 * undo.c: Make symbols static if they're not exported.
20589 (last_undo_buffer, last_boundary_position, pending_boundary):
20590 Now static.
20591
50436f33
PE
20592 * textprop.c (interval_insert_behind_hooks): Now static.
20593 (interval_insert_in_front_hooks): Likewise.
20594
64520e5c
PE
20595 * term.c: Make symbols static if they're not exported.
20596 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20597 (max_frame_lines, tty_set_terminal_modes):
20598 (tty_reset_terminal_modes, tty_turn_off_highlight):
20599 (get_tty_terminal): Now static.
20600 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20601 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 20602 HAVE_WINDOW_SYSTEM.
64520e5c
PE
20603 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20604 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20605
1fa53021
PE
20606 * sysdep.c: Make symbols static if they're not exported.
20607 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20608 Now static.
20609 (sigprocmask_set, full_mask): Remove; unused.
20610 (wait_debugging): Mark as visible.
20611 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20612 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20613
d4b43b22
PE
20614 * syntax.c (syntax_temp): Define only if !__GNUC__.
20615
b7c513d0
PE
20616 * sound.c (current_sound_device, current_sound): Now static.
20617
989b29ad
PE
20618 * search.c (searchbufs, searchbuf_head): Now static.
20619
13a55a78
PE
20620 * scroll.c (scroll_cost): Remove; unused.
20621 * dispextern.h (scroll_cost): Remove decl.
20622
de68a1fc
PE
20623 * region-cache.h (pp_cache): Mark as externally visible.
20624
40ccffa6
PE
20625 * process.c: Make symbols static if they're not exported.
20626 (process_tick, update_tick, create_process, chan_process):
20627 (Vprocess_alist, proc_buffered_char, datagram_access):
20628 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20629 (deactivate_process): Mark defn as static, as well as decl.
20630 * lisp.h (create_process): Remove decl.
20631 * process.h (chan_process, Vprocess_alist): Remove decls.
20632
ad64fc97
PE
20633 * print.c: Make symbols static if they're not exported.
20634 (print_depth, new_backquote_output, being_printed, print_buffer):
20635 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20636 (print_interval, print_number_index, initial_stderr_stream):
20637 Now static.
20638 * lisp.h (Fprinc): Remove decl.
20639 (debug_output_compilation_hack): Mark as externally visible.
20640
adddb265
PE
20641 * sysdep.c (croak): Move decl from here to syssignal.h.
20642 * syssignal.h (croak): Put it here, so the API can be checked when
20643 'croak' is called from dissociate_if_controlling_tty.
20644
1717ede2
PE
20645 * minibuf.c: Make symbols static if they're not exported.
20646 (minibuf_save_list, choose_minibuf_frame): Now static.
20647 * lisp.h (choose_minibuf_frame): Remove decl.
20648
fa5fb2bc
PE
20649 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20650
1e3890d1
PE
20651 * lread.c: Make symbols static if they're not exported.
20652 (read_objects, initial_obarray, oblookup_last_bucket_number):
20653 Now static.
20654 (make_symbol): Remove; unused.
20655 * lisp.h (initial_obarray, make_symbol): Remove decls.
20656
8a1414fa
PE
20657 * keyboard.c: Make symbols static if they're not exported.
20658 (single_kboard, recent_keys_index, total_keys, recent_keys):
20659 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20660 (this_single_command_key_start, echoing, last_auto_save):
20661 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20662 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20663 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20664 (Vlispy_mouse_stem, double_click_count):
20665 Now static.
20666 (force_auto_save_soon): Define only if SIGDANGER.
20667 (ignore_mouse_drag_p): Now static if
20668 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20669 (print_help): Remove; unused.
20670 (stop_character, last_timer_event): Mark as externally visible.
20671 * keyboard.h (ignore_mouse_drag_p): Declare only if
20672 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20673 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20674 * lisp.h (echoing): Remove decl.
20675 (force_auto_save_soon): Declare only if SIGDANGER.
20676 * xdisp.c (redisplay_window): Simplify code, to make it more
20677 obvious that ignore_mouse_drag_p is not accessed if !defined
20678 USE_GTK && !defined HAVE_NS.
20679
93ea6e8f
PE
20680 * intervals.c: Make symbols static if they're not exported.
20681 (merge_properties_sticky, merge_interval_right, delete_interval):
20682 Now static.
20683 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20684
77382fcc
PE
20685 * insdel.c: Make symbols static if they're not exported.
20686 However, leave prepare_to_modify_buffer alone. It's never
20687 called from outside this function, but that appears to be a bug.
20688 (combine_after_change_list, combine_after_change_buffer):
4889fc82 20689 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
20690 (adjust_after_replace_noundo): Remove; unused.
20691 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 20692 (signal_before_change): Remove decls.
77382fcc 20693
9306c32e
PE
20694 * indent.c (val_compute_motion, val_vmotion): Now static.
20695
cd44d2eb
PE
20696 * image.c: Make symbols static if they're not exported.
20697 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20698 if USE_GTK.
20699 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20700 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20701
ad9a7a06
PE
20702 * fringe.c (standard_bitmaps): Now static.
20703 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20704
81626931
PE
20705 * frame.c: Make symbols static if they're not exported.
20706 (x_report_frame_params, make_terminal_frame): Now static.
20707 (get_frame_param): Now static, unless HAVE_NS.
20708 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20709 (x_get_resource_string): Remove; not used.
20710 * frame.h (make_terminal_frame, x_report_frame_params):
20711 (x_get_resource_string); Remove decls.
20712 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20713 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20714
239f9db9
PE
20715 * font.c, fontset.c: Make symbols static if they're not exported.
20716 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20717 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20718 * font.c (font_close_object): Now static.
20719 * font.h (font_close_object): Remove.
20720 * fontset.c (FONTSET_OBJLIST): Remove.
20721 (free_realized_fontset) #if-0 the body, which does nothing.
20722 (face_suitable_for_char_p): #if-0, as it's never called.
20723 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
20724 * xfaces.c (face_at_string_position):
20725 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
20726 since 0 is always ASCII.
20727
dfcf3579
PE
20728 * fns.c (weak_hash_tables): Now static.
20729
5045092b
PE
20730 * fileio.c: Make symbols static if they're not exported.
20731 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20732 (Vwrite_region_annotation_buffers): Now static.
20733
57a96f5c
PE
20734 * eval.c: Make symbols static if they're not exported.
20735 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20736 * lisp.h (backtrace_list): Remove decl.
20737
35f08c38
PE
20738 * emacs.c: Make symbols static if they're not exported.
20739 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20740 (fatal_error_code, fatal_error_signal_hook, standard_args):
20741 Now static.
20742 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20743 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20744 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20745 * lisp.h (fatal_error_signal_hook): Remove decl.
20746 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20747
f44bd759
PE
20748 * editfns.c: Move a (normally-unused) function to its only use.
20749 * editfns.c, lisp.h (get_operating_system_release): Remove.
20750 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20751 worth the hassle of breaking this out.
20752
b532497d
PE
20753 * xterm.c: Make symbols static if they're not exported.
20754 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
20755 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
20756 (x_destroy_window, x_delete_display):
20757 Now static.
20758 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
20759 (x_mouse_leave): Remove; unused.
20760 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
20761 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
20762 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
20763 Remove decls.
20764 (x_mouse_leave): Declare only if WINDOWSNT.
20765 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
20766 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
20767 USE_X_TOOLKIT.
20768
1675728f
PE
20769 * ftxfont.c: Make symbols static if they're not exported.
20770 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
20771 HAVE_FREETYPE.
20772 * font.h (ftxfont_driver): Likewise.
20773
e4cebfca
PE
20774 * xfns.c: Make symbols static if they're not exported.
20775 (x_last_font_name, x_display_info_for_name):
20776 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
20777 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
20778 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
20779 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
20780 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
20781 (last_show_tip_args): Now static.
20782 (xic_defaut_fontset, xic_create_fontsetname): Define only if
20783 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
20784 (x_screen_planes): Remove; unused.
20785 * dispextern.h (x_screen_planes): Remove decl.
20786
5bf46f05
PE
20787 * dispnew.c: Make symbols static if they're not exported.
20788 * dispextern.h (redraw_garbaged_frames, scrolling):
20789 (increment_row_positions): Remove.
20790 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
20791 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
20792 Now static.
20793 (redraw_garbaged_frames): Remove; unused.
20794
435f4c28
PE
20795 * xfaces.c: Make symbols static if they're not exported.
20796 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
20797 Remove decls.
20798 * xterm.h (defined_color): Remove decls.
20799 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
20800 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
20801 (menu_face_changed_default, defined_color, free_realized_face):
20802 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
20803 (ascii_face_of_lisp_face): Remove; unused.
20804
8524aef3
PE
20805 * xdisp.c: Make symbols static if they're not exported.
20806 * dispextern.h (scratch_glyph_row, window_box_edges):
20807 (glyph_to_pixel_coords, set_cursor_from_row):
20808 (get_next_display_element, set_iterator_to_next):
20809 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
20810 (show_mouse_face): Remove decls
20811 * frame.h (message_buf_print): Likewise.
20812 * lisp.h (pop_message, set_message, check_point_in_composition):
20813 Likewise.
20814 * xterm.h (set_vertical_scroll_bar): Likewise.
20815 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
20816 (message_buf_print, scratch_glyph_row, displayed_buffer):
20817 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
20818 (get_next_display_element, show_mouse_face, window_box_edges):
20819 (frame_to_window_pixel_xy, check_point_in_composition):
20820 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
20821 (glyph_to_pixel_coords): Remove; unused.
20822
16390cd2
PE
20823 * dired.c (file_name_completion): Now static.
20824
20825 * dbusbind.c (xd_in_read_queued_messages): Now static.
20826
a25f4dfa
PE
20827 * lisp.h (circular_list_error, FOREACH): Remove; unused.
20828 * data.c (circular_list_error): Remove.
20829
14a9c8df
PE
20830 * commands.h (last_point_position, last_point_position_buffer):
20831 (last_point_position_window): Remove decls.
20832 * keyboard.c: Make these variables static.
20833
04f2d78b
CB
20834 * coding.h (coding, code_convert_region, encode_coding_gap):
20835 Remove decls.
74ab6df5
PE
20836 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
20837 (iso_code_class, detect_coding, code_convert_region): Now static.
20838 (encode_coding_gap): Remove; unused.
20839
38dfbee1
PE
20840 * chartab.c (chartab_chars, chartab_bits): Now static.
20841
a2cb4e63
PE
20842 * charset.h (charset_iso_8859_1): Remove decl.
20843 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20844 Now static.
20845
127198fd
PE
20846 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20847 * ccl.c (Vccl_program_table): Now static.
20848 (check_ccl_update): Remove; unused.
20849
d85b608f
PE
20850 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20851 * category.h: ... from here.
20852 * category.c (check_category_table, set_category_set): Now static.
20853
31cd66f3
PE
20854 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20855 * lisp.h: Remove these decls.
20856
c358e587
PE
20857 * buffer.c (buffer_count): Remove unused var.
20858
e78aecca
PE
20859 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20860 so that it's not optimized away.
20861 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20862 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20863 exported only to the debugger.
20864
e192d7d3 20865 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 20866 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 20867
92470028
PE
20868 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20869 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20870 was inaccessible from Lisp.
20871 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20872 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20873
244ed907
PE
20874 alloc.c: Import and export fewer symbols, and remove unused items.
20875 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20876 is defined.
20877 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20878 it's not optimized away by whole-program optimization.
20879 (message_enable_multibyte, free_misc): Remove.
20880 (catchlist, handlerlist, mark_backtrace):
20881 Declare only if BYTE_MARK_STACK.
20882 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20883 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20884 (message_enable_multibyte): Remove decl.
20885 (free_misc, interval_free_list, float_block, float_block_index):
20886 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20887 (cons_free_list, last_marked_index):
20888 Now static.
20889 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20890 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20891 (mark_backtrace): Define only if BYTE_MARK_STACK.
20892 * xdisp.c (message_enable_multibyte): Now static.
20893
61c2b50e 20894 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
20895 This makes it easier for human readers (and static analyzers)
20896 to see whether these variables are used from other modules.
20897 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
20898 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
20899 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
20900 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
20901 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
20902 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
20903 * xmenu.c, xselect.c:
20904 Declare Q* vars static if they are not used in other modules.
20905 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
20906 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
20907 Remove decls of unexported vars.
20908 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
20909
95c82688
PE
20910 * lisp.h (DEFINE_FUNC): Make sname 'static'.
20911
16a97296
PE
20912 Make Emacs functions such as Fatom 'static' by default.
20913 This makes it easier for human readers (and static analyzers)
20914 to see whether these functions can be called from other modules.
20915 DEFUN now defines a static function. To make the function external
20916 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
20917 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
20918 (Finit_image_library):
16a97296
PE
20919 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
20920 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
20921 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
20922 Remove decls, since these functions are now static.
20923 (Funintern, Fget_internal_run_time): New decls, since these functions
20924 were already external.
95c82688 20925
16a97296
PE
20926 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
20927 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
20928 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
20929 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
20930 * keyboard.c, keymap.c, lread.c:
20931 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
20932 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
20933 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
20934 Mark functions with DEFUE instead of DEFUN,
20935 if they are used in other modules.
20936 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
20937 decls for now-static functions.
20938 * buffer.h (Fdelete_overlay): Remove decl.
20939 * callproc.c (Fgetenv_internal): Mark as internal.
20940 * composite.c (Fremove_list_of_text_properties): Remove decl.
20941 (Fcomposition_get_gstring): New forward static decl.
20942 * composite.h (Fcomposite_get_gstring): Remove decl.
20943 * dired.c (Ffile_attributes): New forward static decl.
20944 * doc.c (Fdocumntation_property): New forward static decl.
20945 * eval.c (Ffetch_bytecode): New forward static decl.
20946 (Funintern): Remove extern decl; now in .h file where it belongs.
20947 * fileio.c (Fmake_symbolic_link): New forward static decl.
20948 * image.c (Finit_image_library): New forward static decl.
20949 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
20950 * intervals.h (Fprevious_property_change):
20951 (Fremove_list_of_text_properties): Remove decls.
20952 * keyboard.c (Fthis_command_keys): Remove decl.
20953 (Fcommand_execute): New forward static decl.
20954 * keymap.c (Flookup_key): New forward static decl.
20955 (Fcopy_keymap): Now static.
20956 * keymap.h (Flookup_key): Remove decl.
20957 * process.c (Fget_process): New forward static decl.
20958 (Fprocess_datagram_address): Mark as internal.
20959 * syntax.c (Fsyntax_table_p): New forward static decl.
20960 (skip_chars): Remove duplicate decl.
20961 * textprop.c (Fprevious_property_change): New forward static decl.
20962 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
20963 Now internal.
20964 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
20965 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
20966
785bbd42
PE
20967 * editfns.c (Fformat): Remove unreachable code.
20968
8b913b57
AS
209692011-04-14 Andreas Schwab <schwab@linux-m68k.org>
20970
20971 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
20972 change. (Bug#8496)
20973
a6744a35
EZ
209742011-04-13 Eli Zaretskii <eliz@gnu.org>
20975
20976 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
20977 when at ZV. (Bug#8487)
20978
e7974947
AS
209792011-04-12 Andreas Schwab <schwab@linux-m68k.org>
20980
baad03f0
AS
20981 * charset.c (Fclear_charset_maps): Use xfree instead of free.
20982 (Bug#8437)
20983 * keyboard.c (parse_tool_bar_item): Likewise.
20984 * sound.c (sound_cleanup, alsa_close): Likewise.
20985 * termcap.c (tgetent): Likewise.
20986 * xfns.c (x_default_font_parameter): Likewise.
20987 * xsettings.c (read_and_apply_settings): Likewise.
20988
e7974947
AS
20989 * alloc.c (overrun_check_malloc, overrun_check_realloc)
20990 (overrun_check_free): Protoize.
20991
28272684
PE
209922011-04-12 Paul Eggert <eggert@cs.ucla.edu>
20993
20994 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
20995 since callers should never pass a negative size.
20996 Change the signature to match that of plain 'read' and 'write'; see
20997 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
20998 * lisp.h: Update prototypes of emacs_write and emacs_read.
20999
11997c76
EZ
210002011-04-11 Eli Zaretskii <eliz@gnu.org>
21001
21002 * xdisp.c (redisplay_window): Don't try to determine the character
21003 position of the scroll margin if the window start point w->startp
e896f03c 21004 is outside the buffer's accessible region. (Bug#8468)
11997c76 21005
8a2cbd72
EZ
210062011-04-10 Eli Zaretskii <eliz@gnu.org>
21007
21008 Fix write-region and its subroutines for buffers > 2GB.
21009 * fileio.c (a_write, e_write): Modify declaration of arguments and
21010 local variables to support buffers larger than 2GB.
21011 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21012
21013 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21014 argument, local variables, and return value.
21015
21016 * lisp.h: Update prototypes of emacs_write and emacs_read.
21017
21018 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21019
4073e537 210202011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 21021
1ebfdcb6
PE
21022 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21023
b2ded58d
PE
21024 Fix more problems found by GCC 4.6.0's static checks.
21025
7d66342c
PE
21026 * xdisp.c (vmessage): Use a better test for character truncation.
21027
bbf47d44
PE
21028 * charset.c (load_charset_map): <, not <=, for optimization,
21029 and to avoid potential problems with integer overflow.
9248994d 21030 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 21031 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 21032 * editfns.c (Fformat): Likewise.
1e69125e 21033 * syntax.c (skip_chars): Likewise.
3befa583 21034
e3019616
PE
21035 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21036 This also lets GCC 4.6.0 generate slightly better loop code.
21037
becfa255
PE
21038 * callint.c (Fcall_interactively): <, not <=, for optimization.
21039 (Fcall_interactively): Count the number of arguments produced,
21040 not the number of arguments given. This is simpler and lets GCC
21041 4.6.0 generate slightly better code.
21042
dae0cd48
PE
21043 * ftfont.c: Distingish more carefully between FcChar8 and char.
21044 The previous code passed unsigned char * to a functions like
21045 strlen and xstrcasecmp that expect char *, which does not
21046 conform to the C standard.
21047 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21048 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21049 char * when the C standard requires it.
21050
76032d70
PE
21051 * keyboard.c (read_char): Remove unused var.
21052
eb3f1cc8
PE
21053 * eval.c: Port to Windows vsnprintf (Bug#8435).
21054 Include <limits.h>.
21055 (SIZE_MAX): Define if the headers do not.
21056 (verror): Do not give up if vsnprintf returns a negative count.
21057 Instead, grow the buffer. This ports to Windows vsnprintf, which
21058 does not conform to C99. Problem reported by Eli Zaretskii.
21059 Also, simplify the allocation scheme, by avoiding the need for
21060 calling realloc, and removing the ALLOCATED variable.
21061
70476b54
PE
21062 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21063
12020a9e
PE
21064 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21065 But keep the doprint source code for now, as we might revamp it
21066 and use it again (Bug#8435).
ea6c7ae6
PE
21067 * lisp.h (doprnt): Remove.
21068 * Makefile.in (base_obj): Remove doprnt.o.
21069 * deps.mk (doprnt.o): Remove.
21070
5fdb398c
PE
21071 error: Print 32- and 64-bit integers portably (Bug#8435).
21072 Without this change, on typical 64-bit hosts error ("...%d...", N)
21073 was used to print both 32- and 64-bit integers N, which relied on
21074 undefined behavior.
61bdb816 21075 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
21076 * lisp.h (error, verror): Mark as printf-like functions.
21077 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21078 Report overflow in size calculations when allocating printf buffer.
21079 Do not truncate output string at its first null byte.
21080 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21081 Truncate the output at a character boundary, since vsnprintf does not
21082 do that.
21083 * charset.c (check_iso_charset_parameter): Convert internal
21084 character to string before calling 'error', since %c now has the
21085 printf meaning.
21086 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21087 overflow when computing char to be passed to 'error'. Do not
21088 pass Lisp_Object to 'error'; pass the integer instead.
21089 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21090 formatted with plain %d.
21091
b189fa66
PE
21092 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21093
bff87ef0
PE
21094 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21095
7e2cac20
PE
21096 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21097
ce4d90b5
PE
21098 * xterm.c (x_catch_errors): Remove duplicate declaration.
21099
266c9547
PE
21100 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21101
79c49ad2
PE
21102 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21103
368f4090
JM
211042011-04-10 Jim Meyering <meyering@redhat.com>
21105
21106 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21107 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21108 return ssize_t not "int", and use size_t as the buffer length.
21109 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21110 * gnutls.h: Update declarations.
21111 * process.c (read_process_output): Use ssize_t, to match.
21112 (send_process): Likewise.
21113
a32d4040
CY
211142011-04-09 Chong Yidong <cyd@stupidchicken.com>
21115
21116 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21117
8546720e 211182011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 21119
04f2d78b
CB
21120 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21121 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 21122
8546720e
GM
21123 * xterm.c (handle_one_xevent):
21124 * xmenu.c (create_and_show_popup_menu):
21125 * xselect.c (x_decline_selection_request)
21126 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 21127
0a2f5c1a 211282011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
21129
21130 Fix some uses of `int' instead of EMACS_INT.
21131 * search.c (string_match_1, fast_string_match)
21132 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21133 (scan_buffer, find_next_newline_no_quit)
21134 (find_before_next_newline, search_command, Freplace_match)
21135 (Fmatch_data): Make some `int' variables be EMACS_INT.
21136
21137 * xdisp.c (display_count_lines): 3rd argument and return value now
21138 EMACS_INT. All callers changed.
21139 (pint2hrstr): Last argument is now EMACS_INT.
21140
21141 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21142 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21143 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21144 (decode_coding_utf_16, decode_coding_emacs_mule)
21145 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21146 (decode_coding_ccl, decode_coding_charset)
21147 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21148 (decode_coding_iso_2022, decode_coding_emacs_mule)
21149 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21150 <char_offset, last_offset>: Declare EMACS_INT.
21151 (encode_coding_utf_8, encode_coding_utf_16)
21152 (encode_coding_emacs_mule, encode_invocation_designation)
21153 (encode_designation_at_bol, encode_coding_iso_2022)
21154 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21155 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21156 Declare EMACS_INT.
21157 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21158 (encode_invocation_designation): Last argument P_NCHARS is now
21159 EMACS_INT.
21160 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21161 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21162
21163 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21164 All users changed.
21165
21166 * ccl.c (Fccl_execute_on_string): Declare some variables
21167 EMACS_INT.
21168
8546720e 211692011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
21170
21171 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21172
4e19a977
CS
211732011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21174
21175 * process.c (Fformat_network_address): Doc fix.
21176
87302331
R
211772011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21178
ee7683eb 21179 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 21180
cbb59342
CY
211812011-04-08 Chong Yidong <cyd@stupidchicken.com>
21182
21183 * keyboard.c (read_char): Call Lisp function help-form-show,
21184 instead of using internal_with_output_to_temp_buffer.
21185 (Qhelp_form_show): New var.
e0d38eeb 21186 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
21187
21188 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21189
21190 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21191
e67a13ab
CY
211922011-04-06 Chong Yidong <cyd@stupidchicken.com>
21193
04f2d78b
CB
21194 * process.c (Flist_processes): Remove to Lisp.
21195 (list_processes_1): Delete.
e67a13ab 21196
973f782d
EZ
211972011-04-06 Eli Zaretskii <eliz@gnu.org>
21198
7c106b1e
EZ
21199 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21200
973f782d
EZ
21201 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21202
41cf7d1a 212032011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 21204
ca23cc88
PE
21205 Fix more problems found by GCC 4.6.0's static checks.
21206
f390e2d5
PE
21207 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21208
42eea0d0
PE
21209 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21210
b69769da 21211 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 21212
f9541e84
PE
21213 * xdisp.c (vmessage): Mark as a printf-like function.
21214
13841b55
PE
21215 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21216
c136c10f
PE
21217 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21218
5e2d4a30
PE
21219 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21220 printf-like functions.
21221 (tiff_load): Add casts to remove these marks before passing them
21222 to system-supplied API.
21223
583f48b9
PE
21224 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21225
b25d760e
PE
21226 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21227 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
21228 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21229 directly, rather than having caller test rule sign. This avoids
21230 some unnecessary tests.
21231 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21232 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21233 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 21234
bc7b6697 21235 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 21236 (xfont_open): Avoid unnecessary tests.
bc7b6697 21237
27ccc379
PE
21238 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21239
dcd5c89a
PE
21240 * composite.h, composite.c (composition_gstring_put_cache):
21241 Use EMACS_INT, not int, for length.
21242
b13a45c6
PE
21243 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21244 breaking out part of COMPOSITION_DECODE_RULE.
21245 (COMPOSITION_DECODE_RULE): Use it.
21246 * composite.c (get_composition_id): Remove unused local vars,
21247 by using the new macro.
21248
1e792e4d
PE
21249 * textprop.c (set_text_properties_1): Change while to do-while,
21250 since the condition is always true at first.
21251
dc6c6455 21252 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
21253 (interval_deletion_adjustment): Return unsigned value.
21254 All uses changed.
dc6c6455 21255
aba7731a
PE
21256 * process.c (list_processes_1, create_pty, read_process_output):
21257 (exec_sentinel): Remove vars that were set but not used.
afd4052b 21258 (create_pty): Remove unnecessary "volatile"s.
bc57d757 21259 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 21260 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 21261 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 21262
fdfc4bf3
PE
21263 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21264
fca8fe46 21265 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 21266 (update_syntax_table): Use unsigned instead of int.
fca8fe46 21267
06a0259a 21268 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 21269 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 21270 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 21271
e7b9e80f
PE
21272 * print.c (print_error_message): Avoid int overflow.
21273
56201685
PE
21274 * font.c (font_list_entities): Redo for clarity,
21275 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21276
78834453 21277 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 21278 (font_score): Avoid potential overflow in diff calculation.
78834453 21279
0bc0b309 21280 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 21281 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 21282
e610eaca
PE
21283 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21284
b895abce
PE
21285 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21286 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21287 can always succeed if overflow has undefined behavior.
21288
1f1d9321 21289 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 21290 (wordify): Omit three unnecessary tests.
1f1d9321 21291
c59478bc
PE
21292 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21293 All callers changed. This avoids the need for an unused var.
21294
79b73827
PE
21295 * casefiddle.c (casify_region): Remove var that is set but not used.
21296
a4db5dfe
PE
21297 * dired.c (file_name_completion): Remove var that is set but not used.
21298
43aae36e
PE
21299 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21300
2a47c44d 21301 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 21302 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 21303
a37c69bf
PE
21304 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21305 Check for integer overflow on size calculations.
21306
328ab8e7
PE
21307 * buffer.c (Fprevious_overlay_change): Remove var that is set
21308 but not used.
21309
e5a2a5cb
PE
21310 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21311 Remove vars that are set but not used.
8d84a6eb 21312 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 21313 (timer_check_2): Mark vars as initialized.
e5a2a5cb 21314
a60e5f68
PE
21315 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21316
f661cb61 21317 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 21318 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 21319
f0397f5a
PE
21320 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21321 that are set but not used.
21322
8664db06 21323 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 21324 if XCreateBitmapFromData fails (Bug#8410).
8664db06 21325
6abdaa4a
PE
21326 * xselect.c (x_get_local_selection, x_handle_property_notify):
21327 Remove vars that are set but not used.
21328
0ce7538d 21329 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 21330 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 21331
9ae848fc
PE
21332 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21333 Remove var that is set but not used.
0b918413
PE
21334 (scroll_bar_windows_size): Now size_t, not int.
21335 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21336 Check for overflow.
9ae848fc 21337
a5a62657
PE
21338 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21339 (map_tty_color) [!defined MSDOS]: Likewise.
21340
5c5cdd39
PE
21341 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21342
66ebf983
PE
21343 * coding.c: Remove vars that are set but not used.
21344 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21345 All callers changed.
21346 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21347 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21348 (decode_coding_charset): Remove vars that are set but not used.
21349
1be4d761
PE
21350 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21351 that is set but not used.
21352
47553fa8
PE
21353 * print.c (print_object): Remove var that is set but not used.
21354
1f7196bf 21355 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
21356 The gnulib version avoids calling malloc in the usual case,
21357 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21358 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21359 * filelock.c (current_lock_owner): Likewise.
21360 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21361 * sysdep.c: Include allocator.h, careadlinkat.h.
21362 (emacs_no_realloc_allocator): New static constant.
21363 (emacs_readlink): New function.
fdb61804
PE
21364 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21365 ../lib/careadlinkat.h.
d1fdcab7 21366
f84c17c7
SM
213672011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21368
21369 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21370 first non-nil return value).
21371
ef3862ad
JD
213722011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21373
21374 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21375 if not defined (Bug#8403).
21376
376a7006
JB
213772011-04-02 Juanma Barranquero <lekktu@gmail.com>
21378
21379 * xdisp.c (display_count_lines): Remove parameter `start',
21380 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21381 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21382 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21383 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21384 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21385 and thereabouts. All callers changed.
21386 (get_per_char_metric): Remove parameter `f', unused since
21387 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21388
6ca3801d
JM
213892011-04-02 Jim Meyering <meyering@redhat.com>
21390
21391 do not dereference NULL upon failed strdup
21392 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21393 (ns_get_family): Likewise.
21394
d8e2b5ba
JB
213952011-04-02 Juanma Barranquero <lekktu@gmail.com>
21396
21397 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21398
8c74fcbd
JD
213992011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21400
21401 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21402 later (Bug#8403).
21403
7200d79c
SM
214042011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21405
03408648 21406 Add lexical binding.
7200d79c 21407
03408648
SM
21408 * window.c (Ftemp_output_buffer_show): New fun.
21409 (Fsave_window_excursion):
21410 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21411
21412 * lread.c (lisp_file_lexically_bound_p): New function.
21413 (Fload): Bind Qlexical_binding.
21414 (readevalloop): Remove `evalfun' arg.
21415 Bind Qinternal_interpreter_environment.
21416 (Feval_buffer): Bind Qlexical_binding.
21417 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21418 Mark as dynamic.
21419 (syms_of_lread): Declare `lexical-binding'.
21420
21421 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21422
21423 * keyboard.c (eval_dyn): New fun.
21424 (menu_item_eval_property): Use it.
ca105506
SM
21425
21426 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 21427
03408648
SM
21428 * fns.c (concat, mapcar1): Accept byte-code-functions.
21429
21430 * eval.c (Fsetq): Handle lexical vars.
21431 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21432 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21433 (FletX, Flet): Obey lexical binding.
21434 (Fcommandp): Handle closures.
21435 (Feval): New `lexical' arg.
21436 (eval_sub): New function extracted from Feval. Use it almost
21437 everywhere where Feval was used. Look up vars in lexical env.
21438 Handle closures.
21439 (Ffunctionp): Move from subr.el.
21440 (Ffuncall): Handle closures.
21441 (apply_lambda): Remove `eval_flags'.
21442 (funcall_lambda): Handle closures and new byte-code-functions.
21443 (Fspecial_variable_p): New function.
21444 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21445 but without exporting it to Lisp.
23aba0ea 21446
23aba0ea 21447 * doc.c (Fdocumentation, store_function_docstring):
03408648 21448 * data.c (Finteractive_form): Handle closures.
23aba0ea 21449
03408648
SM
21450 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21451 interactive spec.
ba83908c 21452
04f2d78b
CB
21453 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21454 New byte-codes.
03408648
SM
21455 (exec_byte_code): New function extracted from Fbyte_code to handle new
21456 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 21457
03408648 21458 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 21459
03408648 21460 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 21461
e2abce01
JB
214622011-03-31 Juanma Barranquero <lekktu@gmail.com>
21463
21464 * xdisp.c (redisplay_internal): Fix prototype.
21465
63696a73 214662011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 21467
63696a73 21468 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
21469 (try_scrolling): Use it when setting scroll_limit.
21470 Limit scrolling to 100 screen lines.
63696a73
EZ
21471 (redisplay_window): Even when falling back on "recentering",
21472 position point in the window according to scroll-conservatively,
21473 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21474
21475 (try_scrolling): When point is above the window, allow searching
21476 as far as scroll_max, or one screenful, to compute vertical
21477 distance from PT to the scroll margin position. This prevents
21478 try_scrolling from unnecessarily failing when
21479 scroll-conservatively is set to a value slightly larger than the
21480 window height. Clean up the case of PT below the margin at bottom
21481 of window: scroll_max can no longer be INT_MAX. When aggressive
21482 scrolling is in use, don't let point enter the opposite scroll
21483 margin as result of the scroll.
21484 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
21485 threshold of 100 lines for never-recentering scrolling.
21486
e4cc2dfc
JB
214872011-03-31 Juanma Barranquero <lekktu@gmail.com>
21488
21489 * dispextern.h (move_it_by_lines):
21490 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21491 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21492 (message_log_check_duplicate): Remove parameters `prev_bol' and
21493 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21494 (redisplay_internal): Remove parameter `preserve_echo_area',
21495 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21496
21497 * indent.c (Fvertical_motion):
21498 * window.c (window_scroll_pixel_based, Frecenter):
21499 Don't pass `need_y_p' to `move_it_by_lines'.
21500
1c470562
SM
215012011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21502
44f230aa
SM
21503 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21504 steal a few bits to be more compact.
21505 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21506 Remove unneeded casts.
21507
1c470562
SM
21508 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21509
888adce9
ZK
215102011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21511
21512 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21513 binding" message (bug#7967).
21514
f838ed7b
PE
215152011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21516
77861b95
PE
21517 Fix more problems found by GCC 4.6.0's static checks.
21518
de6dbc14
PE
21519 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21520 Remove unused local var.
21521
f838ed7b
PE
21522 * editfns.c (Fmessage_box): Remove unused local var.
21523
792c7b2b
PE
21524 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21525 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21526 Omit unused local vars.
c499e557 21527 * window.c (shrink_windows): Omit unused local var.
b01a1c29 21528 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
21529 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21530 Omit unused local var.
21531
ba0165e1
PE
21532 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21533 Don't assume string length fits in int.
32ad8845 21534 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 21535 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 21536
3c59b4c9
PE
21537 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21538 instead of alloca (Bug#8344).
21539
a3eed478 21540 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 21541 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 21542
eb4d412d
PE
21543 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21544
1658b401
PE
21545 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21546 concerns.
21547
21548 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21549
21550 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 21551
9a2c6e05
PE
21552 * keyboard.c (syms_of_keyboard): Use the same style as later
21553 in this function when indexing through an array. This also
21554 works around GCC bug 48267.
21555
03d0a109
PE
21556 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21557
44f730c8
PE
21558 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21559
fe75f926
PE
21560 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21561 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21562
ffa8c828
PE
21563 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21564 This avoids undefined behavior on integer overflow, and is a bit
21565 more convenient anyway since it is compared to a size_t variable.
21566
c5101a77
PE
21567 Variadic C functions now count arguments with size_t, not int.
21568 This avoids an unnecessary limitation on 64-bit machines, which
21569 caused (substring ...) to crash on large vectors (Bug#8344).
21570 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21571 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 21572 All variadic functions and their callers changed accordingly.
c5101a77
PE
21573 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21574 * data.c (arith_driver, float_arith_driver): Likewise.
21575 * editfns.c (general_insert_function): Likewise.
21576 * eval.c (struct backtrace.nargs, interactive_p)
21577 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21578 (funcall_lambda, mark_backtrace): Likewise.
21579 * fns.c (concat): Likewise.
21580 * frame.c (x_set_frame_parameters): Likewise.
21581 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21582 0 if not found, not -1. All callers changed.
21583
dd3f25f7
PE
21584 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21585 (stack_copy_size): Now size_t, not int.
21586 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21587
461c2ab9
JB
215882011-03-28 Juanma Barranquero <lekktu@gmail.com>
21589
21590 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21591 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21592 All callers changed.
21593
21594 * lisp.h (multibyte_char_to_unibyte):
21595 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21596 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21597 * character.h (CHAR_TO_BYTE8):
21598 * cmds.c (internal_self_insert):
21599 * editfns.c (general_insert_function):
21600 * keymap.c (push_key_description):
21601 * search.c (Freplace_match):
21602 * xdisp.c (message_dolog, set_message_1): All callers changed.
21603
f6d62986
SM
216042011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21605
21606 * keyboard.c (safe_run_hook_funcall): New function.
21607 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21608 don't set the hook to nil, but remove the offending function instead.
21609 (Qcommand_hook_internal): Remove, unused.
21610 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21611 Vcommand_hook_internal.
21612
21613 * eval.c (enum run_hooks_condition): Remove.
21614 (funcall_nil, funcall_not): New functions.
21615 (run_hook_with_args): Call each function through a `funcall' argument.
21616 Remove `cond' argument, now redundant.
21617 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21618 (Frun_hook_with_args_until_failure): Adjust accordingly.
21619 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21620
1db5b1ad
JB
216212011-03-28 Juanma Barranquero <lekktu@gmail.com>
21622
21623 * dispextern.h (string_buffer_position): Remove declaration.
21624
21625 * print.c (strout): Remove parameter `multibyte', unused since
21626 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21627
21628 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21629 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21630 All callers changed.
21631
21632 * w32.c (_wsa_errlist): Use braces for struct initializers.
21633
21634 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21635 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21636 All callers changed.
21637 (string_buffer_position): Likewise. Also, make static (it's never
21638 used outside xdisp.c).
21639 (cursor_row_p): Remove parameter `w', unused since
21640 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21641 (decode_mode_spec): Remove parameter `precision', introduced during
21642 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21643 All callers changed.
21644
5ffb62aa
JD
216452011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21646
21647 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21648
461c2ab9 216492011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
21650
21651 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21652 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21653 (ns_update_auto_hide_menu_bar): New functions.
21654 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21655 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21656 ns_constrain_all_frames.
21657 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21658 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21659
5c380ffb
JD
216602011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21661
21662 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21663
9af30bdf
GM
216642011-03-27 Glenn Morris <rgm@gnu.org>
21665
21666 * syssignal.h: Replace RETSIGTYPE with void.
21667 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21668 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21669 Replace SIGTYPE with void everywhere.
21670 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21671 * s/template.h (SIGTYPE): Remove commented out definition.
21672
e2abce01
JB
216732011-03-26 Eli Zaretskii <eliz@gnu.org>
21674
21675 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21676 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21677
f868cd8a
JB
216782011-03-26 Juanma Barranquero <lekktu@gmail.com>
21679
59eb0929
JB
21680 * w32.c (read_unc_volume): Use parameter `henum', instead of
21681 global variable `wget_enum_handle'.
21682
21683 * keymap.c (describe_vector): Remove parameters `indices' and
21684 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21685 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21686
f868cd8a
JB
21687 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21688
21689 * keyboard.c (timer_check): Remove parameter `do_it_now',
21690 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21691 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21692 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21693
21694 * keyboard.c (read_char):
21695 * w32menu.c (w32_menu_display_help):
21696 * xmenu.c (show_help_event, menu_help_callback):
21697 Adjust calls to `show_help_echo'.
21698
21699 * gtkutil.c (xg_maybe_add_timer):
21700 * keyboard.c (readable_events):
21701 * process.c (wait_reading_process_output):
21702 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21703
21704 * insdel.c (adjust_markers_gap_motion):
21705 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21706 (gap_left, gap_right): Don't call it.
21707
2ecf6fdb
CY
217082011-03-25 Chong Yidong <cyd@stupidchicken.com>
21709
21710 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21711 incurred during fontification.
21712
6b1f9ba4
JB
217132011-03-25 Juanma Barranquero <lekktu@gmail.com>
21714
21715 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21716 (DEFVAR_PER_BUFFER): Don't pass it.
21717
21718 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21719 (scrolling_window): Don't pass it.
21720
0f4a96b5
JB
217212011-03-25 Juanma Barranquero <lekktu@gmail.com>
21722
21723 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21724
21725 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21726 and `suffix'.
21727 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21728 of variables specific to SELinux and computation of `encoded_absname'.
21729
21730 * image.c (XPutPixel): Remove unused variable `height'.
21731
21732 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21733
21734 * unexw32.c (get_section_info): Remove unused variable `section'.
21735
21736 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21737 (system_process_attributes): Remove unused variable `sess'.
21738 (sys_read): Remove unused variable `err'.
21739
21740 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21741 (w32_wnd_proc): Remove unused variable `isdead'.
21742 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21743 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21744 (x_create_tip_frame): Remove unused variable `tem'.
21745
21746 * w32inevt.c (w32_console_read_socket):
21747 Remove unused variable `no_events'.
21748
21749 * w32term.c (x_draw_composite_glyph_string_foreground):
21750 Remove unused variable `width'.
21751
1149507c
JB
217522011-03-24 Juanma Barranquero <lekktu@gmail.com>
21753
21754 * w32term.c (x_set_glyph_string_clipping):
21755 Don't pass uninitialized region to CombineRgn.
21756
9c88f339
JB
217572011-03-23 Juanma Barranquero <lekktu@gmail.com>
21758
21759 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
21760 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
21761 (Fx_close_connection): Remove unused variable `i'.
21762
21763 * w32font.c (w32font_draw): Return number of glyphs.
21764 (w32font_open_internal): Remove unused variable `i'.
21765 (w32font_driver): Add missing initializer.
21766
21767 * w32menu.c (utf8to16): Remove unused variable `utf16'.
21768 (fill_in_menu): Remove unused variable `items_added'.
21769
21770 * w32term.c (last_mouse_press_frame): Remove static global variable.
21771 (w32_clip_to_row): Remove unused variable `f'.
21772 (x_delete_terminal): Remove unused variable `i'.
21773
21774 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
21775 (NOTHING): Remove unused static global variable.
21776 (uniscribe_check_otf): Remove unused variable `table'.
21777 (uniscribe_font_driver): Add missing initializers.
21778
dee091a3
JD
217792011-03-23 Julien Danjou <julien@danjou.info>
21780
21781 * term.c (Fsuspend_tty, Fresume_tty):
21782 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
21783 * window.c (temp_output_buffer_show):
21784 * insdel.c (signal_before_change):
21785 * frame.c (Fhandle_switch_frame):
21786 * fileio.c (Fdo_auto_save):
21787 * emacs.c (Fkill_emacs):
21788 * editfns.c (save_excursion_restore):
21789 * cmds.c (internal_self_insert):
21790 * callint.c (Fcall_interactively):
21791 * buffer.c (Fkill_all_local_variables):
21792 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
21793 Use Frun_hooks.
0f4a96b5 21794 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 21795 unconditionally since it does the check itself.
dee091a3 21796
2c520ab5 217972011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 21798
c9c49752
PE
21799 Fix more problems found by GCC 4.5.2's static checks.
21800
8abc3f12
PE
21801 * coding.c (encode_coding_raw_text): Avoid unnecessary test
21802 the first time through the loop, since we know p0 < p1 then.
21803 This also avoids a gcc -Wstrict-overflow warning.
21804
a2d26660
PE
21805 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
21806 leading to a memory leak, possible in functions like
21807 load_charset_map_from_file that can allocate an unbounded number
b12ef411 21808 of objects (Bug#8318).
a2d26660 21809
916c72e9
PE
21810 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
21811 that could (at least in theory) be that large.
21812
19ab8a18
PE
21813 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
21814 This is less likely to overflow, and avoids undefined behavior if
21815 overflow does occur. All callers changed. Use strtoul to scan
21816 for the unsigned long integer.
b7cbbd6f
PE
21817 (pint2hrstr): Simplify and tune code slightly.
21818 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 21819
f0641eff
PE
21820 * scroll.c (do_scrolling): Work around GCC bug 48228.
21821 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
21822
7f650bb9
PE
21823 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
21824 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
21825 (validate_x_resource_name): Simplify count usage.
21826 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 21827
37dd57d1
PE
21828 * fileio.c (Fcopy_file): Report error if fchown or fchmod
21829 fail (Bug#8306).
81e56e61 21830
699979fc 21831 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 21832
401bf9b4
PE
21833 * process.c (Fmake_network_process): Use socklen_t, not int,
21834 where POSIX says socklen_t is required in portable programs.
21835 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 21836 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
21837 (Fmake_network_process, server_accept_connection):
21838 (wait_reading_process_output, read_process_output):
21839 Likewise.
21840
b93aacde
PE
21841 * process.c: Rename or move locals to avoid shadowing.
21842 (list_processes_1, Fmake_network_process):
21843 (read_process_output_error_handler, exec_sentinel_error_handler):
21844 Rename or move locals.
4dc343ee 21845 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 21846 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 21847 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 21848 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 21849 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 21850
af8a867c 21851 Make tparam.h and terminfo.c consistent.
44f230aa
SM
21852 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21853 Include tparam.h instead, since it declares them.
af8a867c
PE
21854 * cm.h (PC): Remove extern decl; tparam.h now does this.
21855 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21856 * terminfo.c: Include tparam.h, to check interfaces.
21857 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21858 (tparam): Adjust signature to match interface in tparam.h;
21859 this removes some undefined behavior. Check that outstring and len
21860 are zero, which they always are with Emacs.
21861 * tparam.h (PC, BC, UP): New extern decls.
21862
0248044d 21863 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 21864 (xftfont_open): Rename locals to avoid shadowing.
0248044d 21865
8ff096c1 21866 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
21867 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21868 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 21869 (ftfont_list): Remove unused local.
49eaafba
PE
21870 (get_adstyle_property, ftfont_pattern_entity):
21871 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21872 Rename locals to avoid shadowing.
8ff096c1 21873
e2be39f6
PE
21874 * xfont.c (xfont_list_family): Mark var as initialized.
21875
c9735e30
PE
21876 * xml.c (make_dom): Now static.
21877
8f5201ae
PE
21878 * composite.c (composition_compute_stop_pos): Rename local to
21879 avoid shadowing.
b246f932
PE
21880 (composition_reseat_it): Remove unused locals.
21881 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 21882 (composition_update_it): Mark var as initialized.
11b61122
PE
21883 (find_automatic_composition): Mark vars as initialized,
21884 with a FIXME (Bug#8290).
8f5201ae 21885
760fbc2c
PE
21886 character.h: Rename locals to avoid shadowing.
21887 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21888 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21889 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21890 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21891 to avoid shadowing.
21892
ff08eb85
PE
21893 * textprop.c (property_change_between_p): Remove; unused.
21894
fc7bf025
PE
21895 * intervals.c (interval_start_pos): Now static.
21896
235d7abc
PE
21897 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
21898
44f230aa
SM
21899 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
21900 Rename locals to avoid shadowing.
3e7d6594 21901
50060332
PE
21902 * sound.c (wav_play, au_play, Fplay_sound_internal):
21903 Fix pointer signedness.
d01f234b 21904 (alsa_choose_format): Remove unused local var.
c83b8872
PE
21905 (wav_play): Initialize a variable to 0, to prevent undefined
21906 behavior (Bug#8278).
50060332 21907
c4fc4e30
PE
21908 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
21909
918436ed
PE
21910 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
21911
c939f91b
PE
21912 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
21913 clobbering (Bug#8298).
b9c7f648
PE
21914 * sysdep.c (sys_subshell): Likewise.
21915 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 21916
6bd8c144
PE
21917 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
21918 This should get cleaned up, so that child_setup has the
21919 same signature on all platforms.
21920
7710357c 21921 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 21922 (relocate_fd): Rename locals to avoid shadowing.
7710357c 21923
c59da222
CY
219242011-03-22 Chong Yidong <cyd@stupidchicken.com>
21925
21926 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
21927 not to be necessary, and produces flickering.
21928
66b87493
GM
219292011-03-20 Glenn Morris <rgm@gnu.org>
21930
21931 * config.in: Remove file.
21932
45b6f6d5
JB
219332011-03-20 Juanma Barranquero <lekktu@gmail.com>
21934
21935 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
21936 are now in src/globals.h.
21937 (syms_of_minibuf): Remove spurious & from previous change.
21938
cd394be1 219392011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
21940
21941 * minibuf.c (completing-read-function): New variable.
21942 (completing-read-default): Rename from completing-read.
21943 (completing-read): Call completing-read-function.
21944
b14e3e21
CY
219452011-03-19 Juanma Barranquero <lekktu@gmail.com>
21946
21947 * xfaces.c (Fx_load_color_file):
21948 Read color file from absolute filename (bug#8250).
21949
f2b726e6
JB
219502011-03-19 Juanma Barranquero <lekktu@gmail.com>
21951
21952 * makefile.w32-in: Update dependencies.
21953
09f6ff02
EZ
219542011-03-17 Eli Zaretskii <eliz@gnu.org>
21955
21956 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
21957
29a6015a
PE
219582011-03-17 Paul Eggert <eggert@cs.ucla.edu>
21959
a3a6c54e
PE
21960 Fix more problems found by GCC 4.5.2's static checks.
21961
b766f867
PE
21962 * process.c (make_serial_process_unwind, send_process_trap):
21963 (sigchld_handler): Now static.
21964
be02381c
PE
21965 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
21966 That way, the code declares only the vars that it needs.
21967 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
21968 * s/cygwin.h (PTY_ITERATION): Likewise.
21969 * s/darwin.h (PTY_ITERATION): Likewise.
21970 * s/gnu-linux.h (PTY_ITERATION): Likewise.
21971
57048744
PE
21972 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
21973 * process.c (allocate_pty): Don't declare stb unless it's needed.
21974
7914961c 21975 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
21976 (CONSTANTLIM): Remove; unused.
21977 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
21978 Define only if needed.
7914961c 21979
b3967b18
PE
21980 * unexelf.c (unexec): Name an expression,
21981 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
21982 Use a different way to cause a compilation error if anyone uses
21983 n rather than nn, a way that does not involve shadowing.
73366a00 21984 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 21985
29a6015a
PE
21986 * deps.mk (unexalpha.o): Remove; unused.
21987
43cfc33e 21988 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 21989 * unexec.h: New file.
ce701a33
PE
21990 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
21991 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
21992 Depend on unexec.h.
21993 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
21994 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
21995 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 21996 Change as necessary to match prototype in unexec.h.
ce701a33 21997
01f44d5a
PE
21998 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
21999 shadowing.
4f63c6bb 22000 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 22001
a6670b0b
PE
22002 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22003 Rename locals to avoid shadowing.
22004
cef2010d 22005 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 22006 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 22007
d4d7173a
PE
22008 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22009
f08b802a
PE
22010 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22011 warning when compiling print.c.
22012
3ddb0639
PE
22013 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22014 instead of using an uninitialized var.
5ad03b97 22015 (font_sort_entities): Mark var as initialized.
3ddb0639 22016
170a2692
PE
22017 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22018
e663c700
PE
22019 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22020 pointers to constants.
89bc529a 22021 (font_parse_fcname): Remove unused vars.
7b81e2d0 22022 (font_delete_unmatched): Now static.
ea838e10 22023 (font_get_spec): Remove; unused.
13a547c6
PE
22024 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22025 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22026 Rename or move locals to avoid shadowing.
e663c700 22027
2a80c887 22028 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 22029 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 22030
1384fa33 22031 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 22032 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 22033
8b2c52e9
PE
22034 * alloc.c (mark_backtrace): Move decl from here ...
22035 * lisp.h: ... to here, so that it can be checked.
22036
475545b5 22037 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 22038 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
22039 (lisp_indirect_variable): Name an expression,
22040 to avoid gcc -Wbad-function-cast warning.
1faed8ae 22041 (Fdefvar): Rename locals to avoid shadowing.
475545b5 22042
b1349114 22043 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 22044 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 22045 Use const pointer when appropriate.
b1349114 22046
a2928364
PE
22047 * lisp.h (get_system_name, get_operating_system_release):
22048 Move decls here, to check interfaces.
22049 * process.c (get_operating_system_release): Move decl to lisp.h.
22050 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
22051 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22052 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22053 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
22054 (Fformat_time_string, Fencode_time, Finsert_char):
22055 (Ftranslate_region_internal, Fformat):
22056 Rename or remove local vars to avoid shadowing.
9710023e 22057 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 22058
a415e694
PE
22059 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22060 avoid shadowing.
22061
8ef4622d
PE
22062 * lisp.h (eassert): Check that the argument compiles, even if
22063 ENABLE_CHECKING is not defined.
22064
946f9a5b
PE
22065 * data.c (Findirect_variable): Name an expression, to avoid
22066 gcc -Wbad-function-cast warning.
112396d6 22067 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 22068 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
22069 (Fmake_variable_buffer_local, Fmake_local_variable):
22070 Mark variables as initialized.
52746918 22071 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 22072
e5aab7e7 22073 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
22074 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22075 Rename locals to avoid shadowing.
dff45157
PE
22076 (mark_stack): Move local variables into the #ifdef region where
22077 they're used.
7bc26fdb
PE
22078 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22079 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22080 needed otherwise.
22081 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22082 (GC_STRING_CHARS): Remove; not used.
d40d4be1 22083 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 22084
e5aab7e7
PE
22085 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22086 avoids undefined behavior in theory.
22087
4da60324
PE
22088 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22089
88043301
PE
22090 Use functions, not macros, for up- and down-casing (Bug#8254).
22091 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22092 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22093 to use the following functions instead of these macros.
22094 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22095 EMACS_INT, since callers assume the returned value fits in int.
22096 (upcase1): Likewise, for UPCASE_TABLE.
22097 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 22098 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 22099 the race-condition problem in the old DOWNCASE.
88043301 22100
19ed5445
PE
22101 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22102 Rename locals to avoid shadowing.
22103 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
22104 (regex_compile, re_search_2, re_match_2_internal):
22105 Remove unused local vars.
952db0d7
PE
22106 (FREE_VAR): Rewrite so as not to use empty "else",
22107 which gcc can warn about.
da053e48 22108 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
22109 (RETALLOC_IF): Define only if needed.
22110 (WORDCHAR_P): Likewise. This one is never needed, but is used
22111 only in a comment talking about a compiler bug, so put inside
22112 the #if 0 of that comment.
22113 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22114 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22115 Remove; unused.
19ed5445 22116
1f3561e4 22117 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
22118 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22119 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 22120
ded6f8f7
PE
22121 * search.c (simple_search): Remove unused var.
22122
dbd37a95
PE
22123 * dired.c (compile_pattern): Move decl from here ...
22124 * lisp.h: ... to here, so that it can be checked.
22125 (struct re_registers): New forward decl.
22126
7e47afad
PE
22127 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22128
85f24f61
PE
22129 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22130 All uses changed.
22131 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22132 Rename locals to avoid shadowing.
5671df8f 22133 (Fvertical_motion): Mark locals as initialized.
85f24f61 22134
181aa2be 22135 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 22136 (casify_region): Mark local as initialized.
181aa2be 22137
930d429c
PE
22138 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22139
7082eac6
PE
22140 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22141 New macros, so that the caller can use some names other than
22142 gcpro1, gcpro2, etc.
22143 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22144 of the new macros.
22145 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22146 argument, for consistency with GCPRO2_VAR, etc: it is now the
22147 prefix of the variable, not the variable itself. All uses
22148 changed.
38b2c076
PE
22149 * dired.c (directory_files_internal, file_name_completion):
22150 Rename locals to avoid shadowing.
22151
15206ed9
PE
22152 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22153 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22154 dired.c's scmp function, had undefined behavior.
22155 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22156 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22157 * buffer.h: ... to here, because these macros use current_buffer,
22158 and the new implementation with inline functions needs to have
22159 current_buffer in scope now, rather than later when the macros
22160 are used.
22161 (downcase, upcase1): New static inline functions.
22162 (DOWNCASE, UPCASE1): Reimplement using these functions.
22163 This avoids undefined behavior in expressions like
22164 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22165 from race conditions in accessing the global variables
22166 case_temp1 and case_temp2.
22167 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22168 * lisp.h (case_temp1, case_temp2): Remove their decls.
22169 * character.h (ASCII_CHAR_P): Move from here ...
22170 * lisp.h: ... to here, so that the inline functions mentioned
22171 above can use them.
22172
4a6bea26
PE
22173 * dired.c (directory_files_internal_unwind): Now static.
22174
f14b7e14
PE
22175 * fileio.c (file_name_as_directory, directory_file_name):
22176 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22177 Now static.
2893f146
PE
22178 (file_name_as_directory): Use const pointers when appropriate.
22179 (Fexpand_file_name): Likewise. In particular, newdir might
22180 point at constant storage, so make it a const pointer.
fd4ead52 22181 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
22182 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22183 signedness issues.
f839df0c
PE
22184 (Fset_file_times, Finsert_file_contents, auto_save_error):
22185 Rename locals to avoid shadowing.
f14b7e14 22186
5716756e 22187 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
22188 (Ftry_completion, Fall_completions): Rename or remove locals
22189 to avoid shadowing.
5716756e 22190
b4c3046a
PE
22191 * marker.c (bytepos_to_charpos): Remove; unused.
22192
b45db522
PE
22193 * lisp.h (verify_bytepos, count_markers): New decls,
22194 so that gcc does not warn that these functions aren't declared.
22195
85876d07
PE
22196 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22197 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 22198 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 22199 (copy_text): Remove unused local var.
85876d07 22200
03d78a21 22201 * filelock.c (within_one_second): Now static.
b3dd38ab 22202 (lock_file_1): Rename local to avoid shadowing.
03d78a21 22203
5df8f01b
PE
22204 * buffer.c (fix_overlays_before): Mark locals as initialized.
22205 (fix_start_end_in_overlays): Likewise. This function should be
22206 simplified by using pointers-to-pointers, but that's a different
22207 matter.
b1d876f1 22208 (switch_to_buffer_1): Now static.
8f54f30a
PE
22209 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22210 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 22211
a70072c9 22212 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 22213 Fix pointer signedness issue.
edced198
PE
22214 (sys_subshell): Mark local as volatile if checking for lint,
22215 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 22216 (MAXPATHLEN): Define only if needed.
a70072c9 22217
a0977c44
PE
22218 * process.c (serial_open, serial_configure): Move decls from here ...
22219 * systty.h: ... to here, so that they can be checked.
22220
a884fdcc
PE
22221 * fns.c (get_random, seed_random): Move extern decls from here ...
22222 * lisp.h: ... to here, so that they can be checked.
22223
604efe86 22224 * sysdep.c (reset_io): Now static.
b8950c94 22225 (wait_for_termination_signal): Remove; unused.
604efe86 22226
38fc62d9
PE
22227 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22228 (copy_keymap_item, append_key, push_text_char_description):
22229 Now static.
1004a21a 22230 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 22231 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
22232 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22233 (describe_map_tree):
22234 Rename locals to avoid shadowing.
38fc62d9 22235
2f2650da
PE
22236 * keyboard.c: Declare functions static if they are not used elsewhere.
22237 (echo_char, echo_dash, cmd_error, top_level_2):
22238 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
22239 (read_char, kbd_buffer_get_event, make_lispy_position):
22240 (make_lispy_event, make_lispy_movement, apply_modifiers):
22241 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22242 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22243 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 22244 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 22245 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 22246
a053e86c 22247 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
22248 (mark_kboards): Move decl here ...
22249 * alloc.c (mark_kboards): ... from here.
a053e86c 22250
4752793e
PE
22251 * lisp.h (force_auto_save_soon): New decl.
22252
74f10ca7 22253 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
22254 (DEFINE_DUMMY_FUNCTION): New macro.
22255 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22256 Use it.
c03cd23f
PE
22257 (main): Add casts to avoid warnings
22258 if GCC considers string literals to be constants.
74f10ca7 22259
022e70d4
PE
22260 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22261
59d6fe83
PE
22262 * dbusbind.c: Pointer signedness fixes.
22263 (xd_signature, xd_append_arg, xd_initialize):
22264 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22265 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22266 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22267 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22268
78320123
PE
22269 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22270 if GCC considers string literals to be constants.
49cebcca 22271 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 22272
35ac2a97
SM
222732011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22274
fb103ca9
SM
22275 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22276 (print_preprocess, print_object): New macro to fix last change.
22277
35ac2a97
SM
22278 * print.c (print_preprocess): Don't forget font objects.
22279
62973b41
JB
222802011-03-16 Juanma Barranquero <lekktu@gmail.com>
22281
22282 * emacs.c (USAGE3): Doc fixes.
22283
0e48bb22
AS
222842011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22285
22286 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22287 structure.
22288
7684e57b
JB
222892011-03-14 Juanma Barranquero <lekktu@gmail.com>
22290
22291 * lisp.h (VWindow_system, Qfile_name_history):
22292 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22293 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22294 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22295
22296 * w32select.c: Don't #include "keyboard.h".
c96bbc66 22297 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
22298
22299 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22300 * w32console.c (detect_input_pending, read_input_pending)
22301 (encode_terminal_code):
22302 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22303 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22304 (w32_system_caret_y, Qfile_name_history):
22305 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22306 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22307 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22308 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22309 * w32proc.c (Qlocal, report_file_error):
22310 * w32term.c (Vwindow_system, updating_frame):
22311 * w32uniscribe.c (initialized, uniscribe_font_driver):
22312 Remove unneeded extern declarations.
22313
2aa46d6c
CY
223142011-03-14 Chong Yidong <cyd@stupidchicken.com>
22315
c96bbc66 22316 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 22317
cffc6f3b
CY
223182011-03-13 Chong Yidong <cyd@stupidchicken.com>
22319
22320 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22321 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22322 These macros can no longer be used for assignment.
22323
44f230aa
SM
22324 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22325 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
22326 (record_buffer_markers, fetch_buffer_markers): New functions for
22327 recording and fetching special buffer markers.
22328 (set_buffer_internal_1, set_buffer_temp): Use them.
22329
22330 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22331
22332 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22333
22334 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22335 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22336
22337 * xdisp.c (hscroll_window_tree):
22338 (reconsider_clip_changes): Use PT instead of BUF_PT.
22339
d251f04b
EZ
223402011-03-13 Eli Zaretskii <eliz@gnu.org>
22341
22342 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22343 $(EMACS_ROOT)/lib/intprops.h.
22344
f0c77cd1
PE
223452011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22346
3eca4629
PE
22347 Fix more problems found by GCC 4.5.2's static checks.
22348
7c86ee98
PE
22349 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22350 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
22351 (xg_free_frame_widgets): Make it clear that a local variable is
22352 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
22353 (gdk_window_get_screen): Make it clear that this macro is needed
22354 only if USE_GTK_TOOLTIP.
1e5524e7
PE
22355 (int_gtk_range_get_value): New function, which avoids a diagnostic
22356 from gcc -Wbad-function-cast.
22357 (xg_set_toolkit_scroll_bar_thumb): Use it.
22358 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22359 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
22360 (get_utf8_string, xg_get_file_with_chooser):
22361 Rename locals to avoid shadowing.
22362 (create_dialog): Move locals to avoid shadowing.
7c86ee98 22363
41729b81
PE
22364 * xgselect.c (xg_select): Remove unused var.
22365
f0c77cd1
PE
22366 * image.c (four_corners_best): Mark locals as initialized.
22367 (gif_load): Initialize transparent_p to zero (Bug#8238).
22368 Mark another local as initialized.
ec6cf4c6 22369 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 22370
ce0ad53d 22371 * image.c (clear_image_cache): Now static.
d5d5a617 22372 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 22373 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
22374 (x_edge_detection): Remove unnecessary cast that
22375 gcc -Wbad-function-cast diagnoses.
2037898d 22376 (gif_load): Fix pointer signedness.
6ae141d6
PE
22377 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22378 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 22379
33383987 223802011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 22381
d32df629
PE
22382 Improve quality of tests for time stamp overflow.
22383 For example, without this patch (encode-time 0 0 0 1 1
22384 1152921504606846976) returns the obviously-bogus value (-948597
22385 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22386 reports time overflow. See
22387 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
22388 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22389 * editfns.c: Include limits.h and intprops.h.
22390 (TIME_T_MIN, TIME_T_MAX): New macros.
22391 (time_overflow): Move earlier, to before first use.
22392 (hi_time, lo_time): New functions, for an accurate test for
22393 out-of-range times.
22394 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22395 (Fget_internal_run_time): Don't assume time_t fits in int.
22396 (make_time): Use list2 instead of Fcons twice.
22397 (Fdecode_time): More accurate test for out-of-range times.
22398 (check_tm_member): New function.
22399 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
22400 (lisp_time_argument): Don't rely on undefined left-shift and
22401 right-shift behavior when checking for time stamp overflow.
8be6f318 22402
fe31d94c
PE
22403 * editfns.c (time_overflow): New function, refactoring common code.
22404 (Fformat_time_string, Fdecode_time, Fencode_time):
22405 (Fcurrent_time_string): Use it.
22406
8be6f318
PE
22407 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22408 * dired.c (make_time): Move to ...
22409 * editfns.c (make_time): ... here.
22410 * systime.h: Note the move.
22411
09d9db2c 224122011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 22413
126bc0dc
YM
22414 * fringe.c (update_window_fringes): Remove unused variables.
22415
c47cbdfd
YM
22416 * unexmacosx.c (copy_data_segment): Also copy __got section.
22417 (Bug#8223)
22418
7ac80be9
EZ
224192011-03-12 Eli Zaretskii <eliz@gnu.org>
22420
c96bbc66 22421 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
22422 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22423 Constify `char *' arguments and their references according to
22424 prototypes in tparam.h.
22425
ecb0f94d 22426 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 22427
7ac80be9
EZ
22428 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22429 Adapt all references accordingly.
22430
22431 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22432
ef1fd07e
TT
224332011-03-11 Tom Tromey <tromey@redhat.com>
22434
22435 * buffer.c (syms_of_buffer): Remove obsolete comment.
22436
7ef4b50c
EZ
224372011-03-11 Eli Zaretskii <eliz@gnu.org>
22438
22439 * termhooks.h (encode_terminal_code): Declare prototype.
22440
22441 * msdos.c (encode_terminal_code): Don't declare prototype.
22442
22443 * term.c (encode_terminal_code): Now external again, used by
22444 w32console.c and msdos.c.
22445
44f230aa
SM
22446 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22447 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 22448
4b1ec863 224492011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 22450
1714f52b 22451 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 22452
4b1ec863
PE
22453 * fringe.c (update_window_fringes): Mark locals as initialized
22454 (Bug#8227).
22455 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 22456
524c7aa6
PE
22457 * alloc.c (mark_fringe_data): Move decl from here ...
22458 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22459 to check its interface.
22460 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22461
a5c0af81 22462 * fontset.c (free_realized_fontset): Now static.
7519b8cd 22463 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 22464 (fontset_font): Mark local as initialized.
a9a06e0b 22465 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 22466
b4716021
PE
22467 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22468
811e9bac 22469 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 22470 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
22471 (x_own_selection, Fx_disown_selection_internal): Rename locals
22472 to avoid shadowing.
22473 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 22474
7e3ab302
PE
22475 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22476 so that the caller can use some name other than gcpro1.
22477 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
22478 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22479 (Fx_backspace_delete_keys_p):
22480 Use them to avoid shadowing, and rename vars to avoid shadowing.
22481 (x_decode_color, x_set_name, x_window): Now static.
6b437900 22482 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 22483 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
22484 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22485 Remove unused locals.
7e3ab302
PE
22486 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22487 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22488 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22489 macros.
f78faa98 22490
e2b13473
PE
22491 * xterm.h (x_mouse_leave): New decl.
22492
77f23912
PE
22493 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22494 Remove unused functions.
cdf4ba58
PE
22495 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22496 (x_calc_absolute_position): Now static.
7411c686 22497 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 22498 Don't declare local "event" unless it's used.
ed7bf3a5
PE
22499 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22500 unless they are used.
38d0b34a
PE
22501 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22502 (x_fatal_error_signal): Remove; not used.
a6067996
PE
22503 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22504 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22505 (x_error_catcher, x_connection_closed, x_error_handler):
22506 (x_error_quitter, xembed_send_message, x_iconify_frame):
22507 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 22508 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 22509 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 22510
44f230aa
SM
22511 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22512 Rename or move locals to avoid shadowing.
6b463e58 22513 (tty_defined_color, merge_face_heights): Now static.
5967d051 22514 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
22515 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22516 does not deduce is never used uninitialized.
73719eba
PE
22517 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22518 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 22519
426994c3 22520 * terminal.c (store_terminal_param): Now static.
5489860b 22521
032f1620 22522 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 22523 (set_frame_menubar): Remove unused local.
d4323972 22524 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
22525 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22526 since they might point to immutable storage.
281585b0
PE
22527 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22528 since it's unused otherwise.
032f1620 22529
367c19e5 22530 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 22531 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
22532 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22533 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 22534 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
22535 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22536 does not deduce are never used uninitialized.
70739cbe 22537
07b48fa9
PE
22538 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22539
8868a238 22540 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
22541 * window.c (window_loop, size_window):
22542 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 22543
7e5cf297 22544 * window.c (display_buffer): Now static.
d6550a9f
PE
22545 (size_window): Mark variables that gcc -Wuninitialized
22546 does not deduce are never used uninitialized.
a586633d
PE
22547 * window.h (check_all_windows): New decl, to forestall
22548 gcc -Wmissing-prototypes diagnostic.
5b555da1 22549 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 22550
f6095868
PE
22551 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22552 shadowing.
22553 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
22554 Include <limits.h>.
22555 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22556 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
22557 (load_charset_map): Mark variables that gcc -Wuninitialized
22558 does not deduce are never used uninitialized.
53df7c11 22559 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 22560
f38b440c
PE
22561 * coding.c (coding_set_source, coding_set_destination):
22562 Use "else { /* comment */ }" rather than "else /* comment */;"
22563 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
22564 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22565 a block, when the outer 'i' will do.
22566 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22567 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22568 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22569 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22570 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22571 Rename locals to avoid shadowing.
22572 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
22573 * coding.c (emacs_mule_char, encode_invocation_designation):
22574 Now static, since they're not used elsewhere.
413bb2db 22575 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 22576 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
22577 (decode_coding_emacs_mule): Mark variables that gcc
22578 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
22579 (detect_coding_iso_2022): Initialize a local variable that might
22580 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 22581 this initialization is needed. (Bug#8211)
5f58e762
PE
22582 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22583 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22584 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22585 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22586 Remove unused macros.
f38b440c 22587
232b38b9 22588 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 22589 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 22590 * character.c (string_count_byte8): Likewise.
232b38b9 22591
fb90da1b
PE
22592 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22593 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22594
fb93dbc2
PE
22595 * chartab.c (copy_sub_char_table): Now static, since it's not used
22596 elsewhere.
5c156ace
PE
22597 (sub_char_table_ref_and_range, char_table_ref_and_range):
22598 Rename locals to avoid shadowing.
bbcd0949 22599 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 22600
7d3b3862 22601 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 22602 (BIDI_BOB): Remove unused macro.
7d3b3862 22603
6be7d3da
PE
22604 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22605 deduce are never used uninitialized.
c2ed9c8b 22606 * term.c (encode_terminal_code): Likewise.
6be7d3da 22607
75f8807f 22608 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 22609
50938595
PE
22610 * tparam.h: New file.
22611 * term.c, tparam.h: Include it.
22612 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22613 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22614 Move these decls to tparam.h, and make them agree with what
22615 is actually in tparam.c. The previous trick of using incompatible
22616 decls in different modules does not conform to the C standard.
22617 All callers of tparam changed to use tparam's actual API.
22618 * tparam.c (tparam1, tparam, tgoto):
22619 Use const pointers where appropriate.
22620
fbceeba2
PE
22621 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22622 * cm.h (struct cm): Likewise.
22623 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22624 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22625 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22626 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22627 (turn_on_face, init_tty): Likewise.
22628 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 22629
7f3f1250
PE
22630 * term.c (term_mouse_position): Rename local to avoid shadowing.
22631
e6ca6543
PE
22632 * alloc.c (mark_ttys): Move decl from here ...
22633 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22634
c40f8d15
AS
226352011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22636
22637 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22638
cfe0661d
JB
226392011-03-09 Juanma Barranquero <lekktu@gmail.com>
22640
22641 * search.c (compile_pattern_1): Remove argument regp, unused since
22642 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22643 (compile_pattern): Don't pass it.
22644
0afb4571
J
226452011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22646
22647 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22648 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22649 for ! HAVE_GTK3.
22650 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22651
22652 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22653
22654 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22655 gdk_window_get_screen, gdk_window_get_geometry,
22656 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22657 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22658 (xg_get_pixbuf_from_pixmap): New function.
22659 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22660 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22661 Call xg_get_pixbuf_from_pixmap instead of
22662 gdk_pixbuf_get_from_drawable.
22663 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22664 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22665 (xg_check_special_colors): Use GtkStyleContext and its functions
22666 for HAVE_GTK3.
22667 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22668 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22669 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
22670 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22671 Call gtk_widget_get_preferred_size.
0afb4571
J
22672 (xg_frame_resized): gdk_window_get_geometry only takes 5
22673 parameters.
44f230aa
SM
22674 (xg_win_to_widget, xg_event_is_for_menubar):
22675 Call gdk_x11_window_lookup_for_display.
0afb4571
J
22676 (xg_set_widget_bg): New function.
22677 (delete_cb): New function.
895009e1 22678 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 22679 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
22680 (xg_set_background_color): Call xg_set_widget_bg.
22681 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22682 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22683 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22684 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22685 if ! HAVE_GTK3.
22686 (update_frame_tool_bar): Call gtk_widget_hide.
22687 (xg_initialize): Use GDK_KEY_g.
22688
22689 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22690 if ! HAVE_GTK3
22691 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22692
22693 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22694 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22695 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22696
1c2cc4ef
JB
226972011-03-08 Juanma Barranquero <lekktu@gmail.com>
22698
22699 * w32xfns.c (select_palette): Check success of RealizePalette against
22700 GDI_ERROR, not zero.
22701
33383987 22702See ChangeLog.11 for earlier changes.
aac0c6e3
MR
22703
22704;; Local Variables:
22705;; coding: utf-8
aac0c6e3
MR
22706;; End:
22707
ab422c4d 22708 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
22709
22710 This file is part of GNU Emacs.
22711
22712 GNU Emacs is free software: you can redistribute it and/or modify
22713 it under the terms of the GNU General Public License as published by
22714 the Free Software Foundation, either version 3 of the License, or
22715 (at your option) any later version.
22716
22717 GNU Emacs is distributed in the hope that it will be useful,
22718 but WITHOUT ANY WARRANTY; without even the implied warranty of
22719 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22720 GNU General Public License for more details.
22721
22722 You should have received a copy of the GNU General Public License
22723 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.