* notes/unicode: Add notes about Emacs source file encoding.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
725eb027
PE
12013-03-05 Paul Eggert <eggert@cs.ucla.edu>
2
a318f811
PE
3 Fix a build failure on OpenBSD 4.x and MirBSD.
4 * sysdep.c (KERN_PROC, kinfo_proc)
5 [BSD_SYSTEM && (!KERN_PROC || __MirBSD__)]:
6 Define to KERN_PROC2 and kinfo_proc2, for OpenBSD 4.9 and MirBSD.
725eb027
PE
7 list-system-processes still returns nil, but at least it doesn't crash.
8 Problem reported by Nelson H. F. Beebe in
9 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>.
10
3bfc46eb
DA
112013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
12
13 * composite.c (get_composition_id, fill_gstring_header):
14 Use make_uninit_vector where appropriate.
15 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
16 * xselect.c (clean_local_selection_data): Likewise.
17
84ac6f9d
PE
182013-03-04 Paul Eggert <eggert@cs.ucla.edu>
19
20 Fix misuse of ImageMagick that caused core dump (Bug#13846).
21 * image.c (imagemagick_load_image): Calculate height and width
22 after flattening the image, not before.
23
42926ec8
DA
242013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
25
26 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
27 * ftfont.c (ftfont_shape_by_flt): Likewise.
28 * w32uniscribe.c (uniscribe_shape): Likewise.
29
b5029e23
PE
302013-03-02 Paul Eggert <eggert@cs.ucla.edu>
31
32 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
33 The old approach, which fell back on DIR/.#FILE.0 through
34 DIR/.#FILE.9, had race conditions that could not be easily fixed.
35 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
36 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
37 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
38 because the locking mechanism was never reliable in that case).
39 This patch fixes this and other bugs discovered by a code
40 inspection that was prompted by
41 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
42 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
43 to avoid interoperability problems between the MS-Windows and
44 non-MS-Windows implementations. MS-Windows and non-MS-Windows
45 instances of Emacs now ignore each others' locks.
46 * filelock.c (defined_WINDOWSNT): New constant.
47 (MAKE_LOCK_NAME, fill_in_lock_file_name):
48 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
49 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
50 regular files on MS-Windows hosts.
51 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
52 Use SAFE_ALLOCA to avoid problems with long file names.
53 (MAX_LFINFO): Now a local constant, not a global macro.
54 (IS_LOCK_FILE): Remove.
55 (lock_file_1): Don't inspect errno if symlink call succeeds;
56 that's not portable.
57 (lock_file): Document that this function can return if lock
58 creation fails.
2db41375 59 (lock_file): Don't access freed storage.
b5029e23 60
b270d116
AS
612013-03-02 Andreas Schwab <schwab@linux-m68k.org>
62
63 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
64
81c23309
PE
652013-03-02 Paul Eggert <eggert@cs.ucla.edu>
66
67 * textprop.c: Use bool for booleans.
68 (validate_interval_range, Fadd_text_properties)
69 (Fremove_text_properties): Prefer bool to int when either works.
70
18f2ac09
EZ
712013-03-02 Eli Zaretskii <eliz@gnu.org>
72
73 * textprop.c (Fadd_text_properties, Fremove_text_properties): If
74 the interval tree changes as a side effect of calling
75 modify_region, re-do processing starting from the call to
76 validate_interval_range. (Bug#13743)
77
929aeac6 782013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
79
80 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
81 (Bug#13546).
82
531e70ec
EZ
832013-02-27 Eli Zaretskii <eliz@gnu.org>
84
85 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
86 _SH_DENYRW flag, instead of emacs_open, to deny any other process
87 access to the lock file until it is written and closed.
88 (Bug#13807)
89
6e65b9cc
PE
902013-02-27 Paul Eggert <eggert@cs.ucla.edu>
91
92 * callint.c (Qcall_interactively):
93 * macros.c (Qexecute_kbd_macro):
94 Now static.
95
3b166f09
BG
962013-02-26 Bastien Guerry <bzg@gnu.org>
97
98 * window.c (Frecenter): Tiny docstring enhancement.
99
ecc0fdd4
PE
1002013-02-26 Paul Eggert <eggert@cs.ucla.edu>
101
102 Minor textprop integer cleanup.
103 * intervals.h, textprop.c (add_text_properties_from_list):
104 Return void, not int, since nobody uses the return value.
105 * textprop.c (validate_plist, add_properties, remove_properties)
106 (Fadd_text_properties):
107 Don't assume list length fits in int.
108 (interval_has_all_properties, interval_has_some_properties)
109 (interval_has_some_properties_list, add_properties, remove_properties)
110 (Fadd_text_properties, Fremove_text_properties)
111 (Fremove_list_of_text_properties, text_property_stickiness):
112 Use bool for booleans.
113 (Fadd_text_properties, Fremove_text_properties):
114 (Fremove_list_of_text_properties):
115 Reindent do-while as per GNU style.
116
0248b0d7
EZ
1172013-02-25 Eli Zaretskii <eliz@gnu.org>
118
343a2aef
EZ
119 Implement CLASH_DETECTION for MS-Windows.
120
121 * filelock.c [WINDOWSNT]: Include w32.h.
122 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
123 function of that name. Up-case the macro arguments.
124 (IS_LOCK_FILE): New macro.
125 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
126 (create_lock_file): New function, with body extracted from
127 lock_file_1.
128 [WINDOWSNT]: Implement lock files by writing a regular file with
129 the lock information as its contents.
130 (read_lock_data): New function, on Posix platforms just calls
131 emacs_readlinkat.
132 [WINDOWSNT]: Read the lock info from the file.
133 (current_lock_owner): Call read_lock_data instead of calling
134 emacs_readlinkat directly.
135 (lock_file) [WINDOWSNT]: Run the file name through
136 dostounix_filename.
137
138 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
139 just check if the process by that PID exists.
140
141 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
142 also present, as doing so will fail to error out if the file
143 already exists.
144
145 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
146
0248b0d7
EZ
147 * textprop.c (Fadd_text_properties, Fremove_text_properties)
148 (Fremove_list_of_text_properties): Skip all of the intervals in
149 the region between START and END that already have resp. don't
150 have the requested properties, not just the first one. Add
151 assertions that the loop afterwards always modifies the
152 properties. (Bug#13743)
153
b5071fc7
SM
1542013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
155
156 * callint.c (Fcall_interactively): Use the right lexical environment
157 for `interactive' specs (bug#13811).
158 * eval.c (Feval): Accept a lexical environment.
159
1ddc2bd6
PE
1602013-02-25 Paul Eggert <eggert@cs.ucla.edu>
161
162 Simplify data_start configuration (Bug#13783).
163 This is a followon simplification to the fix for Bug#13650.
164 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
165 (START_FILES): Remove. All uses removed.
166 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
167 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
168 (buildobj.h): Use it.
169 ($(ALLOBJS)): Depend on globals.h.
170 (temacs$(EXEEXT)): Use $(ALLOBJS).
171 * autodeps.mk (ALLOBJS): Move to Makefile.in.
172 * deps.mk (vm-limit.o):
173 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
174 Do not depend on mem-limits.h.
175 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
176 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
177 [__GNUC__ && !ORDINARY_LINK]: Remove.
178 * mem-limits.h, pre-crt0.c: Remove.
179 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
180 * unexcoff.c (etext): New decl.
181 (make_hdr): Use DATA_START instead of start_of_data.
182 * vm-limit.c: Move most of mem-limits.h's contents here.
183 (data_start): New decl. It's OK if this is approximate,
184 so simplify-away some unnecessary exactness.
185 (POINTER): Remove; all uses removed.
186 (data_space_start): Now char *, to avoid casts.
187 (exceeds_lisp_ptr): New function, replacing the old
188 EXCEEDS_LISP_PTR macro. All uses changed.
189 (check_memory_limits): Simplify and remove casts.
190 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
191 (memory_warnings): Use data_start instead of start_of_data.
192
51aa2a8b
AS
1932013-02-24 Andreas Schwab <schwab@linux-m68k.org>
194
195 * xdisp.c (set_message): Only check for debug-on-message if STRING
196 is a string. (Bug#13797)
197
1938d88c
PE
1982013-02-24 Paul Eggert <eggert@cs.ucla.edu>
199
200 Fix regression introduced by July 10 filelock.c patch.
201 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
202 2012-07-10 patch to this file. Reported by Eli Zaretskii in
203 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
204 and diagnosed by Andreas Schwab in
205 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
206
fcee5028
PE
2072013-02-22 Paul Eggert <eggert@cs.ucla.edu>
208
209 Assume C89 or better.
210 * ralloc.c (SIZE, POINTER, NIL):
211 * vm-limit.c (POINTER):
212 Remove, replacing all uses with C89 equivalents. These old
213 symbols were present only for porting to pre-C89 platforms.
214
d78cf5ed
CB
2152013-02-22 Claudio Bley <claudio.bley@gmail.com>
216
217 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
218 This avoids warning messages reported as part of Bug#13546.
219
6bcd97a4
KB
2202013-02-21 Ken Brown <kbrown@cornell.edu>
221
222 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
223
b6c2bfff
SM
2242013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
225
e11dacb5
SM
226 * sheap.c (report_sheap_usage): Prefer message1_nolog.
227
b6c2bfff
SM
228 * keyboard.c (Qcommand_execute): New var.
229 (command_loop_1, read_char): Use it.
230 (Fcommand_execute): Remove, replace by an Elisp implementation.
231 (syms_of_keyboard): Adjust accordingly.
232
d69f1120 2332013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 234
d69f1120
DC
235 * sheap.c (report_sheap_usage): Use message, not message1, so
236 that we don't try to create a buffer while we're in the middle
237 of dumping Emacs. Explain why.
b6c2bfff 238
2a14a4f1 2392013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 240
2a14a4f1
DA
241 * search.c (find_newline): Return byte position in bytepos.
242 Adjust comment.
b6c2bfff
SM
243 (find_next_newline_no_quit, find_before_next_newline):
244 Add bytepos argument.
2a14a4f1
DA
245 * lisp.h (find_newline, find_next_newline_no_quit)
246 (find_before_next_newline): Adjust prototypes.
247 * bidi.c (bidi_find_paragraph_start):
248 * editfns.c (Fconstrain_to_field, Fline_end_position):
249 * indent.c (compute_motion, vmotion):
250 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
251 (get_visually_first_element, move_it_vertically_backward):
252 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
253
872faefb 2542013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
255
256 * w32proc.c (new_child): Avoid leaking handles if the subprocess
257 resources were not orderly released.
258
fd80c659
EZ
2592013-02-17 Eli Zaretskii <eliz@gnu.org>
260
261 * xdisp.c (x_draw_vertical_border): For a window that is neither
262 the leftmost nor the rightmost, redraw both the left and the right
263 vertical borders. (Bug#13723)
264
2f73da9c
SM
2652013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
266
267 * xml.c (init_libxml2_functions):
268 * sound.c (sound_warning):
269 * sheap.c (report_sheap_usage):
270 * process.c (wait_reading_process_output):
271 * msdos.c (XMenuActivate):
272 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
273 * keyboard.c (top_level_1):
274 * editfns.c (Fmessage, Fmessage_box):
275 * callint.c (Fcall_interactively):
276 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
277
fd9547e8
JD
2782013-02-17 Jan Djärv <jan.h.d@swipnet.se>
279
280 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
281 * frame.c (syms_of_frame): ... to here.
282
f277993b
EZ
2832013-02-16 Eli Zaretskii <eliz@gnu.org>
284
c7939585
EZ
285 * w32.c (sys_chown): Remove unused function.
286
cd91fb4b
EZ
287 * w32term.c <input_signal_count>: Declare 'volatile'
288 unconditionally. (Bug#9066)
289
f277993b
EZ
290 * w32.c (set_errno): Reset h_errno and don't set it to any other
291 value. Set errno instead.
292 (check_errno): Reset h_errno.
293 (sys_socket, socket_to_fd, sys_bind, sys_connect)
294 (sys_gethostname, sys_getservbyname, sys_getpeername)
295 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
296 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
297 h_errno.
298 (sys_gethostbyname): Set h_errno only errors detected.
299
e454145b
PE
3002013-02-15 Paul Eggert <eggert@cs.ucla.edu>
301
302 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
303
bcf7fe2a
EZ
3042013-02-15 Eli Zaretskii <eliz@gnu.org>
305
ef9c57e2
EZ
306 * keyboard.c (read_char): Fix calculation of auto-save time out
307 when auto-save-timeout is less than 4. (Bug#13720)
308
ef862e20 309 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 310 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 311
bcf7fe2a
EZ
312 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
313 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
314 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
315 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
316 make sure errno is set to an appropriate value. (Bug#13546)
317 (socket_to_fd): Add assertion against indexing fd_info[] with a
318 value that is out of bounds.
319 (sys_accept): If fd is negative, do not set up the child_process
320 structure for reading.
321
0063fdb1
DA
3222013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
323
324 * composite.c (fill_gstring_header): Remove useless prototype.
325 Break long line.
326 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
327 * print.c (PRINTDECLARE, print_object):
328 * search.c (compile_pattern, fast_looking_at, search_buffer):
329 (simple_search, boyer_moore, Freplace_match):
330 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
331 (get_overlay_arrow_glyph_row, display_mode_element):
332 (decode_mode_spec_coding, message3):
333 * xfaces.c (face_at_string_position): Use bool for booleans.
334 Adjust comments.
335
648e5523 3362013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 337
35b3a27e
PE
338 Fix AIX port (Bug#13650).
339 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
340 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
341 was #undeffed earlier, so it cannot be used as a macro here.
342 Use the constant and not the macro.
35b3a27e 343
648e5523 3442013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 345
0e4e7b74
EZ
346 * w32proc.c (new_child): If no vacant slots are found in
347 child_procs[], make another pass looking for slots whose process
348 has exited or died. (Bug#13546)
349
6e432f0c
EZ
350 * w32.c (sys_pipe): When failing due to file descriptors above
351 MAXDESC, set errno to EMFILE.
352 (_sys_read_ahead): Update cp->status when failing to read serial
353 communications input, so that the status doesn't stay at
354 STATUS_READ_IN_PROGRESS. (Bug#13546)
355
51b3a99c
JD
3562013-02-14 Jan Djärv <jan.h.d@swipnet.se>
357
358 * gtkutil.c (tb_size_cb): New function.
359 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
360
e31560a7
SM
3612013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
362
363 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
364 an event.
365
fe336261
SM
3662013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
367
368 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
369
5a655b9f
DA
3702013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
371
372 * font.c (font_range): Add pos_byte argument. Adjust comment
373 and break long line.
374 * font.h (font_range): Adjust prototype.
375 * composite.c (autocmp_chars): Pass byte position to font_range.
376 Break long line. Remove useless prototype and format comment.
377
1a359750
GM
3782013-02-13 Glenn Morris <rgm@gnu.org>
379
380 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
381
01fcc3a5 3822013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 383
f53f992a
PE
384 Improve AIX port some more (Bug#13650).
385 With this, it should be as good as it was in 23.3, though it's
386 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
387 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
388 * unexaix.c (start_of_text): Remove.
389 (_data, _text): Declare as char[], not int, as AIX manual suggests.
390 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
391 (orig_load_scnptr, orig_data_scnptr):
392 Now off_t, not long, since they are file offsets.
393 (make_hdr): Use _data, not start_of_data ().
394 This is the key part of the fix.
395 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
396 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
397
4458c255
PE
398 * pre-crt0.c (data_start): Initialize to 1.
399 This ports to compilers that optimize the external declaration
400 'int x = 0;' as if it were 'int x;' to shrink the executable.
401
227be86d
PE
402 Improve AIX port (Bug#13650).
403 This doesn't fix the bug, but it makes progress: Emacs builds now.
404 * unexaix.c: Include inttypes.h, stdarg.h.
405 (report_error, report_error_1): Mark as _Noreturn.
406 (report_error): Don't report the wrong errno.
407 (report_error_1): Now varargs. All callers changed.
408 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
409 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
410 (write_ptr): Use %p to print address rather than %lx and a cast
411 to unsigned long. Grow buffer a bit, to be safer.
412
01fcc3a5 4132013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
414
415 * bidi.c (bidi_resolve_neutral): After finding the next
416 non-neutral character, accept NEUTRAL_ON type as well, because
417 directional control characters, such as LRE and RLE, have their
418 type converted to that by bidi_resolve_weak. This avoids aborts
419 when LRE/RLE follows a run of neutrals.
420 (bidi_move_to_visually_next): Assert that return value of
421 bidi_peek_at_next_level is non-negative. Negative values will
422 cause an infloop.
423
83be8524
PE
4242013-02-13 Paul Eggert <eggert@cs.ucla.edu>
425
426 Minor getenv-related fixes.
427 * callproc.c (Fcall_process_region) [!DOS_NT]:
428 Avoid unnecessary duplicate call to getenv.
429 * callproc.c (init_callproc):
430 * dispnew.c (init_display):
431 * sysdep.c (sys_subshell):
432 Omit unnecessary cast of getenv or egetenv.
433
45b2b768
JB
4342013-02-13 Juanma Barranquero <lekktu@gmail.com>
435
436 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
437 Update dependencies.
438
33b49d71
EZ
4392013-02-12 Eli Zaretskii <eliz@gnu.org>
440
441 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
442 marker's position.
443 (display_line): Set w->region_showing to the value of
444 it->region_beg_charpos, not to -1. This fixes redisplay
445 optimization when cursor is moved up after M->. (Bug#13623)
446 (Bug#13626)
c4131562
EZ
447 (try_scrolling): Scroll text up more if point is too close to ZV
448 and inside the scroll margin. This makes sure point is moved
449 outside the scroll margin in these cases.
33b49d71
EZ
450
451 * window.h (struct window): region_showing can no longer be
452 negative.
453
b09a4810
PE
4542013-02-11 Paul Eggert <eggert@cs.ucla.edu>
455
a84b7c53
PE
456 Tune by using memchr and memrchr.
457 * doc.c (Fsnarf_documentation):
458 * fileio.c (Fsubstitute_in_file_name):
459 * search.c (find_newline, scan_newline):
460 * xdisp.c (pos_visible_p, display_count_lines):
461 Use memchr and memrchr rather than scanning byte-by-byte.
462 * search.c (find_newline): Rename from scan_buffer.
463 Omit first arg TARGET, as it's always '\n'. All callers changed.
464
b09a4810
PE
465 Clean up read_key_sequence a tiny bit more.
466 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
467 (read_key_sequence): Remove unused locals.
468
99d0d6dc
SM
4692013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
470
471 Clean up read_key_sequence a bit; reread active keymaps after first event.
472 * keyboard.c (read_char, read_char_x_menu_prompt)
473 (read_char_minibuf_menu_prompt):
474 Replace nmaps+maps with a single `map' arg.
475 (follow_key): Operate on a single map.
476 (active_maps): New function.
477 (test_undefined): Also return true for nil bindings.
478 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
479 a single (composed) keymap. Remember `first_event' to choose the right
480 set of active keymaps. Recompute the set of keymaps after receiving
481 the first event. Remove GOBBLE_FIRST_EVENT.
482 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
483 * keyboard.h (read_char): Update declaration.
484 * lread.c (read_filtered_event): Adjust call to read_char.
485
f5e1b680
EZ
4862013-02-11 Eli Zaretskii <eliz@gnu.org>
487
99d0d6dc
SM
488 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
489 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
490 in the window. (Bug#13675)
491
f74de345
DA
4922013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
493
494 * marker.c (set_marker_internal): If desired position is passed
495 as a marker, avoid call to buf_charpos_to_bytepos.
496 * window.c (Fset_window_point): Omit redundant type checking.
497 (Fset_window_start): Likewise. Format comment.
498 (window_scroll_pixel_based): Use set_marker_restricted_both
499 with character and byte positions obtained from an iterator.
500 (Fset_window_configuration): Use set_marker_restricted_both.
501 * xdisp.c (message_dolog): Likewise.
502
a4ba3963
EZ
5032013-02-10 Eli Zaretskii <eliz@gnu.org>
504
99d0d6dc
SM
505 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
506 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
507 too far. This speeds up some redisplay operations. (Bug#13675)
508
68643cde
DA
5092013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
510
511 * syntax.c (scan_sexps_forward): Fix byte position calculation
512 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
513
7ba11bee
PE
5142013-02-10 Paul Eggert <eggert@cs.ucla.edu>
515
516 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
517 that was not needed.
518
eff1c190
PE
5192013-02-09 Paul Eggert <eggert@cs.ucla.edu>
520
521 Minor hashing refactoring.
522 * fns.c (SXHASH_REDUCE): Move to lisp.h.
523 (sxhash_float): Return EMACS_UINT, for consistency with the other
524 hash functions.
525 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
526 non-static inline function and therefore can't use static vars.
527 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
528 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
529 with the other hash functions.
530
6b48c831
EZ
5312013-02-09 Eli Zaretskii <eliz@gnu.org>
532
4dde2087
EZ
533 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
534 XXXXXX part of the temporary file pattern is not downcased even
535 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 536
8549f9e8
EZ
537 * xdisp.c (decode_mode_spec): Remove handling of %t.
538
6b48c831
EZ
539 * msdos.c (careadlinkatcwd): Remove.
540
75a65c7e
SM
5412013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
542
543 * lread.c (skip_dyn_bytes): New function (bug#12598).
544 (read1): Use it. Use getc instead of READCHAR to read bytes.
545 (load_each_byte): Remove. Update users.
546
8ca30920
DA
5472013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
548
549 * search.c (scan_buffer): Calculate end byte position just once.
550 (scan_newline): Do not recalculate start_byte.
551 (search_command): Use eassert.
552 * syntax.c (struct lisp_parse_state): New member location_byte.
553 (scan_sexps_forward): Record from_byte and avoid redundant
554 character to byte position calculation ...
555 (Fparse_partial_sexp): ... here. Break too long line.
556
25721f5b
DA
5572013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
558
559 * lisp.h (make_uninit_vector): New function.
560 * alloc.c (Fvector, Fmake_byte_code):
561 * ccl.c (Fregister_ccl_program):
562 * charset.c (Fdefine_charset_internal, define_charset_internal):
563 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
564 * composite.c (syms_of_composite):
565 * font.c (Fquery_font, Ffont_info, syms_of_font):
566 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
567 * ftfont.c (ftfont_shape_by_flt):
568 * indent.c (recompute_width_table):
569 * nsselect.m (clean_local_selection_data):
570 * syntax.c (init_syntax_once):
571 * w32unsubscribe.c (uniscribe_shape):
572 * window.c (Fcurrent_window_configuration):
573 * xfaces.c (Fx_family_fonts):
574 * xselect.c (selection_data_to_lisp_data): Use it.
575
9a9d91d9
DA
5762013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
577
578 * coding.c (Fdefine_coding_system_internal): Use AREF where
579 argument is known to be a vector.
580 * fns.c (Flocale_info): Likewise for ASET.
581 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
582 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
583
6871e574
JD
5842013-02-05 Jan Djärv <jan.h.d@swipnet.se>
585
586 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
587 height.
588
589 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
590 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
591 updateCollectionBehaviour.
592
593 * nsterm.m (NEW_STYLE_FS): Remove.
594 (ns_last_use_native_fullscreen): New variable.
595 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
596 (x_set_window_size): Do not take title bar and tool bar into account
597 if isFullscreen returns YES.
598 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
599 (check_native_fs): New function.
600 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
601 (ns_term_init): Remove NEW_STYLE_FS.
602 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
603 and tool bar if isFullscreen returns NO.
604 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
605 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
606 with HAVE_NATIVE_FS.
607 (window:willUseFullScreenPresentationOptions:): New method.
608 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
609 Hide toolbar if not enabled (Bug#13444).
610 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
611 Restore tool bar if enabled, hide it otherwise (Bug#13444).
612 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
613 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
614 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
615 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
616 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
617 (syms_of_nsterm): Add ns-use-native-fullscreen.
618
3f011c7f
PE
6192013-02-04 Paul Eggert <eggert@cs.ucla.edu>
620
621 * fileio.c (Qchoose_write_coding_system): Now static.
622
86f7c0fe
EZ
6232013-02-04 Eli Zaretskii <eliz@gnu.org>
624
625 * xdisp.c (window_buffer_changed): region_showing can be negative,
626 which still means region is being displayed.
627 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
628 whole window when showing region and the mark has changed.
629 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
630 (display_line): If it->region_beg_charpos is non-zero, set the
631 window's region_showing member to -1. (Bug#13623) (Bug#13626)
632
633 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
634 not bitfield of 1 bit.
635
5257b701
DC
6362013-02-03 Daniel Colascione <dancol@dancol.org>
637
638 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
639 daemon mode works on cygw32 when Emacs is installed and not just
640 during development.
641
8ea41ea9
PE
6422013-02-02 Paul Eggert <eggert@cs.ucla.edu>
643
644 Avoid file time stamp bug on MS-Windows (Bug#13149).
645 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
646 as FAT32 doesn't update time stamps when truncating them.
647 Also, check that a file time stamp is not a multiple of 100 ns;
648 this should catch all instances of the problem on MS-Windows,
649 as its native file system resolution is 100 ns or worse, and
650 checking for a non-multiple of 100 ns should impose only a small
651 overhead on systems with ns resolution.
652
94fbc901 6532013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 654
e7ac588e
EZ
655 Avoid encoding file names on MS-Windows when they need to be run
656 through dostounix_filename.
657 * w32.c (normalize_filename): Accept an additional argument
658 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
659 downcase it even if w32-downcase-file-names is non-nil.
660 (dostounix_filename): Accept an additional argument MULTIBYTE and
661 pass it to normalize_filename.
662 (emacs_root_dir): Adjust.
663
664 * msdos.h (dostounix_filename): Adjust prototype.
665
666 * w32.h (dostounix_filename): Adjust prototype.
667
668 * msdos.c (dostounix_filename): Accept an additional argument and
669 ignore it.
670 (init_environment): Adjust callers of dostounix_filename.
671
672 * fileio.c (Ffile_name_directory, file_name_as_directory)
673 (directory_file_name, Fexpand_file_name)
674 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
675 dostounix_filename.
676 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
677 non-nil.
678 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
679 variables, as egetenv is case-insensitive for DOS_NT.
680
681 * dired.c (file_name_completion): Don't call Fdirectory_file_name
682 with an encoded file name.
683
99d0d6dc
SM
684 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
685 Adjust calls to dostounix_filename.
e7ac588e
EZ
686
687 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
688
689 * unexw32.c (unexec): Adjust call to dostounix_filename.
690
691 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
692
693 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
694 dostounix_filename.
695
696 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
697 dostounix_filename.
698
e7c3fb06
EZ
699 * callproc.c (Fcall_process): Make sure program name in PATH and
700 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
701 is passed to exec/spawnve, which fails unless the file-name
702 encoding is UTF-8.
703
18a80473
EZ
704 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
705 even if w32-quote-process-args is nil.
706
35e85499
PE
7072013-02-01 Paul Eggert <eggert@cs.ucla.edu>
708
709 Fix timestamp bug when write-region appends nothing (Bug#13149).
710 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
711 the file's time stamp doesn't change if Emacs happens to write nothing
712 to the file, and on a buggy file system this could cause Emacs to
713 incorrectly infer that the file system doesn't have the bug.
714 Avoid this problem by inhibiting the inference in this case.
715
422ff52b
DA
7162013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
717
718 * window.h (struct window): Convert base_line_number, base_line_pos
719 and column_number_displayed members from Lisp_Object to ptrdiff_t.
720 Convert region_showing member from Lisp_Object to bitfield.
721 Remove sequence_number member. Adjust comments.
722 * window.c (sequence_number): Remove.
723 (make_window): Initialize column_number_displayed.
724 * print.c (print_object): Follow the printed representation of
725 frames and print window pointer to distinguish between windows.
726 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
727 * xdisp.c (wset_base_line_number, wset_base_line_pos)
728 (wset_column_number_displayed, wset_region_showing): Remove.
729 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
730 (try_scrolling, try_cursor_movement, redisplay_window)
731 (try_window_reusing_current_matrix, try_window_id, display_line)
732 (display_mode_lines, decode_mode_spec): Adjust users.
733 * .gdbinit (pwinx): Do not print sequence_number.
734
8654f9d7
PE
7352013-02-01 Paul Eggert <eggert@cs.ucla.edu>
736
737 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
738 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
739 * dired.c: Include <fcntl.h>.
740 (open_directory): New function, which uses open and fdopendir
741 rather than opendir. DOS_NT platforms still use opendir, though.
742 (directory_files_internal, file_name_completion): Use it.
743 (file_attributes): New function, with most of the old Ffile_attributes.
744 (directory_files_internal, Ffile_attributes): Use it.
745 (file_attributes, file_name_completion_stat): First arg is now fd,
746 not dir name. All uses changed. Use fstatat rather than lstat +
747 stat.
748 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
749 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
750 (emacs_readlinkat): New function, with much of the old
751 Ffile_symlink_p, but with an fd argument for speed.
752 It uses readlinkat rather than careadlinkatcwd, so that it
753 need not assume the working directory.
754 (Ffile_symlink_p): Use it.
755 * filelock.c (current_lock_owner): Use emacs_readlinkat
756 rather than emacs_readlink.
757 * lisp.h (emacs_readlinkat): New decl.
758 (READLINK_BUFSIZE, emacs_readlink): Remove.
759 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
760 (emacs_norealloc_allocator, emacs_readlink): Remove.
761 This stuff is moved to fileio.c.
762 * w32.c (fstatat, readlinkat): New functions.
763 (careadlinkat): Don't check that fd == AT_FDCWD.
764 (careadlinkatcwd): Remove; no longer needed.
765
9dbda100
GM
7662013-01-31 Glenn Morris <rgm@gnu.org>
767
768 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
769 (Fwrite_region): Update for new choose_write_coding_system args.
770 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
771 (syms_of_fileio): Add choose-write-coding-system.
772
3f82a88a 7732013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
774
775 * w32.c (sys_open): Zero out the flags for the new file descriptor.
776 (sys_close): Zero out the flags for the file descriptor before
777 closing it. (Bug#13546)
778
806fed21 779 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
780 (logon_network_drive, stat_worker, symlink, chase_symlinks):
781 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
782 DBCS. (Bug#13553)
783
6ee4509a
EZ
784 * w32.c (w32_get_long_filename, init_environment, readlink):
785 Support file names encoded in DBCS codepages.
26854e9c
EZ
786 (readlink): Use the current file-name-coding-system, not the ANSI
787 codepage, to decode and handle targets of symlinks.
6ee4509a 788
cf01a359
EZ
7892013-01-28 Eli Zaretskii <eliz@gnu.org>
790
791 * w32.c (opendir): Now accepts a 'const char *'.
792
6fd326b7
DA
7932013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
794
795 Remove obsolete redisplay code. See the discussion at
796 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
797 * dispnew.c (preemption_period, preemption_next_check): Remove.
798 (Vredisplay_preemption_period): Likewise.
799 (update_frame, update_single_window, update_window, update_frame_1):
800 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
801 used, following the 2012-06-22 change.
802
d8cd7742
EZ
8032013-01-25 Eli Zaretskii <eliz@gnu.org>
804
805 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
806
266fee4f
DA
8072013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
808
809 * font.c (num_fonts): Remove the leftover from old
810 debugging code. Adjust comment style here and there.
59e624b3
DA
811 * insdel.c (insert_1): Remove.
812 * lisp.h (insert_1): Remove prototype.
813 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 814
830e46e6 8152013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
816
817 * w32.c (max_filename_mbslen): New function.
818 (normalize_filename, readdir): Use it to detect locales where ANSI
819 encoding of file names uses a double-byte character set (DBCS).
820 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
821 CharNextExA, instead of incrementing a 'char *' pointer.
822 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 823
81abbb95
EZ
824 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
825 request of memory reservation to 1.7GB. (Bug#13065)
826
830e46e6 8272013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
828
829 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
830 at check_extra_latin label. (Bug#13505)
831
fd3ceb09
DA
8322013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
833
834 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
835 Avoid redundant calls to strlen.
836
edfa7fa0
DA
8372013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
838
839 Drop async_visible and async_iconified fields of struct frame.
840 This is possible because async input is gone; for details, see
841 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
842 * frame.h (struct frame): Remove async_visible and async_iconified
843 members, convert garbaged to unsigned bitfield. Adjust comments.
844 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
845 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
846 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
847 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
848 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
849 * w32term.c: Ditto.
850 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
851 properly. Likewise for obscured.
852 * xterm.c: Ditto.
266fee4f 853 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
854 properly.
855 * nsterm.m: Ditto.
856 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
857
5ad86e34
DA
8582013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
859
860 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
861 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
862
b09cca6a
SM
8632013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
864
865 * xdisp.c (message2, message2_nolog): Remove functions.
866 (message3, message3_nolog): Extract nbytes and multibyteness directly
867 from the string. Change all callers.
868 (message3_nolog): Don't set message_enable_multibyte since set_message
869 will reset it anyway.
870 (message1, message1_nolog): Use message3.
871 (vmessage): Use a stack allocated buffer rather than f->message_buf.
872 (with_echo_area_buffer): Remove last two arguments. Update all callers.
873 (set_message): Drop all but the second arg, which has to be a string.
874 (set_message_1): Simplify now that we know that a1 is NULL and the
875 second arg is a string.
876 * frame.h (struct frame): Remove `message_buf' field.
877 Use glyphs_initialized_p instead.
878 (FRAME_MESSAGE_BUF): Remove macro.
879 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
880 * lisp.h (message2, message2_nolog): Remove declarations.
881 (message3, message3_nolog): Update declarations.
882 * keyboard.c (read_char_minibuf_menu_text)
883 (read_char_minibuf_menu_width): Remove vars.
884 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
885 to correctly handle multibyte strings.
886 * frame.c (delete_frame): Don't free message_buf any more.
887 * editfns.c (message_text, message_length): Remove vars.
888 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
889 * fileio.c (auto_save_error): Use message3 instead of message2.
890 * dispnew.c (adjust_frame_message_buffer): Remove function.
891
54ab1c5a
EZ
8922013-01-23 Eli Zaretskii <eliz@gnu.org>
893
894 * w32term.c (w32fullscreen_hook): Account correctly for the screen
895 real estate used for the tool bar and the menu bar.
896
6c27465b
DA
8972013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
898
899 * insdel.c (prepare_to_modify_buffer): Force redisplay if
900 hidden buffer is prepared to modification (Bug#13164).
901
9d93ce29
DA
9022013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
903
904 * window.h (struct window): Change window_end_valid member from
905 Lisp_Object to a bitfield. Adjust comments.
906 (wset_window_end_valid): Remove.
907 * window.c (adjust_window_count): Clear window_end_valid.
908 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
909 (Fwindow_line_height, set_window_buffer, Frecenter)
910 (Fsplit_window_internal, Fdelete_other_windows_internal)
911 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
912 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
913 * xdisp.c (check_window_end, reconsider_clip_changes)
914 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
915 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
916 (find_first_unchanged_at_end_row, try_window_id): Likewise.
917
1dcb8ea2
DA
9182013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
919
920 * xdisp.c (mark_window_display_accurate): Simplify the loop
921 assuming that the only one of vchild, hchild or buffer window
922 slots is non-nil. Call mark_window_display_accurate_1 for
923 the leaf windows only.
924 (mark_window_display_accurate_1): Always assume leaf window.
925 Adjust comment.
926
b41b8a7e
PE
9272013-01-22 Paul Eggert <eggert@cs.ucla.edu>
928
593a5f2e
PE
929 * emacs.c (Qkill_emacs_hook): Now static.
930
b41b8a7e
PE
931 * fileio.c (Finsert_file_contents): Simplify.
932 Remove unnecessary assignments and tests.
933
84e5ed96
EZ
9342013-01-21 Eli Zaretskii <eliz@gnu.org>
935
936 * w32.c (acl_set_file): Don't test for errors unless
937 set_file_security returns FALSE. Avoids spurious errors when
938 saving files.
939
2ef88fd4
DA
9402013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
941
942 * fileio.c (Finsert_file_contents): Revert code introduced at
943 2013-01-18 in favor of the simpler and generally better fix.
944 Save stack space by removing 'buffer' and reusing 'read_buf'
945 where appropriate.
946
d7a0a7c9
PE
9472013-01-19 Paul Eggert <eggert@cs.ucla.edu>
948
949 * lisp.h (eabs): Define unconditionally (Bug#13419).
950 The old "#if !defined (eabs)" was an unnecessary revenant of back
951 when this macro was called "abs". Document 'eabs' better.
952
795e7a5b 9532013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
954
955 * fns.c (Frandom): Doc fix.
956
59ac2d13
EZ
9572013-01-19 Eli Zaretskii <eliz@gnu.org>
958
959 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
960 segfault when there are lots of overlays.
961
962 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
963 when there are lots of overlays.
964 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
965 for the details and a way to reproduce.
966
b3fbb395
PE
9672013-01-19 Paul Eggert <eggert@cs.ucla.edu>
968
3a955a1f
PE
969 * fileio.c: Use O_APPEND to append.
970 This corresponds better to the natural interpretation of "append",
971 and avoids the need to open the output file twice, or to invoke
972 lseek when APPEND is neither nil nor a number.
973 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
974 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
975 file possibly twice, and lseeking to its end; this avoids the
976 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
977 at the same time: the combination is never needed and apparently
978 it doesn't work with DOS_NT.
979
21cd50b8
PE
980 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
981 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
982
b3fbb395
PE
983 Allow floating-point file offsets.
984 Problem reported by Vitalie Spinu in
985 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
986 * fileio.c (emacs_lseek): Remove.
987 (file_offset): New function.
988 (Finsert_file_contents, Fwrite_region): Use it.
989
73c14218
CY
9902013-01-19 Chong Yidong <cyd@gnu.org>
991
992 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
993 aborting on Fsignal (Bug#13289).
994
6a9465f3
EZ
9952013-01-19 Eli Zaretskii <eliz@gnu.org>
996
997 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
998 set_file_security as failure due to insufficient privileges.
999 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 1000 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 1001
fa705c99
PE
10022013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1003
9fe43ff6
PE
1004 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1005 The bug was observed on Ubuntu operating inside a virtual machine,
1006 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1007 The workaround introduces a race condition on non-buggy hosts,
1008 but it's an unlikely race and anyway there's a nearly identical
1009 nearby race that can't be fixed.
1010 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1011 New static vars.
1012 (Fwrite_region): Test for file system time stamp bug.
1013 (init_fileio): New function.
1014 * lisp.h (init_fileio): Declare it.
1015 * emacs.c (main): Call it.
1016
fa705c99
PE
1017 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1018 and make it more consistent with other stat-failure diagnostics.
1019
e07469fa
DA
10202013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1021
99d0d6dc
SM
1022 Fix crash when inserting data from non-regular files.
1023 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
1024 for the error description produced by valgrind.
1025 * fileio.c (read_non_regular): Rename to read_contents.
1026 Free Lisp_Save_Value object used to pass parameters.
1027 (read_non_regular_quit): Rename to read_contents_quit.
1028 (Finsert_file_contents): Redesign internal file reading loop to adjust
1029 gap and end positions after each read and so help make_gap to work
1030 properly. Do not signal an I/O error too early and so do not leave
1031 not yet decoded characters in a buffer, which was the reason of
1032 redisplay crash. Use list2 to build return value. Adjust comments.
1033
67722112
PE
10342013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1035
1036 Close a race when statting and reading files (Bug#13149).
1037 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1038 This avoids a race if the file is renamed between stat and open.
1039 This race is not the problem originally noted in Bug#13149;
1040 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1041
468afbac
DA
10422013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1043
1044 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1045 objects, related functions and macros.
1046 (make_save_value): Adjust prototype.
1047 (make_save_pointer): New prototype.
1048 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1049 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1050 * alloc.c (format_save_value): Rename to make_save_value.
1051 (make_save_pointer): New function.
1052 (record_xmalloc): Use make_save_pointer.
1053 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1054 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1055 Change users of make_save_value to make_save_pointer.
1056 Likewise for format_save_value and make_save_value.
1057
0e70695a
DA
10582013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1059
1060 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1061 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1062 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1063 debugging stubs.
1064
963ea40f
PE
10652013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1066
1067 * alloc.c (free_save_value): Now static.
1068
3346c1d0
DA
10692013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1070
1071 * keymap.c (map_keymap_internal): Use format_save_value.
1072 (map_keymap_char_table_item): Adjust accordingly.
1073 * fileio.c (non_regular_fd, non_regular_inserted)
1074 (non_regular_nbytes): Remove.
99d0d6dc
SM
1075 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1076 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
1077 (read_non_regular): Use XSAVE_ macros to extract parameters.
1078 Adjust comment.
1079 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1080 format_save_value.
1081 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1082
2b30549c
DA
10832013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1084
1085 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1086 extraction from any Lisp_Save_Value slot. Add type checking.
1087 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1088 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1089 * xselect.c: All users changed.
1090
1b971ac1
DA
10912013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1092
1093 Some convenient bits to deal with Lisp_Save_Values.
1094 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1095 (allocate_misc): Remove prototype.
1096 (format_save_value): New prototype.
1097 * alloc.c (allocate_misc): Revert back to static.
1098 (format_save_value): New function to build Lisp_Save_Value
1099 object with the specified internal structure.
1100 (make_save_value): Reimplement using format_save_value.
1101 * editfns.c (save_excursion_save): Use format_save_value.
1102 (save_excursion_restore): Use XSAVE_OBJECT.
1103
c50cf2ea
PE
11042013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1105
1106 Avoid needless casts with XSAVE_POINTER.
1107 * alloc.c (mark_object) [GC_MARK_STACK]:
1108 * dired.c (directory_files_internal_unwind):
1109 * fileio.c (do_auto_save_unwind):
1110 * gtkutil.c (pop_down_dialog):
1111 * keymap.c (map_keymap_char_table_item):
1112 * lread.c (load_unwind):
1113 * nsmenu.m (pop_down_menu):
1114 * print.c (print_object) [GC_MARK_STACK]:
1115 * xfns.c (clean_up_file_dialog):
1116 * xmenu.c (cleanup_widget_value_tree):
1117 Omit casts between XSAVE_POINTER and a pointer type.
1118
9d5a1260
DA
11192013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1120
1121 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1122 * eval.c (eval_sub): Protect `form' from being GCed before its
1123 car and cdr becomes protected with the backtrace entry.
1124
73ebd38f
DA
11252013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1126
1127 Make Lisp_Save_Value more versatile storage for up to four objects.
1128 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1129 (struct Lisp_Save_Value): New layout. Adjust comments.
1130 (XSAVE_POINTER): New macro.
1131 (XSAVE_INTEGER): Likewise.
1132 (allocate_misc): Add prototype.
1133 (free_misc): Likewise.
1134 * alloc.c (allocate_misc): Now global.
1135 (free_misc): Likewise. Adjust comment.
1136 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1137 (free_save_value): Likewise.
1138 (mark_object): Likewise.
1139 * editfns.c (save_excursion_save): Pack everything within
1140 Lisp_Save_Value and so avoid xmalloc.
1141 (save_excursion_restore): Adjust to match new layout. Use free_misc
1142 because we do not allocate extra memory any more. Add eassert.
1143 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1144 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1145 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1146 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1147 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1148
b826986f
JD
11492013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1150
1151 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1152 (nsfont_draw): Remove disabling of LCD smoothing.
1153 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 1154 Bug#11484 with LCD smoothing on.
b826986f 1155
c0511b57 11562013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 1157
b6f960a0
PE
1158 Fix SIGDANGER handlers, for AIX (Bug#13408).
1159 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1160 Move handlers here from emacs.c; they were out of place.
1161
616763d5
JD
11622013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1163
1164 * xterm.c (syms_of_xterm): Adjust documentation for
1165 scroll-bar-adjust-thumb-portion.
1166
0b59090b 11672012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
1168
1169 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1170 determine whether scroll bar thumb size should be adjusted or
1171 not. Use variable for MOTIF.
1172
1173 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1174 GTK.
1175
7bc916b4
JD
11762013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1177
eac4d08f
JD
1178 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1179 event is generated.
1180 (doCommandBySelector:): Set processingCompose to NO.
1181
7bc916b4
JD
1182 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1183 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1184 (nsfont_list_family): Add block/unblock_input calls.
1185 (nsfont_open): Move block_input earlier. Add unblock_input before early
1186 return.
1187 (nsfont_draw): Add block/unblock_input calls.
1188
bdc9b756
PE
11892013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1190
1191 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1192 for old_charpos and old_bytepos.
1193
ee56a6dc
PE
11942013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1195
1196 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1197 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1198 Clear tzvalbuf_in_environ if this workaround is in effect.
1199 Problem and fix reported by Kazuhiro Ito.
1200
9fc9a531
AH
12012013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1202
99d0d6dc
SM
1203 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1204 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
1205
1206 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1207 doc string cross-reference(s).
1208
1209 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1210 string cross-reference(s).
1211
6020559a
DA
12122013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1213
1214 Avoid unnecessary byte position calculation for the gap movement.
1215 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1216 anyway, all of them should use move_gap_both instead.
1217 * lisp.h (move_gap): Remove prototype.
1218 * insdel.c (move_gap): Remove.
1219 (move_gap_both): Add eassert.
1220 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1221 * xml.c (parse_region): Likewise.
1222
b8956427
PE
12232013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1224
1225 emacsclient -t should not suspend Emacs server (Bug#13387)
1226 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1227 New functions.
1228 * term.c (init_tty): Use them instead of rolling our own code.
1229 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1230 switches from 'signal' to 'pthread_sigmask', which is safer in
1231 multithreaded applications.
1232 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1233 which has already arranged for that.
1234 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1235 This is the main part of the bug fix.
1236
0b59090b 12372013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
1238
1239 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1240 x_last_font_name (Bug#13403).
1241
58cc0a01
DA
12422013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1243
1244 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1245 the type of per-buffer values where appropriate.
1246 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1247 predicate, which is how it's really used now. Adjust comment.
1248 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1249 * buffer.c (buffer_slot_type_mismatch): Remove.
1250 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1251 predicate. Adjust comment.
1252 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1253 fill-column, left-margin, tab-width, buffer-saved-size,
1254 left-margin-width, right-margin-width, left-fringe-width,
1255 right-fringe-width, scroll-bar-width and buffer-display-count.
1256 Use Qstringp for default-directory, buffer-file-name,
1257 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1258 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1259 line-spacing.
1260 * data.c (store_symval_forwarding): Adjust to call the predicate.
1261
5104861e
JB
12622013-01-09 Juanma Barranquero <lekktu@gmail.com>
1263
1264 * w32.c (get_name_and_id, acl_set_file):
1265 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1266
eefd7278
DA
12672013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1268
1269 * lisp.h (make_gap_1): New prototype.
1270 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1271 gap size values.
1272 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1273 naming convention.
1274 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 1275 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
1276 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1277 (make_gap_1): New function to adjust the gap of any buffer.
1278 * coding.c (coding_alloc_by_making_gap): Use it.
1279 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1280 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1281
073ca75b
JL
12822013-01-08 Juri Linkov <juri@jurta.org>
1283
1284 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1285 of (supports :underline (:style wave)). (Bug#13000)
1286
3bace969
AH
12872013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1288
1289 * undo.c (Fprimitive_undo): Move to simple.el.
1290 (syms_of_undo): Remove declarations for Sprimitive_undo.
1291
63a63bd4
SM
12922013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1293
1294 * keyboard.c (echo_add_key): Rename from echo_add_char.
1295
56ed110a
CY
12962013-01-06 Chong Yidong <cyd@gnu.org>
1297
1298 * keyboard.c (echo_add_char): New function, factored out from
1299 echo_char. Don't add a space if the previous echo string was
1300 empty (Bug#13255).
1301 (echo_char): Use it.
1302 (read_key_sequence): When echoing mock input, ensure that the
1303 trailing dash is properly added.
1304
b630991b
EZ
13052013-01-05 Eli Zaretskii <eliz@gnu.org>
1306
1307 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1308 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
1309 digits for buffer positions, before misalignment starts.
1310 Display "0" for integer "object" field.
b630991b
EZ
1311 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1312 Display the newline glyph more unambiguously.
1313
f032a318
YM
13142013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1315
1316 * nsterm.m (ns_draw_underwave):
1317 * w32term.c (w32_draw_underwave):
1318 * xterm.c (x_draw_underwave): Make underwave look more triangular
1319 and also degrade gracefully for small fonts. (Bug#13000)
1320
4240dd3c
YM
1321 * nsterm.m (ns_draw_text_decoration):
1322 * w32term.c (x_draw_glyph_string):
1323 * xterm.c (x_draw_glyph_string): Don't use previous underline
1324 thickness and position if previous underline type is underwave.
1325
553081a5
SM
13262013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1327
1328 * fileio.c (Ffile_acl): Undocument return format.
1329
9539d465 13302013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
1331
1332 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1333
71376d4b
PE
13342013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1335
1336 Simplify via eabs.
1337 * dired.c (file_name_completion):
1338 * doc.c (get_doc_string):
1339 * floatfns.c (round2):
1340 * font.c (font_score, font_delete_unmatched):
1341 * fringe.c (compute_fringe_widths):
1342 * lread.c (read_list):
1343 * minibuf.c (Ftry_completion):
1344 * term.c (tty_ins_del_lines):
1345 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1346 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1347
a7f11948
EZ
13482012-12-31 Eli Zaretskii <eliz@gnu.org>
1349
1350 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
1351 correctly.
1352 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
1353 for the bug this caused.
1354
84cc1ab6
PE
13552012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1356
1357 * coding.c (Qmac): Now static.
1358
5a1d858b
JD
13592012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1360
1361 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1362 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1363 handlebox_widget. Set toolbar_in_hbox to false/true, set
1364 toolbar_is_packed to true.
1365 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1366 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1367 Show all on TOOLBAR_TOP_WIDGET.
1368 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1369 by TOOLBAR_TOP_WIDGET.
1370 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1371 Check toolbar_is_packed.
8b745d92
JD
1372 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1373 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1374 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1375 false.
1376 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1377 (xg_update_menubar): Update title only if
1378 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1379 (xg_update_submenu): Skip tearoff only if
1380 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1381 (xg_initialize): Initialize xg_detached_menus only if
1382 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
1383
1384 * xterm.h (struct x_output): Surround handlebox_widget with
1385 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1386 toolbar_in_hbox is bool.
1387
d5e5e7b4 13882012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
1389
1390 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1391 (LIBS_GNUSTEP): Define.
1392 (LIBES): Add $(LIBS_GNUSTEP).
1393 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1394
d5e5e7b4 13952012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
1396
1397 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1398 continuation glyph on a TTY with an indication of an empty line.
1399 (Bug#13277)
1400
e7ae8039
EZ
14012012-12-29 Eli Zaretskii <eliz@gnu.org>
1402
ccad023b
EZ
1403 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1404 file's SELinux context or ACLs successfully set, nil otherwise.
1405 (Bug#13298)
8d23a331 1406 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 1407
e7ae8039
EZ
1408 * w32proc.c (reader_thread): Avoid passing NULL handles to
1409 SetEvent and WaitForSingleObject.
1410
7456e13f
PE
14112012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1412
1413 Port EXTERNALLY_VISIBLE to Clang 3.2.
1414 * conf_post.h (__has_attribute): New macro.
1415 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1416
1ab0c851
GM
14172012-12-27 Glenn Morris <rgm@gnu.org>
1418
1419 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1420 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1421
82e2a1f0 14222012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 1423
63a63bd4
SM
1424 * fileio.c (file_name_as_directory, directory_file_name):
1425 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
1426 came from a multibyte or a unibyte Lisp string; all callers
1427 adjusted. Don't assume the input string is always multibyte.
1428 (Bug#13262)
1429 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1430 don't ENCODE_FILE them, and return a unibyte string if the input
1431 was unibyte.
1432 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1433 don't assume the input strings will always be multibyte. If the
1434 input strings are multibyte, decode strings obtained from C
1435 library functions.
1436
8847a0de
DA
14372012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1438
1439 * lisp.h (toplevel): Add two notices to the comment about
1440 defining a new Lisp data type.
6cda572a
DA
1441 * print.c (print_object): If Lisp_Save_Value object's pointer
1442 is the address of a memory area containing Lisp_Objects, try
1443 to print them.
1444 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 1445
4b298d5a
DA
14462012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1447
1448 * keyboard.c (record_asynch_buffer_change): Initialize an event
1449 only if it's really needed.
1450 * frame.h (enum output_method): Remove output_mac member since
1451 it's a leftover from the deleted code.
1452 * frame.c (Fframep): Adjust user here ...
1453 * terminal.c (Fterminal_live_p): ... and here.
1454 * coding.c (Qmac): Now here because it's only used to denote
1455 end-of-line encoding type.
1456 (syms_of_coding): DEFSYM it.
1457 * frame.h (Qmac): Remove duplicated declaration.
1458
12384b01
PE
14592012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1460
1461 * window.c (select_window_1): Now static, since it's used only here.
1462
f1665bdc
EZ
14632012-12-25 Eli Zaretskii <eliz@gnu.org>
1464
1465 * window.c (window_body_cols): Subtract display margins from the
1466 window body width on TTYs as well. See
1467 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1468 for the original report.
1469
9a0d4f34
DA
14702012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1471
1472 * xdisp.c (redisplay_window): Remove inner local variable
1473 because the outer shadowed one has the same meaning.
cd78d9b1
DA
1474 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1475 set but never used.
1476 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1477 (xg_create_tool_bar): Adjust users.
9a0d4f34 1478
f9e7c67e
DA
14792012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1480
1481 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1482 * buffer.c (Fget_buffer_create): Use it to set compact field of
1483 struct buffer_text to avoid accessing an uninitialized value
1484 when compact_buffer is called for the first time.
1485 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
1486 (Fset_buffer_modified_p): Use buffer_window_count to check
1487 whether the buffer is displayed in some window.
1488 * xdisp.c (message_dolog): Likewise.
f9e7c67e 1489
299614f3
EZ
14902012-12-23 Eli Zaretskii <eliz@gnu.org>
1491
40ff07a5
EZ
1492 * w32.c (acl_set_file): If setting the file security descriptor
1493 fails, and the new DACL is identical to the existing one, silently
1494 return success. This fixes problems for users backing up their
1495 own files without having the necessary privileges for setting
1496 security descriptors.
1497
299614f3
EZ
1498 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1499 values.
1500 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1501 after WaitForSingleObject returns normally. This expedites reader
1502 thread shutdown when delete_child triggers it.
1503 (reap_subprocess): More accurate commentary for why we call
1504 delete_child only when cp->fd is negative.
1505
1506 * w32.c (sys_close): Do not call delete_child on a subprocess
1507 whose handle is not yet closed. Instead, set its file descriptor
1508 to a negative value, so that reap_subprocess will call
63a63bd4
SM
1509 delete_child on that subprocess when its SIGCHLD arrives.
1510 This avoids closing handles used for communications between sys_select
299614f3
EZ
1511 and reader_thread, which doesn't give sys_select a chance to
1512 notice that the process exited and invoke the SIGCHLD handler for
1513 it.
1514
cf162aee
JD
15152012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1516
1517 * nsfns.m (Fns_do_applescript): Run event loop until script has
1518 been executed (Bug#12969).
1519 (ns_run_ascript): Chech as_script for nil, set to nil after
1520 executing script.
1521
94900bfe
MR
15222012-12-22 Martin Rudalics <rudalics@gmx.at>
1523
1524 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1525
b2faf49c
EZ
15262012-12-22 Eli Zaretskii <eliz@gnu.org>
1527
1528 * w32term.c (w32fullscreen_hook): New function.
1529 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1530
7efa3fb3
EZ
15312012-12-21 Eli Zaretskii <eliz@gnu.org>
1532
bb085aed
EZ
1533 * fileio.c (Finsert_file_contents): Doc fix.
1534
7efa3fb3
EZ
1535 * w32proc.c (new_child, delete_child, find_child_pid): For a
1536 subprocess, consider its slot being in use as long as its process
1537 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1538 slot when a new process is started immediately after killing
1539 another one, without waiting enough time for the first process to
1540 be reaped and resources allocated for it be orderly freed.
1541 (Bug#13086)
1542 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1543
c1f02afa
CY
15442012-12-21 Chong Yidong <cyd@gnu.org>
1545
1546 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1547
5bec25eb
CY
1548 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1549
a4b0cca1 15502012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
1551
1552 * w32.c (get_name_and_id): Always pass NULL as the first argument
1553 of lookup_account_sid. Avoids crashes with UNC file names that
1554 refer to DFS domains, not to specific machine names. (Bug#12621)
1555 Remove now unused argument FNAME; all callers changed.
1556 (get_file_owner_and_group): Remove now unused argument FNAME; all
1557 callers changed.
1558
34b4b7eb
CY
15592012-12-21 Chong Yidong <cyd@gnu.org>
1560
1561 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1562 error for invalid chars, don't check for a nil return value.
1563
13002885
DA
15642012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1565
1566 Avoid calls to CHAR_TO_BYTE if byte position is known.
1567 * editfns.c (make_buffer_string_both): Use move_gap_both.
1568 (Fbuffer_string): Use make_buffer_string_both.
1569 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1570 Adjust comment.
1571 (buf_bytepos_to_charpos): Likewise.
1572 (charpos_to_bytepos): Remove.
1573 * fileio.c (Finsert_file_contents): Use move_gap_both.
1574 * search.c (Freplace_match): Likewise.
9a0d4f34 1575 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
1576 names for byte positions.
1577 * lisp.h (charpos_to_bytepos): Remove prototype.
1578 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1579 * insdel.c (move_gap): Likewise.
1580
99e9311c
PE
15812012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1582
1583 * xdisp.c (redisplay_internal): Remove now-unused local.
1584
e02230bf
SM
15852012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1586
1587 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1588 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 1589 proper value of frame-local variables (bug#13225).
e02230bf 1590
1687fb14
DA
15912012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1592
1593 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1594 Rename 4th argument since it may be buffer or string. Adjust comment.
1595 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1596
a2f07cd2
DA
15972012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1598
1599 * coding.c (Fdetect_coding_region): Do not check start and end with
1600 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1601 (code_convert_region): Likewise.
1602
474d441e
EZ
16032012-12-18 Eli Zaretskii <eliz@gnu.org>
1604
1605 * w32.c (acl_get_file, acl_set_file): Run the file name through
1606 map_w32_filename, and resolve any symlinks in the file name, like
1607 Posix platforms do.
1608 (acl_set_file): Call revert_to_self, if any privileges were
1609 enabled.
1610
8725c076
JB
16112012-12-17 Juanma Barranquero <lekktu@gmail.com>
1612
1613 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1614 ($(BLD)/w32.$(O)): Update dependencies.
1615
1e101a4b
SM
16162012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1617
1618 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1619 propagate redisplay's scrolling (if any) to the right window.
1620 (redisplay_internal): Use ensure_selected_frame.
1621 (display_mode_lines): Complete last fix.
1622 * window.c (select_window_1): New func, extracted from select_window.
1623 (select_window): Use it.
1624 * window.h (select_window_1): Declare.
1625
66447e07
EZ
16262012-12-17 Eli Zaretskii <eliz@gnu.org>
1627
1628 Emulate Posix ACL APIs on MS-Windows.
1629 * w32.c: Include sddl.h and sys/acl.h.
1630 (SDDL_REVISION_1): Define if not already defined.
1631 (g_b_init_get_security_descriptor_dacl)
1632 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1633 (g_b_init_is_valid_security_descriptor)
1634 (g_b_init_set_file_security): New static flags.
1635 (globals_of_w32): Initialize them to zero.
1636 (SetFileSecurity_Name): New string constant.
1637 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1638 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1639 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1640 (IsValidSecurityDescriptor_Proc): New typedefs.
1641 (get_file_security, get_security_descriptor_owner)
1642 (get_security_descriptor_group): Set errno to ENOTSUP.
1643 (set_file_security, get_security_descriptor_dacl)
1644 (is_valid_security_descriptor, convert_sd_to_sddl)
1645 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1646 (acl_free, acl_get_file, acl_set_file): New functions.
1647
1648 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1649
207a7ef0
PE
16502012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1651
1652 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1653 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1654 for some of that bug's symptoms can now cause Emacs to abort.
1655 Remove the workaround.
1656 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1657 The bug that caused SIGCHLD to get lost has been fixed, and the
1658 workaround for it can now cause Emacs to abort.
1659
17fdfc15
PE
16602012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1661
1662 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1663 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1664 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1665
7c3d167f
RF
16662012-12-16 Romain Francoise <romain@orebokech.com>
1667
1668 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1669 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 1670 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
1671 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1672
1673 * Makefile.in (LIBACL_LIBS): New macro.
1674 (LIBES): Use it.
1675
7d80ea23
PE
16762012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1677
1678 * fileio.c (internal_delete_file): Use bool for boolean.
1679
b0728617
EZ
16802012-12-15 Eli Zaretskii <eliz@gnu.org>
1681
1682 Fix bug #13079 on MS-Windows with temp files not being deleted.
1683 * w32.h (_child_process): New members input_file and
1684 pending_deletion.
1685 (register_child): First argument is now pid_t.
1686 (record_infile, record_pending_deletion): New prototypes.
1687
1688 * w32proc.c (new_child): Initialize input_file and
1689 pending_deletion members of the child.
1690 (delete_child): Delete the child's temporary input file, if any,
1691 that is pending deletion.
1692 (register_child): First argument is now pid_t.
1693 (record_infile, record_pending_deletion): New functions.
1694 (reap_subprocess): Fix a typo in DebPrint string.
1695 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
1696
1697 * fileio.c (internal_delete_file): Return an int again: non-zero
1698 if delete-file succeeds, zero otherwise.
1699
1700 * lisp.h (internal_delete_file): Adjust prototype.
1701
1702 * callproc.c (Fcall_process): Don't overwrite infile with result
1703 of DECODE_FILE.
1704 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
1705 asynchronous subprocess, record the name of the input file name,
1706 if any.
1707 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
1708 delete the file, record it as pending deletion when the subprocess
1709 exits.
1710
7e90af26
EZ
17112012-12-14 Eli Zaretskii <eliz@gnu.org>
1712
1713 * editfns.c [HAVE_PWD_H]: Include grp.h.
1714
1715 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
1716
97976f9f
PE
17172012-12-14 Paul Eggert <eggert@cs.ucla.edu>
1718
1719 Fix permissions bugs with setgid directories etc. (Bug#13125)
1720 * dired.c (Ffile_attributes): Return t as the 9th attribute,
1721 to mark it as a placeholder. The old value was often wrong.
1722 The only user of this attribute has been changed to use
1723 file-ownership-preserved-p instead, with its new group arg.
1724 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
1725
26ec1f49
SM
17262012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
1727
ad966fe7
SM
1728 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
1729 Keep selected_window and selected_frame in sync.
26ec1f49 1730
5c207910
EZ
17312012-12-14 Eli Zaretskii <eliz@gnu.org>
1732
1733 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
1734 try to get accurate owner and group information from NT file
1735 security APIs. This is to make most callers of 'stat' and
1736 'lstat', which don't need that information, much faster.
1737
26ec1f49
SM
1738 * dired.c (Ffile_attributes) [WINDOWSNT]:
1739 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
1740 owner and group information from 'lstat'.
1741
893f52d8
PE
17422012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1743
4c95c9a5
PE
1744 * fileio.c (Finsert_file_contents): Don't put tail into head area,
1745 as that confuses set-auto-coding, so insist on the head-read
1746 returning the full 1024 bytes. Let lseek compute the tail offset;
1747 less work for us. Do not ignore I/O errors when reading the tail.
1748
893f52d8
PE
1749 * xdisp.c: Minor style fixes.
1750 (init_iterator): Hoist assignment out of if-expression.
1751 (markpos_of_region): Callers now test for sign, not for -1.
1752
40d1e434
DA
17532012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
1754
1755 Minor redisplay optimization when the region length is zero.
1756 * xdisp.c (markpos_of_region): New function.
1757 (init_iterator): Do not highlight the region of zero length.
1758 (redisplay_window): Check whether the region is of non-zero length.
1759 (try_cursor_movement): Allow if the region length is zero.
1760 (try_window_reusing_current_matrix, try_window_id): Likewise.
1761
727f9739 17622012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
1763
1764 * search.c (search_buffer): Check the inverse translations of each
1765 character in pattern when the buffer being searched is unibyte.
1766 (Bug#13084)
1767
727f9739 17682012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
1769
1770 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
1771 files, fixing a regression from 24.2.
645c6a30 1772 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 1773
d20704ef
PE
17742012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1775
1776 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1777 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1778 Remove unnecessary S_ISLNK test, as (contra the comments) this
1779 function can't copy symlinks. Improve quality of error message
1780 when attempting to copy files that are neither regular files nor
1781 directories.
1782
2dd61a9b
DA
17832012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1784
1785 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1786 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1787 * window.c (Frecenter):
1788 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1789 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1790
cc98b684
DC
17912012-12-12 Daniel Colascione <dancol@dancol.org>
1792
1e101a4b 1793 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
1794 the dumped Emacs is not a sparse file, greatly improving Cygwin
1795 "make bootstrap" performance.
1796
38e791fd
MA
17972012-12-11 Michael Albinus <michael.albinus@gmx.de>
1798
1799 * inotify.c (inotify_callback): Generate an Emacs event for every
1800 incoming inotify event.
1801
f9d1448f
EZ
18022012-12-11 Eli Zaretskii <eliz@gnu.org>
1803
1804 * xdisp.c (handle_face_prop): Fix logic of computing
1805 it->start_of_box_run_p.
1806 (append_space_for_newline): If the glyph row is R2L, reset the
1807 iterator's end_of_box_run_p flag before prepending the space glyph.
1808 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1809 iterator's start_of_box_run_p flag before prepending the stretch.
1810 (append_glyph, produce_image_glyph, append_composite_glyph)
1811 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1812 left_box_line_p and right_box_line_p flags of the glyph for R2L
1813 glyph rows. (Bug#13011)
1814
c6afe371
DA
18152012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1816
1817 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1818 if changed buffer is not shown in a window.
1819 * insdel.c (prepare_to_modify_buffer): Likewise.
1820 * window.c (replace_buffer_in_windows_safely): Do nothing
1821 if buffer is not shown in a window.
1822 (Fforce_window_update): Likewise if string or buffer argument
1823 is passed.
1824
1b47babd
EZ
18252012-12-11 Eli Zaretskii <eliz@gnu.org>
1826
1827 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1828 encoded_file_name, which is what it is.
1829
4c1acb95
DA
18302012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1831
1832 Consistently use marker_position and marker_byte_position.
1833 * fringe.c (Ffringe_bitmaps_at_pos):
1834 * indent.c (Fvertical_motion):
1835 * insdel.c (prepare_to_modify_buffer):
1836 * keyboard.c (make_lispy_position):
1837 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
1838 (window_scroll_pixel_based, displayed_window_lines)
1839 (Fset_window_configuration):
1840 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
1841 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
1842 Replace direct access to marker fields with calls
1843 to marker_position and/or marker_byte_position.
1844
0eeb69fe
JB
18452012-12-11 Juanma Barranquero <lekktu@gmail.com>
1846
1847 * makefile.w32-in (SIG2STR_H): New macro.
1848 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
1849 ($(BLD)/w32notify.$(O)): Update dependencies.
1850
1cf1bbd5
DC
18512012-12-10 Daniel Colascione <dancol@dancol.org>
1852
8db4b52f
DC
1853 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
1854 Windows file notification functionality unless WINDOWSNT.
1855
1cf1bbd5
DC
1856 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
1857 declarations.
1858
1859 * w32fns.c (cache_system_info): Initialize the global hinst
1860 variable here so various initialization calls DTRT.
1861
1e101a4b 1862 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
1863 (hinst): Remove unneeded extern declaration.
1864 (_start): Remove initialization of above variables; remove
1865 initialization of hinst, as cache_system_info now does that.
1866
1867 * emacs.c (main): Call cache_system_info early in startup; we
1868 previously weren't calling it in Cygwin builds.
1869
26ec1f49
SM
1870 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
1871 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
1872 and link it to Emacs.
1873
98a07056
DA
18742012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
1875
1876 Per-buffer window counters.
1877 * buffer.h (struct buffer): New member window_count.
1878 (buffer_window_count): New function.
1879 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1880 Initialize window_count.
1881 (Fkill_buffer): Verify window_count for the buffer being killed.
1882 (modify_overlay): Do not force redisplay if buffer is not shown
1883 in any window.
1884 (init_buffer_once): Initialize window_count for buffer_defaults
1885 and buffer_local_symbols.
1886 * window.h (buffer_shared): Remove declaration.
1887 (wset_buffer): Convert from inline ...
1888 * window.c (wset_buffer): ... to an ordinary function.
1889 (adjust_window_count): New function.
1890 (make_parent_window): Use it.
1891 * xdisp.c (buffer_shared): Remove.
1892 (redisplay_internal, redisplay_window): Adjust users.
1893 (buffer_shared_and_changed): Use per-buffer window counter.
1894
2b8c9064
EZ
18952012-12-10 Eli Zaretskii <eliz@gnu.org>
1896
1897 Support for filesystem notifications on MS-Windows.
1898 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
1899 and this is a TTY frame, signal the caller that keyboard input is
1900 available.
1901
1902 * w32xfns.c (drain_message_queue): Now returns an int: an
1903 indication whether any WM_EMACS_FILENOTIFY messages were found in
1904 the queue.
1905
1906 * w32inevt.c (handle_file_notifications): New function.
1907 (w32_console_read_socket): Call it to process file notifications.
1908
1909 * w32console.c (initialize_w32_display): Record the main thread ID
1910 in dwMainThreadId.
1911
1912 * deps.mk (inotify.o): New dependency list.
1913
1914 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
1915
1916 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
1917 (WM_EMACS_END): Bump value by 1.
1918 (notification_buffer_in_use, file_notifications)
1919 (notifications_size, notifications_desc): Declare.
1920 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
1921 Add prototypes.
1922
1923 * w32term.c (lispy_file_action, queue_notifications): New functions.
1924 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
1925 <Qrenamed_to>: New symbols.
1926 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
1927
1928 * w32notify.c: New file, implements file event notifications for
1929 MS-Windows.
1930
1931 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
1932 by posting it to the w32_read_socket queue.
1933
1e101a4b 1934 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
1935
1936 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
1937 (GLOBAL_SOURCES): Add w32notify.c
1938 ($(BLD)/w32notify.$(O)): New set of dependencies.
1939
1940 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
1941
1e101a4b
SM
1942 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
1943 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
1944 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
1945 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
1946 w32notify-handle-event by default.
1947
1948 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
1949 syms_of_w32notify.
1950
81606b10
RS
19512012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
1952
2b8c9064 1953 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 1954 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
1955
1956 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
1957
1958 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
1959 (syms_of_keyboard): DEFSYM it.
1960 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
1961 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
1962 Qfile_inotify events.
1963 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
1964 special-event-map to inotify-handle-event.
1965
1966 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
1967
1968 * Makefile.in (base_obj): Add inotify.o.
1969
1970 * inotify.c: New file.
1971
265c2fbf 19722012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
1973
1974 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
1975
265c2fbf 19762012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
1977
1978 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
1979 DWORD_PTR, for compatibility with 64-bit builds.
1980
a06ae17d 1981 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
1982 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
1983 (system_process_attributes): Use SIZE_T rather than DWORD, for
1984 compatibility with 64-bit builds.
1985
265c2fbf 19862012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
1987
1988 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
1989
265c2fbf 19902012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
1991
1992 * indent.c (Fvertical_motion): If a display string will be
1993 displayed on the left or the right margin, don't consider it as a
1994 factor in cursor positioning. (Bug#13108)
1995
265c2fbf 19962012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
1997
1998 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
1999
5f460827
PE
20002012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2001
2002 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2003 for string length.
2004
a16e75cd
EZ
20052012-12-08 Eli Zaretskii <eliz@gnu.org>
2006
2007 * w32.c (unsetenv): Return 0 if the input string is too long.
2008
5745a7df
PE
20092012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2010
2011 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2012 * alloc.c (xputenv): New function.
2013 * dbusbind.c (Fdbus_init_bus):
2014 * emacs.c (main):
2015 * xterm.c (x_term_init):
2016 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2017 * editfns.c (initial_tz): Move static var decl up.
2018 (tzvalbuf_in_environ): New static var.
2019 (init_editfns): Initialize these two static vars.
2020 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2021 Save old TZ value on stack, if it's small.
2022 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2023 instead, use xputenv+unsetenv to set and restore TZ.
2024 (environbuf): Remove static var. All uses removed.
2025 (Fset_time_zone_rule): Do not save TZ and environ;
2026 no longer needed here.
2027 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2028 Move to inside set_time_zone_rule; they don't need file scope any more.
2029 (set_time_zone_rule): Maintain the TZ=value string separately.
2030 (syms_of_editfns): Don't initialize initial_tz;
2031 init_editfns now does it.
2032 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2033 * lisp.h (xputenv): New decl.
2034
c56efa40
FP
20352012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2036
2037 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2038
75ceee05
EZ
20392012-12-08 Eli Zaretskii <eliz@gnu.org>
2040
2041 * w32.c (unsetenv, sys_putenv): New functions.
2042
1b6dbfeb
CY
20432012-12-08 Chong Yidong <cyd@gnu.org>
2044
2045 * editfns.c (Finsert_char): Make the error message more
2046 informative (Bug#12992).
2047
d983a10b
PE
20482012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2049
7be78020
PE
2050 Simplify get_lim_data.
2051 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2052 Remove USG and vlimit methods; no longer used these days.
2053 Add #error catchall just in case.
2054
d983a10b
PE
2055 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2056 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2057 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2058 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2059 (deleted_pid_list, Fdelete_process, create_process)
2060 (record_child_status_change, handle_child_signal, deliver_child_signal)
2061 (init_process_emacs, syms_of_process):
2062 Assume SIGCHLD is defined.
2063 (parse_signal): Remove. All uses removed.
2064 (abbr_to_signal): New static function.
2065 (Fsignal_process): Use it to convert signal names to ints.
2066 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2067 kill (getpgrp (), ...).
2068 (emacs_sigaction_init): Assume SIGCHLD is defined.
2069 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2070 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2071 * syssignal.h (EMACS_KILLPG): Remove.
2072 All uses replaced by 'kill' with a negative pid.
2073 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2074 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2075
9cdde1e2
PE
20762012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2077
2078 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2079 This will cause a production Emacs to dump core instead of
2080 infinite-looping.
2081
822995f8
DA
20822012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2083
2084 * frame.c (make_frame): Do not set window's buffer to t.
2085 * window.c (Fsplit_window_internal): Likewise. Previously it was
2086 used to indicate that the window is being set up. Now we use
2087 set_window_buffer for all new windows, so the condition in ...
2088 (Fset_window_buffer): ... is always true and can be removed.
2089
ed08365b
DA
20902012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2091
2092 Convenient macro to check whether the buffer is hidden.
2093 * buffer.h (BUFFER_HIDDEN_P): New macro.
2094 * frame.c (make_frame): Use it. Adjust comment.
2095 * buffer.c (candidate_buffer): New function.
2096 (Fother_buffer, other_buffer_safely): Use it.
2097
e86f5134
EZ
20982012-12-06 Eli Zaretskii <eliz@gnu.org>
2099
2100 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2101 if the child process is still running. Instead, exit the wait
2102 loop and return zero. (Bug#13086)
2103
1700db3c
DA
21042012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2105
2106 * frame.h (x_char_width, x_char_height): Remove prototypes.
2107 * w32term.h (x_char_width, x_char_height): Likewise.
2108 * xfns.c (x_char_width, x_char_height): Remove.
2109 * w32fns.c (x_char_width, x_char_height): Likewise.
2110 * nsfns.c (x_char_width, x_char_height): Likewise.
2111 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2112 all window frames.
2113 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2114 * keyboard.c (command_loop_1): Remove prototype.
2115 (command_loop_2, top_level_1): Add static to match prototype.
2116
35fb8050
PE
21172012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2118
2119 Fix a recently-introduced delete-process race condition.
2120 * callproc.c, process.h (record_kill_process):
2121 New function, containing part of the old call_process_kill.
2122 (call_process_kill): Use it.
2123 This does not change call_process_kill's behavior.
2124 * process.c (Fdelete_process): Use record_kill_process to fix a
2125 race condition that could cause Emacs to lose track of a child.
2126
565212e5
DA
21272012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2128
2129 Avoid code duplication between prev_frame and next_frame.
2130 * frame.c (candidate_frame): New function. Add comment.
2131 (prev_frame, next_frame): Use it. Adjust comment.
2132
d8ad4d3f 21332012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
2134
2135 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2136 fails, signal an error instead of continuing with an empty
2137 string. (Bug#13079)
7c2fcf9b
EZ
2138 Encode expanded temp file pattern before passing it to mkstemp or
2139 mktemp.
d3cefd13 2140
2e7cddd3
EZ
2141 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2142 Encode the file name before passing it to dostounix_filename, in
2143 case it will downcase it (under w32-downcase-file-names).
2144 (Bug#12933)
2145
644d3f0d
PE
21462012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2147
2148 Minor call-process cleanups.
2149 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2150 at the same time as other platforms, to simplify analysis.
2151 No need for fd0_volatile since we have synch_process_fd.
2152 Avoid needless emacs_close; arg is always negative.
2153
396376f1
AS
21542012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2155
2156 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2157 processes.
2158
350f51ad
DA
21592012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2160
2161 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2162 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2163 and mouse_face_hidden members to a bitfields.
2164 * frame.h (struct frame): Remove set-but-not-used space_width member.
2165 (FRAME_SPACE_WIDTH): Remove.
2166 * nsterm.m, w32term.c, xterm.c: Adjust users.
2167 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2168 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2169 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2170 members to a bitfields.
2171
bc9dbce6
PE
21722012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2173
bb5f74ee
PE
2174 Don't let call-process be a zombie factory (Bug#12980).
2175 Fixing this bug required some cleanup of the signal-handling code.
2176 As a side effect, this change also fixes a longstanding rare race
2177 condition whereby Emacs could mistakenly kill unrelated processes,
2178 and it fixes a bug where a second C-g does not kill a recalcitrant
2179 synchronous process in GNU/Linux and similar platforms.
2180 The patch should also fix the last vestiges of Bug#9488,
2181 a bug which has mostly been fixed on the trunk by other changes.
2182 * callproc.c, process.h (synch_process_alive, synch_process_death)
2183 (synch_process_termsig, sync_process_retcode):
2184 Remove. All uses removed, to simplify analysis and so that
2185 less consing is done inside critical sections.
2186 * callproc.c (call_process_exited): Remove. All uses replaced
2187 with !synch_process_pid.
2188 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2189 These take the role of what used to be in unwind-protect arg.
2190 All uses changed.
2191 (block_child_signal, unblock_child_signal):
2192 New functions, to avoid races that could kill innocent-victim processes.
2193 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2194 (call_process_kill): Record killed processes as deleted, so that
2195 zombies do not clutter up the system. Do this inside a critical
2196 section, to avoid a race that would allow the clutter.
2197 (call_process_cleanup): Fix code so that the second C-g works again
2198 on common platforms such as GNU/Linux.
2199 (Fcall_process): Create the child process in a critical section,
2200 to fix a race condition. If creating an asynchronous process,
2201 record it as deleted so that zombies do not clutter up the system.
2202 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2203 light of these changes. Omit unnecessary call to emacs_close
2204 before failure, as the unwind-protect code does that.
2205 * callproc.c (call_process_cleanup):
2206 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2207 * process.c (record_deleted_pid): New function, containing
2208 code refactored out of Fdelete_process.
2209 (Fdelete_process): Use it.
2210 (process_status_retrieved): Remove. All callers changed to use
2211 child_status_change.
2212 (record_child_status_change): Remove, folding its contents into ...
2213 (handle_child_signal): ... this signal handler. Now, this
2214 function is purely a handler for SIGCHLD, and is not called after
2215 a synchronous waitpid returns; the synchronous code is moved to
2216 wait_for_termination. There is no need to worry about reaping
2217 more than one child now.
2218 * sysdep.c (get_child_status, child_status_changed): New functions.
2219 (wait_for_termination): Now takes int * status and bool
2220 interruptible arguments, too. Do not record child status change;
2221 that's now the caller's responsibility. All callers changed.
2222 Reimplement in terms of get_child_status.
2223 (wait_for_termination_1, interruptible_wait_for_termination):
2224 Remove. All callers changed to use wait_for_termination.
2225 * syswait.h: Include <stdbool.h>, for bool.
2226 (record_child_status_change, interruptible_wait_for_termination):
2227 Remove decls.
2228 (record_deleted_pid, child_status_changed): New decls.
2229 (wait_for_termination): Adjust to API changes noted above.
2230
bc9dbce6
PE
2231 * bytecode.c, lisp.h (Qbytecode): Remove.
2232 No longer needed after 2012-11-20 interactive-p changes.
2233
3cf3c607
EZ
22342012-12-03 Eli Zaretskii <eliz@gnu.org>
2235
2236 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2237 the scroll margin, move point outside the margin. (Bug#13055)
2238
005c8d13
JD
22392012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2240
2241 * gtkutil.c (my_log_handler): New function.
2242 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2243
20edc1c9
DA
22442012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2245
2246 * lisp.h (modify_region): Rename to...
2247 (modify_region_1): ...new prototype.
2248 * textprop.c (modify_region): Now static. Adjust users.
2249 * insdel.c (modify_region): Rename to...
2250 (modify_region_1): ...new function to work with current buffer.
2251 Adjust comment and users. Use true and false for booleans.
2252
62c2e5ed
DA
22532012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2254
2255 * alloc.c (free_save_value): New function.
2256 (safe_alloca_unwind): Use it.
2257 * lisp.h (free_save_value): New prototype.
2258 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2259 Add comment.
2260 (save_excursion_restore): Adjust to match saved data structure.
2261 Use free_save_value to offload some work from GC. Drop obsolete
2262 #if 0 code.
2263
c5bc2d1d 22642012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
2265
2266 * fileio.c (Vauto_save_list_file_name): Doc fix.
2267
c5bc2d1d 22682012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
2269
2270 * w32fns.c: Remove prototype of atof.
1e101a4b 2271 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 2272 builds.
1e101a4b 2273 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
2274
2275 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2276 with 64-bit builds.
2277
2278 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2279 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2280 defined.
2281
c5bc2d1d 22822012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 2283
a9de9f0c 2284 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 2285
21e54a94
PE
22862012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2287
2dd2e622
PE
2288 Fix xpalloc confusion after memory is exhausted.
2289 * alloc.c (xpalloc): Comment fix.
2290 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2291 and signals an error, do not clear charset_table_size, as
2292 charset_table is still valid.
2293 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2294
21e54a94
PE
2295 Use execve to avoid need to munge environ (Bug#13054).
2296 * callproc.c (Fcall_process):
2297 * process.c (create_process):
2298 Don't save and restore environ; no longer needed.
2299 * callproc.c (child_setup):
2300 Use execve, not execvp, to preserve environ.
2301
3e5490f7
PE
23022012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2303
2304 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2305
75b4f59c
YM
23062012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2307
2308 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2309 display for sliced images (Bug#10500).
2310
2311 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2312
f8aff4c6
JB
23132012-11-30 Juanma Barranquero <lekktu@gmail.com>
2314
2315 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2316 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2317
3940b924
DA
23182012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2319
2320 * xdisp.c (window_outdated): Remove eassert since it hits
2321 some suspicious corner cases (see Bug#13007 and Bug#13012).
2322 (mode_line_update_needed): New function.
2323 (redisplay_internal, redisplay_window): Use it.
2324 (ensure_selected_frame): New function.
2325 (redisplay_internal, unwind_redisplay): Use it.
2326 (redisplay_internal): Move comment about buffer_shared...
2327 (buffer_shared_and_changed): ...near to its real use.
2328
4a9204fe
PE
23292012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2330
2331 * callproc.c (Fcall_process): Don't misreport vfork failure.
2332
60aeceb8
PE
23332012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2334
2335 * callproc.c (Fcall_process): Fix vfork portability problems.
2336 Do not assume that fd[0], count, filefd, and save_environ survive
2337 vfork. Fix bug whereby wrong errno value could be reported for
2338 pipe failure. Some minor cleanups, too, as follows. Move buf and
2339 bufsize to the context where they're needed. Change new_argv to
2340 be of type char **, as this is more convenient and avoids casts.
2341 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2342 Now local constants, not macros.
2343
00dc3ead
KH
23442012-11-18 Kenichi Handa <handa@gnu.org>
2345
2346 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2347 for the variable "f".
2348
e1bf05c1
KH
23492012-11-13 Kenichi Handa <handa@gnu.org>
2350
2351 * font.c (font_unparse_xlfd): Exclude special characters from the
2352 generating XLFD name.
2353
22626a85
PE
23542012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2355
350e0088
PE
2356 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2357 * dired.c (stat_uname, stat_gname):
2358 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2359
22626a85
PE
2360 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2361 * dired.c (directory_files_internal, file_name_completion):
2362 Assume EAGAIN and EINTR are defined.
350e0088 2363
22626a85
PE
2364 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2365 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2366 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2367 * lread.c (readbyte_from_file): Assume EINTR is defined.
2368 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2369 Assume EIO and EAGAIN are defined.
2370 * unexcoff.c (write_segment): Assume EFAULT is defined.
2371
5c9cf0a3 23722012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
2373
2374 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2375 (Bug#11964)
2376
22294a56
EZ
2377 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2378 highlighting on the frame was cleared. Prevents assertion
2379 violations when repeatedly clicking on the "Top" link of the
2380 "bread-crumbs" in Info buffers.
2381
5fbab051
PE
23822012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2383
2384 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2385
bcd77a2b
KB
23862012-11-24 Ken Brown <kbrown@cornell.edu>
2387
2388 * keyboard.c (HAVE_MOUSE):
2389 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2390 were always defined.
2391
d125ca15 23922012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 2393
24becea4
EZ
2394 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2395 between bpos_covered and bpos_max. This fixes cursor display when
2396 several display strings follow each other.
2397
8654a41b
EZ
2398 * .gdbinit (pgx): If the glyph's object is a string, display the
2399 pointer to string data, rather than the value of the string object
2400 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2401
cb5867b1
EZ
2402 * indent.c (Fvertical_motion): If the starting position is covered
2403 by a display string, return to one position before that, to avoid
2404 overshooting it inside move_it_to. (Bug#12930)
2405
f418b22e
DA
24062012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2407
2408 * frame.h (struct frame): Remove display_preempted member
2409 since all users are dead long ago.
2410 * nsterm.h (struct x_output): Use the only dummy member.
2411 * w32menu.c (pending_menu_activation): Remove since not
2412 really used.
2413 (set_frame_menubar): Adjust user.
2414 * w32term.h (struct x_output): Drop outdated #if 0 code.
2415 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
2416 asked_for_visible and menubar_active members.
2417 Drop unused pending_menu_activation member.
f418b22e
DA
2418 * xterm.h (struct x_output): Drop outdated #if 0 code.
2419 Use bitfields for explicit_parent, asked_for_visible,
2420 has_been_visible and net_wm_state_hidden_seen members.
2421
a879f0ea
EZ
24222012-11-23 Eli Zaretskii <eliz@gnu.org>
2423
2424 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2425 of a literal "/". (Bug#12955)
2426 (gl-stamp): Invoke fc.exe directly, not through cmd.
2427
95ef7787
PE
24282012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2429
2430 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2431 * dired.c: Assume HAVE_DIRENT_H.
2432 (NAMLEN): Remove, replacing with ...
2433 (dirent_namelen): New function. All uses changed. Use the GNU macro
2434 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2435 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2436 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2437 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2438 $(NT_INC)/dirent.h.
2439 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2440 * ndir.h: Rename to ../nt/inc/dirent.h.
2441 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2442 Do not include <dirent.h>; no longer needed.
2443 * w32.c: Include <dirent.h> rather than "ndir.h".
2444
12645ae6
CY
24452012-11-23 Chong Yidong <cyd@gnu.org>
2446
2447 * xftfont.c (xftfont_open): Remove duplicate assignment.
2448
5c747675
DA
24492012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2450
2451 * alloc.c (Fgarbage_collect): Unblock input after clearing
2452 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2453 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2454 * msdos.c (IT_frame_up_to_date): Use it here...
2455 * w32term.c (w32_frame_up_to_date): ...here...
2456 * xterm.c (XTframe_up_to_date): ...and here...
2457 * nsterm.m (ns_frame_up_to_date): ...but not here.
2458 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2459 Adjust users.
2460 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2461 Do not check whether GC is in progress.
2462
6ceeb5f1
DA
24632012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2464
2465 * xdisp.c (window_buffer_changed): New function.
2466 (update_menu_bar, update_tool_bar): Use it to
2467 simplify large 'if' statements.
2468 (redisplay_internal): Generalize commonly used
2469 'tail' and 'frame' local variables.
2470
ec84768f
EZ
24712012-11-22 Eli Zaretskii <eliz@gnu.org>
2472
2473 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2474 with Windows system header.
2475
9239d970
PE
24762012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2477
2478 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2479 * alloc.c: Assume unistd.h exists.
2480 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2481 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2482 (getwd) [USG]: Remove; no longer needed.
2483 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2484 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2485 * w32.h (getcwd): Remove decl.
2486
954bba56
SM
24872012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2488
2489 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2490 Make it set selected_window as well.
2491 (update_tool_bar): Use it.
2492
6ef2e5ef 24932012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
2494
2495 * emacs.c (main): Set the G_SLICE environment variable for all
2496 Cygwin builds, not just GTK builds. See
2497 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2498
6ef2e5ef 24992012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
2500
2501 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2502 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2503 Define for the MSVC compiler.
2504
6ef2e5ef 2505 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
2506
2507 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2508 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2509 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
2510 dostounix_filename assumes it gets a unibyte string.
2511 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
2512 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2513
eadf1faa
SM
25142012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2515
2516 Conflate Qnil and Qunbound for `symbol-function'.
2517 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2518 * lread.c (init_obarray): Set `function' fields to Qnil.
2519 * eval.c (Fcommandp): Ignore Qunbound.
2520 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2521 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2522 Test NILP rather than Qunbound.
2523 (Ffmakunbound): Set to Qnil.
2524 (Fsymbol_function): Never signal an error.
2525 (Finteractive_form): Ignore Qunbound.
2526
b83fdfa9
PE
25272012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2528
2529 * eval.c (interactive_p): Remove no-longer-used decl.
2530
952580c5
DA
25312012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2532
2533 * xdisp.c (buffer_shared): Adjust comment.
2534 (buffer_shared_and_changed): New function.
2535 (prepare_menu_bars, redisplay_internal): Use it to
2536 decide whether all windows or frames should be updated.
ea6de9b1
DA
2537 (window_outdated): New function.
2538 (text_outside_line_unchanged_p, redisplay_window): Use it.
2539 (redisplay_internal): Likewise. Fix indentation.
952580c5 2540
23ba2705
SM
25412012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2542
2543 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2544 (syms_of_eval): Remove corresponding defsubr.
2545 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2546
6e9f7997
DC
25472012-11-19 Daniel Colascione <dancol@dancol.org>
2548
2549 * w32fns.c (Fx_file_dialog):
2550 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2551 cygwin_convert_file_name*.
2552
2553 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2554 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2555
552a1590
PE
25562012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2557
2558 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2559
2ac9538d 25602012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
2561
2562 * w32select.c: Include w32common.h before w32term.h, so that
2563 windows.h gets included before w32term.h uses some of its
2564 features, see below.
2565
23ba2705
SM
2566 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2567 New typedefs.
2568 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2569 New prototypes.
d8715cdf
EZ
2570 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2571
2ac9538d 25722012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
2573
2574 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2575 (ns_select): Return at once if events are held (Bug#12834).
2576
2ac9538d 25772012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 2578
2579 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2580 Needed following 2012-10-20 change. (Bug#12902)
2581
c1f7ba3a
JB
25822012-11-18 Juanma Barranquero <lekktu@gmail.com>
2583
2584 * w32proc.c (waitpid): Remove unused label get_result.
2585
a75ce9d3
JB
25862012-11-17 Juanma Barranquero <lekktu@gmail.com>
2587
2588 * makefile.w32-in (SYSWAIT_H): New macro.
2589 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2590 ($(BLD)/sysdep.$(O)): Update dependencies.
2591
49cdacda
PE
25922012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2593
2594 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2595 * callproc.c (relocate_fd): Assume F_DUPFD.
2596 * emacs.c, term.c (O_RDWR): Remove.
2597 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2598 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2599 * nsterm.m: Assume <fcntl.h> exists.
2600 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2601 (create_pty, Fmake_network_process, server_accept_connection)
2602 (wait_reading_process_output, init_process_emacs):
2603 Assume O_NONBLOCK.
2604 (wait_reading_process_output): Put in a special case for WINDOWSNT
2605 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2606 It's not clear this is needed, but it's a more-conservative change.
2607 (create_process): Assume FD_CLOEXEC.
2608 (create_process, create_pty): Assume O_NOCTTY.
2609 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2610 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2611 Omit if not DOS_NT, since F_GETFL is not defined there.
2612 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2613 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2614 (O_NOCTTY): Remove.
2615 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2616 lack it, since gnulib guarantees this.
2617 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2618
22bae83f
EZ
26192012-11-17 Eli Zaretskii <eliz@gnu.org>
2620
6ad30855
EZ
2621 * w32.c (faccessat): Pretend that directories have the execute bit
2622 set. Emacs expects that, e.g., in files.el:cd-absolute.
2623
22bae83f
EZ
2624 * w32proc.c (create_child): Don't clip the PID of the child
2625 process to fit into an Emacs integer, as this is no longer a
2626 restriction.
2627 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2628 reaping only the process specified by PID argument, if that is
2629 positive. Use PID instead of dead_child to know which process to
2630 reap. Wait for the child to die only if WNOHANG is not in
2631 OPTIONS.
2632 (sys_select): Don't set dead_child.
2633
2634 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2635 as it is no longer needed.
2636
2637 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2638 no longer needed.
2639 (record_child_status_change): Remove the setting of
2640 record_at_most_one_child for the !WNOHANG case.
2641
a631d0e0
PE
26422012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2643
2644 Fix problems in ns port found by static checking.
2645 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2646 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2647 not to process group.
2648 (ns_select): Use emacs_write, not write, as that's more robust
2649 in the presence of signals.
2650 (fd_handler:): Check for read errors.
2651
d56f2e49
GM
26522012-11-16 Glenn Morris <rgm@gnu.org>
2653
2654 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2655
96e05507 26562012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
2657
2658 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2659
96e05507 26602012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
2661
2662 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2663 use the same value of thread handle.
2664 (start_timer_thread): If the timer thread exited (due to error),
2665 clean up by closing the two handles it used. Duplicate the caller
2666 thread's handle here, so it gets duplicated only once, when
2667 launching the timer thread. Set priority of the timer thread, not
2668 the caller thread.
2669 (getitimer): Don't duplicate the caller thread's handle here.
2670 (Bug#12832)
2671
96e05507 26722012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
2673
2674 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2675 called (Bug#12834).
2676
3d082a26
PE
26772012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2678
2679 Remove no-longer-used pty_max_bytes variable.
2680 * process.c (pty_max_bytes): Remove; unused.
2681 (send_process): Do not set it.
2682
b72c161c
JB
26832012-11-15 Juanma Barranquero <lekktu@gmail.com>
2684
2685 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2686 Update dependencies.
2687
bf20ea80
PE
26882012-11-15 Paul Eggert <eggert@cs.ucla.edu>
2689
2690 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
2691 This follows up on the 2012-09-29 patch that removed indirection
2692 for the 'function' field. Reported by Sergey Vinokurov in
2693 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
2694
14f20728
EZ
26952012-11-14 Eli Zaretskii <eliz@gnu.org>
2696
2697 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
2698 different name, as the MS runtime does not have such a function,
2699 and probably never will.) All callers changed. Ignore DIRFD
2700 value if PATH is an absolute file name, to match Posix spec
2701 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
2702 symlinks.
2703
77731919
DA
27042012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
2705
2706 * xdisp.c (echo_area_display, redisplay_internal):
2707 Omit redundant check whether frame_garbaged is set.
2708
73dcdb9f
PE
27092012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2710
2711 Use faccessat, not access, when checking file permissions (Bug#12632).
2712 This fixes a bug that has been present in Emacs since its creation.
2713 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
2714 which must set some sort of record. (Torek's bug report was against
2715 a predecessor of GNU Emacs, but GNU Emacs happened to have the
2716 same common flaw.) See Torek's Usenet posting
2717 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
2718 Posted: Fri Apr 8 14:18:56 1983.
2719 * Makefile.in (LIB_EACCESS): New macro.
2720 (LIBES): Use it.
2721 * callproc.c (init_callproc):
2722 * charset.c (init_charset):
2723 * fileio.c (check_existing, check_executable, check_writable)
2724 (Ffile_readable_p):
2725 * lread.c (openp, load_path_check):
2726 * process.c (allocate_pty):
2727 * xrdb.c (file_p):
2728 Use effective UID when checking permissions, not real UID.
2729 * callproc.c (init_callproc):
2730 * charset.c (init_charset):
2731 * lread.c (load_path_check, init_lread):
2732 Test whether directories are accessible, not merely whether they exist.
2733 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
2734 * fileio.c (check_existing, check_executable, check_writable)
2735 (Ffile_readable_p):
2736 Use symbolic names instead of integers for the flags, as they're
2737 portable now.
2738 (check_writable): New arg AMODE. All uses changed.
2739 Set errno on failure.
2740 (Ffile_readable_p): Use faccessat, not stat + open + close.
2741 (Ffile_writable_p): No need to call check_existing + check_writable.
2742 Just call check_writable and then look at errno. This saves a syscall.
2743 dir should never be nil; replace an unnecessary runtime check
2744 with an eassert. When checking the parent directory of a nonexistent
2745 file, check that the directory is searchable as well as writable, as
2746 we can't create files in unsearchable directories.
2747 (file_directory_p): New function, which uses 'stat' on most platforms
2748 but faccessat with D_OK (for efficiency) if WINDOWSNT.
2749 (Ffile_directory_p, Fset_file_times): Use it.
2750 (file_accessible_directory_p): New function, which uses a single
2751 syscall for efficiency.
2752 (Ffile_accessible_directory_p): Use it.
2753 * xrdb.c (file_p): Use file_directory_p.
2754 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
2755 * lread.c (openp): When opening a file, use fstat rather than
2756 stat, as that avoids a permissions race. When not opening a file,
2757 use file_directory_p rather than stat.
2758 (dir_warning): First arg is now a usage string, not a format.
2759 Use errno. All uses changed.
2760 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
2761 that merely introduced a race.
2762 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
2763 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
2764 and similarly for the other O_* flags.
2765 * w32.c (sys_faccessat): Rename from sys_access and switch to
2766 faccessat's API. All uses changed.
2767 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
2768 (magic_db): Rename from magic_file_p.
2769 (magic_db, search_magic_path): Return an XrmDatabase rather than a
2770 char *, so that we don't have to test for file existence
2771 separately from opening the file for reading. This removes a race
2772 fixes a permission-checking problem, and simplifies the code.
2773 All uses changed.
2774 (file_p): Remove; no longer needed.
2775
2a14f83b
DA
27762012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2777
2778 Omit glyphs initialization at startup.
2779 * dispnew.c (glyphs_initialized_initially_p): Remove.
2780 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2781 (Fredraw_frame): Move actual code from here...
c7085245 2782 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
2783 (Fredraw_display): Use redraw_frame.
2784 * xdisp.c (clear_garbaged_frames): Likewise.
2785
f78ee6af 27862012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
2787
2788 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2789 passed to pint2str and pint2hrstr to be at most the size of the
2790 frame's decode_mode_spec_buffer. This avoids crashes with very
2791 large values of FIELD_WIDTH argument to decode_mode_spec.
2792 (Bug#12867)
2793
b95a9c0c
PE
27942012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2795
2796 Fix a race with verify-visited-file-modtime (Bug#12863).
2797 Since at least 1991 Emacs has ignored an mtime difference of no
2798 more than one second, but my guess is that this was to work around
2799 file system bugs that were fixed long ago. Since the race is
2800 causing problems now, let's remove that code.
2801 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2802 whose time stamp is off by no more than a second. Insist that the
2803 file time stamps match exactly.
2804
be49ba74
DA
28052012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2806
2807 * frame.h (struct frame): Convert external_tool_bar member to
2808 1-bit unsigned bitfield.
2809 * termhooks.h (struct terminal): Remove mouse_moved member since
2810 all users are long dead. Adjust comment on mouse_position_hook.
2811
5b04e9f9
DA
28122012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2813
2814 Simplify by using FOR_EACH_FRAME here and there.
2815 * frame.c (next_frame, prev_frame, other_visible_frames)
2816 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2817 * w32term.c (x_window_to_scroll_bar): Likewise.
2818 * window.c (window_list): Likewise.
2819 * xdisp.c (x_consider_frame_title): Likewise.
2820 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2821 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2822 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2823 * xmenu.c (menubar_id_to_frame): Likewise.
2824 * xselect.c (frame_for_x_selection): Likewise.
2825 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2826 (x_window_to_menu_bar): Likewise.
2827 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2828
76ae24d7
PE
28292012-11-12 Paul Eggert <eggert@cs.ucla.edu>
2830
12cc4337
PE
2831 * data.c (Qdefalias_fset_function): Now static.
2832
76ae24d7
PE
2833 Another tweak to vectorlike_header change.
2834 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
2835 Remove, and replace all uses with ...
2836 (next_in_free_list, set_next_in_free_list):
2837 New functions, which respect C's aliasing rules better.
2838
1479c557
PE
28392012-11-11 Paul Eggert <eggert@cs.ucla.edu>
2840
2841 * window.c (list4i): Rename from 'quad'. All uses changed.
2842 Needed because <sys/types.h> defines 'quad' on Solaris 10.
2843
11235c03
JB
28442012-11-11 Juanma Barranquero <lekktu@gmail.com>
2845
2846 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
2847 warning about mixing declarations and code in ISO C90.
2848
6baf66d5 28492012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
2850
2851 * window.c (Fsplit_window_internal): Set combination limit of
2852 new parent window to t iff Vwindow_combination_limit is t;
2853 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 2854 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 2855
6baf66d5 28562012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
2857
2858 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
2859 amount when the scroll margins are too large. When scrolling
2860 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
2861 scroll margin within a reasonable number of screen lines.
2862 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
2863 point is positioned many lines beyond the window top/bottom.
2864 (Bug#12811)
2865
508f51f5
EZ
2866 * ralloc.c (relinquish): If real_morecore fails to return memory
2867 to the system, don't crash; instead, leave the last heap
2868 unchanged and return. (Bug#12774)
2869
32e5c58c
SM
28702012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2871
2872 * lisp.h (AUTOLOADP): New macro.
2873 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
2874 * data.c (Ffset): Remove special ad-advice-info handling.
2875 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
2876 (Fsubr_arity): CSE.
2877 (Finteractive_form): Simplify.
2878 (Fquo): Don't insist on having at least 2 arguments.
2879 (Qdefalias_fset_function): New var.
2880
719b0aa5
JD
28812012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2882
4ab15c3e
JD
2883 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
2884
719b0aa5
JD
2885 * nsfont.m (Qcondensed, Qexpanded): New variables.
2886 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
2887 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
2888
535cc8e9
DA
28892012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2890
2891 Fix recently introduced crash on MS-Windows (Bug#12839).
2892 * w32term.h (struct scroll_bar): Use convenient header.
2893 (SCROLL_BAR_VEC_SIZE): Remove.
2894 * w32term.c (x_scroll_bar_create): Use VECSIZE.
2895
7d377c48
DA
28962012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2897
2898 Tweak last vectorlike_header change.
2899 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
2900 vectorlike object on the free list. This is introduced to avoid
2901 some (but not all) pointer casting and aliasing problems, see
2902 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
2903 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
2904 objects.
2905 (xvectype, xvecsize): Use them to examine Lisp_Object values.
2906
7ad27466
JD
29072012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2908
32e5c58c 2909 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
2910 been removed, so remove them here also.
2911
57618ecf
SM
29122012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2913
2914 * doc.c (Fdocumentation): Handle new property
2915 dynamic-docstring-function to replace the old ad-advice-info.
2916
53371430
PE
29172012-11-09 Paul Eggert <eggert@cs.ucla.edu>
2918
2919 * fns.c (Qeql, hashtest_eq): Now static.
2920
61ddb1b9
SM
29212012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2922
2923 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
2924 * fns.c (hashfn_eq, hashfn_eql, sxhash):
2925 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
2926 * buffer.c (compare_overlays): Use XLI rather than XHASH.
2927
04a2d0d3
PE
29282012-11-08 Paul Eggert <eggert@cs.ucla.edu>
2929
2930 Use same hash function for hashfn_profiler as for hash_string etc.
2931 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
2932 * lisp.h (sxhash_combine): New inline function, with the contents
2933 of the old SXHASH_COMBINE.
2934 * profiler.c (hashfn_profiler): Use it, instead of having a
2935 special hash function containing a comparison that always yields 1.
2936
de5ef41a
SM
29372012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2938
2939 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
2940 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
2941 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
2942 Remove unused vars.
2943
a23c4171
JD
29442012-11-08 Jan Djärv <jan.h.d@swipnet.se>
2945
2946 * image.c (xpm_make_color_table_h): Fix compiler error because
2947 make_hash_table changed.
2948
0b59090b 29492012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
2950
2951 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
2952
b7432bb2
SM
29532012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2954
2955 Use ad-hoc comparison function for the profiler's hash-tables.
2956 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
2957 (make_log): Use them.
2958 (handle_profiler_signal): Don't inhibit quit any longer since we don't
2959 call Fequal any more.
2960 (Ffunction_equal): New function.
2961 (cmpfn_profiler, hashfn_profiler): New functions.
2962 (syms_of_profiler): Initialize them.
2963 * lisp.h (struct hash_table_test): New struct.
2964 (struct Lisp_Hash_Table): Use it.
2965 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
2966 * fns.c (make_hash_table): Take a struct to describe the test.
2967 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
2968 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
2969 (hash_lookup, hash_remove_from_table): Move assertion checking of
2970 hashfn result here. Check hash-equality before calling cmpfn.
2971 (Fmake_hash_table): Adjust call to make_hash_table.
2972 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
2973 (syms_of_fns): Initialize them.
2974 * emacs.c (main): Move syms_of_fns earlier.
2975 * xterm.c (syms_of_xterm):
2976 * category.c (hash_get_category_set): Adjust call to make_hash_table.
2977 * print.c (print_object): Adjust to new hash-table struct.
2978 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
2979
88002743
EZ
29802012-11-08 Eli Zaretskii <eliz@gnu.org>
2981
2982 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
2983 value of w32-scroll-lock-modifier is neither nil nor one of the
2984 known key modifiers. (Bug#12806)
2985
914adc42
DA
29862012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2987
2988 Shrink struct vectorlike_header to the only size field.
2989 * lisp.h (enum pvec_type): Avoid explicit enum member values.
2990 Adjust comment.
2991 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
2992 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
2993 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
2994 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
2995 information from the vector header. Adjust comment.
2996 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
2997 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
2998 layout.
2999 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3000 (struct vectorlike_header): Remove next member. Adjust comment.
3001 (struct Lisp_Subr): Add convenient header. Adjust comment.
3002 (allocate_pseudovector): Adjust prototype.
3003 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3004 (sweep_string, lisp_malloc): Remove useless prototypes.
3005 (enum mem_type): Adjust comment.
3006 (NEXT_IN_FREE_LIST): New macro.
3007 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3008 (Fmake_bool_vector): Likewise.
3009 (struct large_vector): New type to represent allocation unit for
3010 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3011 (large_vectors): Change type to struct large_vector.
3012 (allocate_vector_from_block): Simplify.
3013 (PSEUDOVECTOR_NBYTES): Replace with...
3014 (vector_nbytes): ...new function. Adjust users.
3015 (sweep_vectors): Adjust processing of large vectors.
3016 (allocate_vectorlike): Likewise.
3017 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3018 Add easserts. Adjust XSETPVECTYPESIZE usage.
3019 (allocate_buffer): Use BUFFER_PVEC_INIT.
3020 (live_vector_p): Adjust to match large vector.
3021 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3022 * buffer.h (struct buffer): Add next member.
3023 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3024 New macros.
3025 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3026 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3027 (copy_hash_table): Adjust to match vector header change.
3028 * lread.c (defsubr): Use XSETPVECTYPE.
3029 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3030 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3031 (xvecsize): New command.
3032
c66f21ea
DA
30332012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3034
3035 * keyboard.c (event_to_kboard): Do not dereference
3036 frame_or_window field of SELECTION_REQUEST_EVENT
3037 and SELECTION_CLEAR_EVENT events (Bug#12814).
3038 * xterm.h (struct selection_input_event): Adjust comment.
3039
eb147960
EZ
30402012-11-07 Eli Zaretskii <eliz@gnu.org>
3041
dab72075
EZ
3042 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3043 such as Scroll Lock, if the respective keys are treated as
3044 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 3045 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 3046
5890e400
DA
30472012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3048
3049 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3050
b6b3b294
PE
30512012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3052
3053 Restore some duplicate definitions (Bug#12814).
3054 This undoes part of the 2012-11-03 changes. Some people build
3055 with plain -g rather than with -g3, and they need the duplicate
3056 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3057 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3058 Define as macros, as well as as enums or as constants.
3059
e770aad5
JD
30602012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3061
3062 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3063 to keypad keys (Bug#12816).
3064
68f8f1c0
PE
30652012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3066
3067 Minor adjustments of recently-changed frame functions.
3068 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3069 known to be a frame (we're in the FRAMEP branch).
3070 * lisp.h (Qframep): Remove decl. frame.h declares this.
3071 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3072 since they're meant for Lisp fixnum values.
3073
72f94d4b
DA
30742012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3075
3076 * window.c (Fwindow_combination_limit): Revert to the only
3077 required argument and adjust docstring as suggested in
3078 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3079 by Martin Rudalics <rudalics@gmx.at>.
3080
d9f07150
DA
30812012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3082
3083 Widely used frame validity and checking functions.
3084 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3085 * frame.c (decode_live_frame, decode_any_frame): New functions.
3086 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3087 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3088 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3089 (Fframe_pointer_visible_p): Use decode_any_frame.
3090 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3091 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3092 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3093 (Fframe_focus): Likewise. Allow zero number of arguments.
3094 Adjust docstring.
3095 (frame_buffer_list, frame_buffer_predicate): Remove.
3096 * lisp.h (frame_buffer_predicate): Remove prototype.
3097 * buffer.c (Fother_buffer): Use decode_any_frame.
3098 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3099 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3100 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3101 (Fclose_font, Ffont_info): Use decode_live_frame.
3102 * fontset.c (check_fontset_name): Likewise.
3103 * terminal.c (Fframe_terminal): Likewise.
3104 * w32fns.c (check_x_frame): Likewise.
3105 * window.c (Fminibuffer_window, Fwindow_at)
3106 (Fcurrent_window_configuration): Likewise.
3107 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3108 Likewise. Allow zero number of arguments. Adjust docstring.
3109 * dispnew.c (Fredraw_frame): Likewise.
3110 * xfaces.c (frame_or_selected_frame): Remove.
3111 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3112 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3113 (Fframe_face_alist): Use decode_live_frame.
3114 * xfns.c (check_x_frame): Likewise.
3115
89bc0592
DA
31162012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3117
3118 * window.c (quad): New function.
3119 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3120 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3121 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3122 (Fwindow_line_height): Use it.
3123 (Fwindow_fringes): Use list3.
3124 (Fwindow_scroll_bars): Use list4.
3125 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3126 (Fwindow_combination_limit): Allow zero number of arguments.
3127
c8e3a9c3
EZ
31282012-11-05 Eli Zaretskii <eliz@gnu.org>
3129
3130 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3131
8e2417bf 3132 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 3133 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 3134 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 3135
209c6a58
CY
31362012-11-05 Chong Yidong <cyd@gnu.org>
3137
3138 * process.c (wait_reading_process_output): Revert previous change.
3139
8148369c
PE
31402012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3141
dd0333b6
PE
3142 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3143 This removes code that has been obsolete since around 1990.
3144 * callproc.c (Fcall_process):
3145 * emacs.c (main):
3146 * process.c (create_process):
3147 * term.c (dissociate_if_controlling_tty):
3148 Assume setsid exists.
3149 * callproc.c (child_setup): Assume setpgid exists and behaves as
3150 per POSIX.1-1988 or later.
3151 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3152 * emacs.c (shut_down_emacs):
3153 * sysdep.c (sys_suspend, init_foreground_group):
3154 Assume getpgrp behaves as per POSIX.1-1998 or later.
3155 * msdos.c (setpgrp): Remove.
3156 (tcgetpgrp, setpgid, setsid): New functions.
3157 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3158 * term.c (no_controlling_tty): Remove; unused.
3159 * w32proc.c (setpgrp): Remove.
3160 (setsid, tcgetpgrp): New functions.
3161
8148369c
PE
3162 Simplify by assuming __fpending.
3163 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3164 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3165 Do not assume that __fpending's result fits in int.
3166
76abf5e5
PE
31672012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3168
06b63c9b
PE
3169 Remove EMACS_OUTQSIZE+sleep hack.
3170 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
3171 than 2400 bps, which throttled Emacs by having it sleep.
3172 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
3173 was added, and anyway those old terminals are long dead.
3174 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3175 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3176
76abf5e5
PE
3177 Fix data-loss with --version (Bug#9574).
3178 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3179 as we can't assume that emacs_strerror is initialized, and strerror
3180 is good enough here.
3181 (main): Invoke atexit earlier, to catch earlier instances of
3182 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3183
8f31e74b
MM
31842012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3185
3186 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3187 (keyDown): Remap keypad keys to X11 virtual key codes.
3188
0d879dca
PE
31892012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3190
7ccfb720
PE
3191 Fix data-loss with --batch (Bug#9574).
3192 * emacs.c: Include <close-stream.h>.
3193 (close_output_streams): New function.
3194 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3195 and handles errors appropriately.
3196 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3197 does that now.
3198
0b3d4a47
PE
3199 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3200 The symptom is a diagnostic "GLib-WARNING **: In call to
3201 g_spawn_sync(), exit status of a child process was requested but
3202 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3203 waitpid(), so exit status can't be returned." The diagnostic
3204 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3205 The real bug is a race condition between Emacs and glib: Emacs
3206 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3207 so that glib can't find it. Work around the bug by invoking
3208 waitpid only on subprocesses that Emacs itself creates.
3209 * process.c (create_process, record_child_status_change):
3210 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
3211 know the pid rather than having the callee infer it.
3212 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
3213 (create_process): Set new 'alive' member if child is created.
3214 (process_status_retrieved): New function.
3215 (record_child_status_change): Use it.
3216 Accept negative 1st argument, which means to wait for the
3217 processes that Emacs already knows about. Move special-case code
3218 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3219 processes that have already been waited for, by testing and
3220 clearing new 'alive' member.
3221 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3222 now does this internally.
3223 (handle_child_signal): Let record_child_status_change do all
3224 the work, since we do not want to reap all exited child processes,
3225 only the child processes that Emacs itself created.
3226 * process.h (Lisp_Process): New boolean member 'alive'.
3227
0d879dca
PE
3228 Omit duplicate definitions no longer needed with gcc -g3.
3229 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3230 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3231 Define only as macros. There's no longer any need to also define
3232 these symbols as enums or as constants, since we now assume
3233 gcc -g3 when debugging.
3234
3478f4b5
EZ
32352012-11-03 Eli Zaretskii <eliz@gnu.org>
3236
3237 * lisp.mk: Adjust comments to the fact that term/internal is now
3238 loaded from loadup.el.
3239
3240 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3241 (msdos_fatal_signal): New function.
3242 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3243 its argument list.
3244
3245 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3246 for GCC versions before 4.
3247 (emacs_raise): Define to call msdos_fatal_signal.
3248
3249 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3250 iterator when starting in the middle of a display or overlay
3251 string. (Bug#12745)
3252
85fabcb7
CY
32532012-11-03 Chong Yidong <cyd@gnu.org>
3254
3255 * process.c (wait_reading_process_output): Clean up the last
3256 change.
3257
893cc455
CY
32582012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3259
3260 * process.c (wait_reading_process_output): Avoid a race condition
3261 with SIGIO delivery (Bug#11536).
3262
0f7b074f
CY
32632012-11-03 Chong Yidong <cyd@gnu.org>
3264
3265 * buffer.c (cursor_type): Untabify docstring.
3266
3737fee7
DA
32672012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3268
3269 * frame.h (struct frame): Drop can_have_scroll_bars member
3270 which is meaningless for a long time. Adjust comments.
3271 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3272 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3273
b6a9e8b1
DA
32742012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3275
3276 * window.c (decode_next_window_args): Update window arg after
3277 calling decode_live_window and so fix crash reported at
3278 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3279 by Juanma Barranquero <lekktu@gmail.com>.
3280 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3281 * font.c (Ffont_at): Likewise.
3282
600d4768
JD
32832012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3284
3285 * widget.c (resize_cb): New function.
3286 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3287 (EmacsFrameResize): Check if all is up to date before changing frame
3288 size.
3289
1005b4b9
EZ
32902012-11-02 Eli Zaretskii <eliz@gnu.org>
3291
3292 Implement backtrace output for fatal errors on MS-Windows.
3293 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3294 (BACKTRACE_LIMIT_MAX): New macro.
3295 (w32_backtrace): New function.
3296 (emacs_abort): Use w32_backtrace when the user chooses not to
3297 attach a debugger. Update the text of the abort dialog.
3298
b9e9df47
DA
32992012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3300
3301 Window-related stuff cleanup here and there.
3302 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3303 Use decode_any_window.
3304 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3305 * xdisp.c (Fformat_mode_line): Likewise.
3306 * font.c (Ffont_at): Use decode_live_window.
3307 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3308 * window.c (decode_next_window_args): Likewise.
3309 (decode_any_window): Remove static.
3310 * window.h (decode_any_window): Add prototype.
3311 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3312 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3313 respectively.
3314
2b371ff7
DA
33152012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3316
3317 Remove pad from struct input_event.
3318 * termhooks.h (struct input_event): Remove padding field.
3319 Adjust comment.
3320 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3321 member is never cons for a long time. Adjust comment.
3322 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3323 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3324 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3325 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3326
7e8b50d9
EZ
33272012-11-01 Eli Zaretskii <eliz@gnu.org>
3328
3329 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3330
322aea6d
PE
33312012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3332
3333 Fix crash when using Emacs as commit editor for git (Bug#12697).
3334 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3335 and it is configured in conf_post.h.
3336 (Fcall_process): Don't invoke both setsid and setpgid; the former
3337 is enough, if it exists.
3338 * callproc.c (Fcall_process, child_setup):
3339 * process.c (create_process): Use setpgid.
3340 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3341 for the real thing.
3342 * dispnew.c (init_display): Initialize the foreground group
3343 if we are running a tty display.
3344 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3345 * lisp.h (init_foreground_group): New decl.
3346 * sysdep.c (inherited_pgroup): New static var.
3347 (init_foreground_group, tcsetpgrp_without_stopping)
3348 (narrow_foreground_group, widen_foreground_group): New functions.
3349 (init_sys_modes): Narrow foreground group.
3350 (reset_sys_modes): Widen foreground group.
3351
220cb2bd
MA
33522012-10-31 Michael Albinus <michael.albinus@gmx.de>
3353
3354 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3355
218e997a
MR
33562012-10-31 Martin Rudalics <rudalics@gmx.at>
3357
3358 * minibuf.c (read_minibuf): Restore current buffer since
3359 choose_minibuf_frame calling Fset_frame_selected_window may
3360 change it (Bug#12766).
3361
02615da0
JD
33622012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3363
3364 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3365
aee5b18e
KH
33662012-10-30 Kenichi Handa <handa@gnu.org>
3367
3368 * font.c (Ffont_at): If WINDOW is specified and it is not
3369 displaying the current buffer, signal an error.
3370
ba116008
DC
33712012-10-29 Daniel Colascione <dancol@dancol.org>
3372
de5ef41a
SM
3373 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3374 In preparation for fixing bug#12739, move these functions from
ba116008
DC
3375 here...
3376
3377 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
3378 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3379 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 3380
640bf8ad
EZ
33812012-10-28 Eli Zaretskii <eliz@gnu.org>
3382
3383 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3384 (timer_loop, getitimer, setitimer): Use it instead of
3385 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3386 'clock'.
3387 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3388 literal 10000.
3389
64ccff5f
JD
33902012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3391
3392 * nsterm.m (NO_APPDEFINED_DATA): New define.
3393 (last_appdefined_event_data): New variable
3394 (last_appdefined_event): Remove.
3395 (ns_select): Initialize t from last_appdefined_event_data instead
3396 of [last_appdefined_event data1].
3397 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3398 remove last_appdefined_event (Bug#12698).
3399
e483264c
SM
34002012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3401
3402 * frame.c (x_set_font): Catch internal error.
3403
6c16c13e
EZ
34042012-10-27 Eli Zaretskii <eliz@gnu.org>
3405
e483264c
SM
3406 Avoid overflow in w32 implementation of interval timers.
3407 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
3408 actually executes.
3409 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
3410 'volatile ULONGLONG' types. All the other data which was
3411 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
3412 (GetThreadTimes_Proc): New typedef.
3413 (w32_get_timer_time): New function, returns a suitable time value
3414 for the timer.
3415 (timer_loop): Enter critical section when accessing ULONGLONG
3416 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
3417 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3418 Remove unused variable.
6c16c13e
EZ
3419 (init_timers): Initialize s_pfn_Get_Thread_Times.
3420 (start_timer_thread): Don't assign itimer->caller_thread here.
3421 (getitimer): Assign itimer->caller_thread here.
3422 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 3423 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 3424
ccc83f50
EZ
34252012-10-26 Eli Zaretskii <eliz@gnu.org>
3426
3427 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3428 mouse movement events if the menu bar is active. This avoids
3429 producing a busy "hour-glass" cursor by Windows if the mouse
3430 pointer is positioned over a tooltip shown for some menu item.
3431
69deda53
PE
34322012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3433
3434 Don't assume process IDs fit in int.
3435 * emacs.c (shut_down_emacs) [!DOS_NT]:
3436 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3437 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3438 Use pid_t, not int, to store process IDs, as 'int'
3439 is not wide enough on a few platforms (e.g., AIX and IRIX).
3440
7e70a152
KH
34412012-10-23 Kenichi Handa <handa@gnu.org>
3442
3443 The following change is to make face-font-rescale-alist work
3444 correctly for non-ASCII fonts.
3445
3446 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3447 (font_open_for_lface): Handle Vface_font_rescale_alist.
3448
49238e7f
CY
34492012-10-23 Chong Yidong <cyd@gnu.org>
3450
3451 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3452
5ec86886
JD
34532012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3454
ef446959
JD
3455 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3456 for screen font.
3457 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3458
5ec86886
JD
3459 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3460 event (Bug#12681).
3461
ee7a418d
GM
34622012-10-21 Glenn Morris <rgm@gnu.org>
3463
3464 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3465
4973679b
PE
34662012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3467
3468 Port to OpenBSD 5.1.
3469 * frame.c (Fmouse_position, Fmouse_pixel_position):
3470 * xdisp.c (produce_stretch_glyph):
3471 Declare local vars only when they're needed.
3472 This is clearer and avoids a warning on OpenBSD about unused vars.
3473 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3474 This is safer, and avoids OpenBSD warnings about unused vars.
3475 * keyboard.c (record_menu_key): Remove unnecessary decl.
3476 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3477 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3478 as our definition clashes with OpenBSD's.
3479 * xfaces.c (load_face_colors, check_lface_attrs)
3480 (get_lface_attributes_no_remap, get_lface_attributes)
3481 (lface_fully_specified_p, x_supports_face_attributes_p)
3482 (tty_supports_face_attributes_p, face_fontset, realize_face)
3483 (realize_x_face, realize_tty_face):
3484 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3485 merely Lisp_Object *. This is more informative and avoids
3486 a warning on OpenBSD about accessing beyond an object's size.
3487
c664f463
CY
34882012-10-20 Chong Yidong <cyd@gnu.org>
3489
3490 * lread.c (Fload): Doc fix (Bug#12592).
3491
6ec83f92 34922012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
3493
3494 * font.c (Ffont_at): Fix previous change.
3495
d2824928
EZ
34962012-10-19 Eli Zaretskii <eliz@gnu.org>
3497
e483264c
SM
3498 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3499 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
3500 for the reasons.
3501
d2824928
EZ
3502 * alloc.c (NSTATICS): Decrease to 0x800.
3503
f60d391f
SM
35042012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3505
4a0e1924 3506 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
3507 error (bug#12677).
3508
1a9327d5
JD
35092012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3510
3511 * nsterm.m (ns_select): Check writefds before call to
3512 FD_ISSET (Bug#12668).
3513
14145a1e
DC
35142012-10-18 Daniel Colascione <dancol@dancol.org>
3515
3516 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3517 (staticpro): If we run out of staticpro slots, die with an
3518 informative error instead of just calling emacs_abort.
3519
1f76f6f5
MR
35202012-10-18 Martin Rudalics <rudalics@gmx.at>
3521
3522 Fix two flaws reported by Dmitry Antipov.
3523 * window.c (Ftemp_output_buffer_show): Remove.
3524 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3525 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3526
fcf14875
EZ
35272012-10-17 Eli Zaretskii <eliz@gnu.org>
3528
1f76f6f5
MR
3529 * makefile.w32-in ($(BLD)/w32.$(O)):
3530 ($(BLD)/vm-limit.$(O)):
3531 ($(BLD)/term.$(O)):
3532 ($(BLD)/unexw32.$(O)):
3533 ($(BLD)/fileio.$(O)):
a68089e4
EZ
3534 ($(BLD)/dispnew.$(O)): Update dependencies.
3535
3536 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3537 Add prototypes.
3538
3539 * w32proc.c: Include ctype.h.
3540
3541 * w32.h (init_environment, check_windows_init_file)
3542 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3543 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3544 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3545 (sys_link): Add prototypes.
3546
3547 * w32.c: Include w32select.h.
3548 (sys_access, e_malloc, sys_select): Add prototypes.
3549 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3550
3551 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3552
3553 * unexw32.c: Include lisp.h and w32.h.
3554
3555 * term.c [WINDOWSNT]: Include w32term.h.
3556
3557 * process.c [WINDOWSNT]: Add prototype of sys_select.
3558
3559 * fileio.c [WINDOWSNT]: Include w32.h.
3560
3561 * dispnew.c [WINDOWSNT]: Include w32.h.
3562
fcf14875
EZ
3563 * cygw32.c (Fcygwin_convert_path_to_windows)
3564 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3565 Lisp_Object values. (Bug#12661)
3566
3567 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3568 to Lisp_Object. (Bug#12661)
3569
fe0b1ec4
KH
35702012-10-17 Kenichi Handa <handa@gnu.org>
3571
3572 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3573 invalidate.
3574
d556ebf9
DA
35752012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3576
3577 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 3578 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 3579
f0863a54
DA
35802012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3581
3582 Do not verify indirection counters of killed buffers (Bug#12579).
3583 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3584 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3585
12fbe755
DA
35862012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3587
3588 * alloc.c (Fmake_byte_code): Fix typo in comment.
3589 * print.c (print_interval): Define as static to match prototype.
3590 * indent.c (disptab_matches_widthtab, recompute_width_table):
3591 Convert to eassert.
3592
61655b89
DA
35932012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3594
3595 * editfns.c (get_system_name): Remove.
3596 * lisp.h (get_system_name): Remove prototype.
3597 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3598 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3599
9520f2f2
DC
36002012-10-15 Daniel Colascione <dancol@dancol.org>
3601
3602 * dbusbind.c: Add comment explaining reason for previous change.
3603
dca778d5
MR
36042012-10-15 Martin Rudalics <rudalics@gmx.at>
3605
3606 * window.c (Fwindow_end): Rewrite check whether cached position
3607 can be used (Bug#12600).
3608 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3609 Set windows_or_buffers_changed.
3610
3e0341b0
DC
36112012-10-15 Daniel Colascione <dancol@dancol.org>
3612
3613 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3614 enabled by undefining the symbol "interface", which the platform
3615 headers define to something incompatible.
3616
33d4113c
DC
36172012-10-14 Daniel Colascione <dancol@dancol.org>
3618
3619 * image.c (init_tiff_functions, init_imagemagick_functions)
3620 (init_svg_functions): Fix cygw32 build break by using these
3621 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3622
a36fb15e
JD
36232012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3624
3625 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3626
537f336d
JD
36272012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3628
3629 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3630
0ba06a77
KH
36312012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3632
3633 * coding.c (detect_coding): Set coding->id before calling
3634 this->detector.
3635
ce2fe65a
AS
36362012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3637
3638 * fileio.c: Formatting fixes.
3639
d6453ce4
PE
36402012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3641
3642 Fix some stat-related races.
3643 * fileio.c (Fwrite_region): Avoid race condition if a file is
3644 removed or renamed by some other process immediately after Emacs
3645 writes it but before Emacs stats it. Do not assume that stat (or
3646 fstat) succeeds.
3647 * image.c (slurp_file): Resolve the file name with fopen + fstat
3648 rather than stat + fopen.
3649 (pbm_read_file) [0]: Remove unused code with stat race.
3650 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3651 Remove ineffective code with stat race.
3652
06485aa8
SM
36532012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3654
3655 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3656
167e3640
JD
36572012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3658
3659 * nsterm.m (hold_event_q): New static variable.
3660 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3661 ! q_event_ptr.
3662 (hold_event): New function.
3663 (ns_read_socket): If hold_event_q have events, store them and
3664 return (Bug#12384).
3665 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3666 is zero (Bug#12384).
3667
c40239df
JB
36682012-10-12 Juanma Barranquero <lekktu@gmail.com>
3669
3670 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3671
bb385a92
EZ
36722012-10-12 Eli Zaretskii <eliz@gnu.org>
3673
2a9f1099
EZ
3674 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3675
bb385a92
EZ
3676 * fileio.c (check_existing): New function.
3677 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3678 instead of calling 'stat', when what's needed is to check whether
3679 a file exists. This avoids expensive system calls on MS-Windows.
3680 (Bug#12587)
3681
8599b23a 3682 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
3683
3684 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3685 determine whether a file exists and is not a directory.
3686
3687 * lisp.h (check_existing): Add prototype.
3688
2b9c2e68
JD
36892012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3690
3691 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
3692
81749a23
GM
36932012-10-12 Glenn Morris <rgm@gnu.org>
3694
3695 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
3696
5253a5fd
SM
36972012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3698
389a94a5
SM
3699 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
3700
5253a5fd
SM
3701 * eval.c (Fautoload): Remember previous autoload status in load-history.
3702
7cded46f
PE
37032012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3704
3705 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
3706 * lread.c (load_each_byte, new_backquote_flag, readchar)
3707 (read_filtered_event, lisp_file_lexically_bound_p)
3708 (safe_to_load_version, Fload, complete_filename_p, openp)
3709 (build_load_history, readevalloop, read_escape, read1)
3710 (string_to_number, read_vector, read_list):
3711 * macros.c (Fstart_kbd_macro):
3712 * marker.c (CONSIDER):
3713 * menu.c (parse_single_submenu, digest_single_submenu)
3714 (find_and_return_menu_selection, Fx_popup_menu):
3715 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
3716 (Ftry_completion):
3717 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
3718 (ns_menu_show):
3719 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
3720 (xmenu_show, xdialog_show):
3721 Use bool for booleans.
3722 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
3723 as it's not a predicate. All uses changed. Omit unnecessary
3724 buffer termination.
3725
549c3414
DA
37262012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
3727
3728 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
3729 (save_excursion_restore): Do not restore mark if it was not saved.
3730
e85aafe7
PE
37312012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3732
fd2f90cf
PE
3733 * marker.c (cached_modiff): EMACS_INT, not int.
3734
c1af190b
PE
3735 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
3736 instead of having a wrong decl.
e85aafe7
PE
3737 * nsmenu.m (waiting_for_input): Remove wrong decl.
3738
e738ca56
PE
37392012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3740
9fa1de30
PE
3741 keyboard.c, keymap.c: Use bool for booleans.
3742 * dispnew.c (sit_for): Distinguish between 3-way display_option
3743 and boolean do_display.
3744 * keyboard.c (single_kboard, this_command_key_count_reset)
3745 (waiting_for_input, echoing, immediate_quit, input_pending)
3746 (interrupt_input, interrupts_deferred, pop_kboard)
3747 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
3748 (command_loop_1, adjust_point_for_property)
3749 (safe_run_hooks_error, input_polling_used, read_char):
3750 (help_char_p, readable_events, kbd_buffer_events_waiting)
3751 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
3752 (lucid_event_type_list_p, get_input_pending):
3753 (gobble_input, menu_separator_name_p, menu_bar_item)
3754 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
3755 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
3756 (keyremap_step, test_undefined, read_key_sequence)
3757 (detect_input_pending, detect_input_pending_ignore_squeezables)
3758 (detect_input_pending_run_timers, requeued_events_pending_p)
3759 (quit_throw_to_read_char, Fset_input_interrupt_mode):
3760 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
3761 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
3762 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
3763 (accessible_keymaps_1, Fkey_description, push_key_description):
3764 (shadow_lookup, struct where_is_internal_data)
3765 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
3766 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
3767 (describe_map, describe_vector):
3768 * menu.c (single_menu_item):
3769 * nsmenu.m (ns_update_menubar):
3770 * process.c (wait_reading_process_output):
3771 * search.c (scan_buffer, scan_newline):
3772 Use bool for boolean.
3773 * keyboard.c (timers_run, swallow_events)
3774 (detect_input_pending_run_timers):
3775 * process.c (wait_reading_process_output):
3776 Use unsigned for counter where wraparound-on-overflow is desired,
3777 since unsigned is guaranteed to have that behavior and signed is not.
3778 (read_char): Use ptrdiff_t for string length.
3779 (get_input_pending): Remove first argument, since it was always
3780 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3781 and behave as if it had that value. Return new value of
3782 input_pending. All callers changed.
3783 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3784 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3785 a string length.
3786 * keymap.c (push_key_description): Omit last arg, which was always 1.
3787 All callers changed.
3788
e738ca56
PE
3789 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3790
29f21cdf
JB
37912012-10-10 Juanma Barranquero <lekktu@gmail.com>
3792
3793 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3794 ($(BLD)/term.$(O)): Update dependencies.
3795
6aea7528
DA
37962012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3797
3798 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3799 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3800 initializer for PVEC_NORMAL_VECTOR.
3801
5f3f57be
PE
38022012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3803
3804 Clean out old termopts cruft.
3805 * termopts.h (flow_control, meta_key): Remove unused decls.
3806 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3807 Don't include termopts.h.
3808
3e98c68e
DA
38092012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3810
3811 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3812
77e344e5
PE
38132012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3814
3815 * commands.h (immediate_quit): Remove duplicate decl.
3816
5683d7cd
JD
38172012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3818
3819 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3820 caching.
3821 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 3822 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 3823
cf5fc6db
EZ
38242012-10-09 Eli Zaretskii <eliz@gnu.org>
3825
b15736e6
EZ
3826 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3827 match what GetLastError returns. Explain why the function is
3828 needed.
3829
cf5fc6db
EZ
3830 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
3831 'is_tooltip_frame', to avoid confusion with its global namesake.
3832
f99714ce
DC
38332012-10-08 Daniel Colascione <dancol@dancol.org>
3834
3835 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
3836 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
3837 build that caused Emacs to display the hourglass cursor forever.
f99714ce 3838
fd59cb29
GM
3839 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
3840 which is broken under remote desktop, calculate the number of
3841 colors available for a display based on the display's number of
3842 planes and number of bits per pixel per plane. (bug#10397).
3843
62c480c9 38442012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 3845
62c480c9
JD
3846 * nsfont.m (Vfonts_in_cache): New variable.
3847 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
3848 are used. Add cached fonts to Vfonts_in_cache.
3849 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
3850
607446ba
JB
38512012-10-08 Juanma Barranquero <lekktu@gmail.com>
3852
fd5125ad
JB
3853 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
3854 in nt/config.nt.
46979e0b
JB
3855 (FONT_H): Define after FRAME_H.
3856 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
3857 Update dependencies.
fd5125ad 3858
607446ba
JB
3859 * w32term.c: Remove leftover declaration of keyboard_codepage.
3860
b6f4e300
EZ
38612012-10-08 Eli Zaretskii <eliz@gnu.org>
3862
c54ebba4
EZ
3863 * makefile.w32-in (FONT_H): Add $(FRAME_H).
3864 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
3865 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
3866 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
3867 ($(BLD)/unexw32.$(O)):
3868 ($(BLD)/w32.$(O)):
3869 ($(BLD)/w32console.$(O)):
3870 ($(BLD)/w32fns.$(O)):
3871 ($(BLD)/w32heap.$(O)):
3872 ($(BLD)/w32menu.$(O)):
15c720a3 3873 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 3874
b6f4e300
EZ
3875 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
3876 'const char *'.
3877 (x_to_w32_color): Don't modify the argument, modify a copy instead.
3878
501199a3
DC
38792012-10-08 Daniel Colascione <dancol@dancol.org>
3880
3881 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
3882 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
3883 accidental message numbering hole. Change other messages to
3884 match.
3885
3886 * w32select.h (HAVE_W32SELECT): Remove.
3887
3888 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 3889 w32common.h instead of w32heap.h.
501199a3
DC
3890
3891 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
3892 (get_allocation_unit, get_processor_type, get_w32_major_version)
3893 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3894 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3895 (OS_NT, os_subtype, cache_system_info): Move declarations to
3896 w32common.
3897
3898 * w32heap.c: Include w32common.h.
3899 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
3900 (w32_minor_version, w32_build_number, w32_subtype):
3901 Remove duplicate definitions.
501199a3
DC
3902
3903 * w32fns.c: Include w32common.h; include w32heap.h only in
3904 WINDOWSNT.
3905
3906 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
3907 Use `report_file_error' instead of `error' in order to better
3908 inform users of what went wrong. Increase NTGUI_UNICODE file
3909 dialog box file name length to 32k, the maximum allowed by the NT
3910 kernel.
3911
3912 * w32common.h: New file.
3913 (ROUND_UP, ROUND_DOWN, get_page_size)
3914 (get_allocation_unit, get_processor_type, get_w32_major_version)
3915 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3916 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3917 (OS_NT, os_subtype, cache_system_info): Move here.
3918
3919 * unexw32.c, unexcw.c: Include w32common.h.
3920
3921 * emacs.c (main): Use (defined (WINDOWSNT) || defined
3922 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
3923 to call syms_of_w32select.
3924
3925 * cygw32.h: Remove obsolete EXFUN declarations.
3926
3927 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
3928
3929 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
3930 of w32inevt.o from SOME_MACHINE_OBJECTS.
3931
93aa5c81
DC
39322012-10-08 Daniel Colascione <dancol@dancol.org>
3933
3934 * image.c: Permanent fix for JPEG compilation issue --- limit
3935 jpeglib `boolean' redefinition to Cygwin builds.
3936
d424f3d8
EZ
39372012-10-08 Eli Zaretskii <eliz@gnu.org>
3938
8ee4c6ce
EZ
3939 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
3940
d424f3d8
EZ
3941 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
3942 Cygwin.
3943
e08348a0
DC
39442012-10-08 Daniel Colascione <dancol@dancol.org>
3945
3946 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
3947 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
3948 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
3949 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
3950 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
3951 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
3952 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
3953 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
3954 now a supported configuration.
3955
3956 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 3957 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
3958
3959 * conf_post.h:
3960 (_DebPrint) declare tracing facility for W32 debugging. We need
3961 to unify tracing later.
3962
3963 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
3964 unconditional use of W32 Unicode functions. Cygwin runs only on
3965 100% Unicode operating systems.
3966
3967 * cygw32.c: New file. Define Cygwin-specific facilities.
3968 (Fcygwin_convert_path_to_windows)
3969 (Fcygwin_convert_path_from_windows): New user functions for
3970 accessing Cygwin path-munging routines.
3971
3972 * cygw32.h: New file.
3973 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
3974 UTF-16LE strings temporarily inside non-Lisp-visible string
3975 objects.
3976
3977 (w32_strerror): Just what it says on the tin.
3978
3979 * emacs.c: Make the NS fork-then-exec code for daemon-launching
3980 also run for Cygwin; both systems have the same problem with using
3981 GUI facilities in a forked child. Also call syms_of_cygw32,
3982 syms_of_w32select in correct places.
3983
3984 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
3985 needs fork-then-exec for daemon launching.
3986
3987 * font.h: Include frame.h.
3988
3989 * image.c: Use the image library cache machinery only when we're
3990 compiling for native WINDOWSNT; Cygwin can use shared libraries
3991 like any other Unixlike system.
3992
3993 * keyboard.c: Clarify a comment regarding the input loop.
3994
3995 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
3996 functions directly instead of trying to detect at runtime that our
3997 host operating system supports them. We make this change for two
3998 reasons: Cygwin lacks support for the multibyte character
3999 conversion functions used by the legacy menu code, and Cygwin
4000 never needs to rely on non-Unicode APIs.
4001
4002 * unexw32.c (hinst): Declare extern.
4003
4004 * w32.c: Change header order;
4005 (w32_strerror): Move to w32fns.c because we need it for
4006 non-WINDOWSNT builds.
4007
4008 * w32.h: Add #error macro to make sure we don't include w32.h for
4009 Cygwin builds. Remove w32select declarations.
4010
4011 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 4012 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
4013
4014 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4015 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4016 POSIXy alternative.
4017 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4018 (w32_major_version, w32_minor_version, w32_build_number)
4019 (os_subtype, sound_type): Define here
4020 (w32_defined_color): Make color parameter const for consistency
4021 with other _defined_color functions.
4022 (w32_createwindow): Unconditionally call w32_init_class instead of
4023 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4024 through the code is complex and unnecessary because class
4025 registration is practically free.
4026 (w32_name_of_message): New EMACSDEBUG-only function.
4027 (Fset_message_beep): Move here
4028 (Fx_open_connection): Require that the display name for Windows be
4029 "w32" for consistency, emacsclient disambiguation, and maybe, one
4030 day, multi-window-system support.
4031 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4032 Cygwin files for W32 GUI facilities, since these clearly don't
4033 expect Cygwin names.
4034 (_DebPrint): Define.
4035 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4036 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4037 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4038 (w32_last_error): Remove.
4039
4040 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4041
4042 * w32heap.c (syspage_mask): Declare here.
4043 (cache_system_info): Remove.
4044
4045 * w32inevt.c (faked_key): Define globally, not statically.
4046 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4047 (w32_console_toggle_lock_key): Move to w32fns.c.
4048
4049 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4050
4051 * w32proc.c (_DebPrint): Move to w32fns.c.
4052 * w32select.c: Include string.h, stdio.h for Cygwin.
4053 * w32select.h: New File.
4054
4055 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4056 get_osfhandle.
4057 (w32_message_fd): New variable. Under Cygwin, holds the file
4058 descriptor the system used to tell us about pending thread
4059 messages.
4060
4061 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4062 that prevented compilation under non-WINDOWSNT systems.
4063
4064 (w32_initialize): Open /dev/windows and assign it to
4065 w32_message_fd. Provide w32 feature.
4066
4067 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4068 (WM_EMACS_INPUT_READY): add.
4069 (prepend_msg, w32_message_fd): Declare globally.
4070
4071 * w32xfns.c:
4072 (keyboard_handle): Use only when WINDOWSNT.
4073 (notify_msg_ready): New function. Posts a message to the main
4074 thread's message queue under CYGWIN, which wakes up the main
4075 thread from select(2) by making the /dev/windows file descriptor
4076 ready. Under WINDOWSNT, it sets an event the same way the old
4077 code did.
4078
4079 (post, prepend_msg): Actually call notify_msg_ready instead of
4080 setting the input event directly.
4081
98daa893
EZ
40822012-10-07 Eli Zaretskii <eliz@gnu.org>
4083
4084 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4085 but it still has blocs in it, don't return it to the system,
4086 instead of aborting. (Bug#12402)
4087
3bc0a2f7
JD
40882012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4089
8ad5b73b 4090 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 4091
335f5ae4
JD
4092 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4093 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
4094 (syms_of_nsterm): Remove comment about Panther and above for
4095 ns-antialias-text.
335f5ae4
JD
4096 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4097 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4098 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4099
4100 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4101 MAC_OS_X_VERSION_10_4.
4102
8ad5b73b
JD
4103 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4104 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
4105
4106 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4107
4108 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4109 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4110
3bc0a2f7
JD
4111 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4112 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
4113 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4114 Remove ns_in_resize check.
3bc0a2f7
JD
4115 (ns_clear_frame_area): Remove resize handle code.
4116
4117 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
4118 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4119 Remove ns_in_resize check.
3bc0a2f7 4120
c622b48f
PE
41212012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4122
4123 Improve sys_siglist detection.
4124 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4125 defined as a macro, as is done in Solaris.
4126 (sys_siglist_entries): New macro.
4127 (save_strsignal): Use it.
4128 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4129 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4130
04fafa46
JD
41312012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4132
4133 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4134 fullscreen/Fullscreen.
4135
4136 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4137 tobar_height is new.
4138
4139 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4140 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4141 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4142 (windowDidResize:): Check for correct window if old style fullscreen.
4143 Capitalize word in comment. Remove incorrect comment.
4144 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4145 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4146 error in drawing background.
1f9f395d 4147 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
4148 Set toolbar values to zero, save old height in tobar_height.
4149 Restore tool bar height when leaving fullscreen.
4150 (canBecomeMainWindow): New function.
4151
c6e21c03
PE
41522012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4153
4154 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4155
0d9f584b
EZ
41562012-10-05 Eli Zaretskii <eliz@gnu.org>
4157
a65fbb5f
EZ
4158 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4159
0d9f584b 4160 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
4161 that time stamps of directories could also be changed.
4162 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
4163 FILE_WRITE_ATTRIBUTES access rights.
4164
4165 * fileio.c (Fset_file_times): Special-case ignoring errors for
4166 directories only on MSDOS, not on MS-Windows.
4167
e8757f09 41682012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
4169
4170 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4171
7604f298
EZ
41722012-10-04 Eli Zaretskii <eliz@gnu.org>
4173
4174 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4175 see whether CreateFile failed.
4176
88d69b7d
PE
41772012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4178
4179 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4180 to avoid similar races.
4181 * keyboard.c (pending_signals): Now bool, not int.
4182
7509f454
PE
4183 Port timers to OpenBSD, plus check for timer failures.
4184 OpenBSD problem reported by Han Boetes.
4185 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4186 and/or setitimer.
4187 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4188 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4189 like OpenBSD, which has timer_settime but does not declare it.
4190 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4191 whether to use itimerspec-related primitives. All uses of
4192 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4193
a3c5c0c5
PE
41942012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4195
4196 * profiler.c (handle_profiler_signal): Fix a malloc race
4197 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4198
914e743b
JD
41992012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4200
4201 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4202
d8ab37a8
EZ
42032012-10-02 Eli Zaretskii <eliz@gnu.org>
4204
4205 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4206 consistent with the change in return value of 'safe_strsignal'.
4207
b3ecad33
PE
42082012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4209
0a99eee1
PE
4210 Prefer plain 'static' to 'static inline' (Bug#12541).
4211 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4212 (bidi_set_sor_type, bidi_push_embedding_level)
4213 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4214 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4215 (bidi_cache_search, bidi_cache_ensure_space)
4216 (bidi_cache_iterator_state, bidi_cache_find)
4217 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4218 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4219 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4220 Now 'static', not 'static inline'.
4221
b3ecad33
PE
4222 Count overruns when profiling; change units to ns.
4223 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4224 Give extra weight to samples after overruns, to attempt to count
4225 the time more accurately.
4226 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4227 the underlying primitives nominally do ns.
4228 (Fprofiler_cpu_start): Document the change. Mention that
4229 the sampling intervals are only approximate.
4230
090cf9db
SM
42312012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4232
4233 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4234
4235 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4236 case for the special 0 coding-system.
4237
4238 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4239 (Fmake_overlay): Remove redundant tests.
64edc777 4240 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 4241
81550bf4
JB
42422012-10-02 Juanma Barranquero <lekktu@gmail.com>
4243
4244 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4245 Update dependencies.
4246
aa1ba90e
PE
42472012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4248
4249 Fix a malloc race condition involving strsignal.
4250 A signal can arrive in the middle of a malloc, and Emacs's signal
4251 handler can invoke strsignal, which can invoke malloc, which is
4252 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4253 Fix it by altering the signal handler so that it does not invoke
4254 strsignal.
4255 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4256 * process.c (status_message): Use const pointer, in case strsignal
4257 is #defined to safe_strsignal.
4258 * sysdep.c (sys_siglist, init_signals): Always define and
4259 initialize a substitute sys_siglist if the system does not define
4260 one, even if HAVE_STRSIGNAL.
4261 (safe_strsignal): Rename from strsignal. Always define,
4262 using sys_siglist. Return a const pointer.
4263 * syssignal.h (safe_strsignal): New decl.
4264 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4265
ace917bd
EZ
42662012-10-01 Eli Zaretskii <eliz@gnu.org>
4267
4268 * w32proc.c (timer_loop): Fix code that waits for timer
4269 expiration, to avoid high CPU usage.
4270
9eb71b9c
SM
42712012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4272
4273 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4274 (sweep_weak_table): Remove redundant prototypes.
4275
b3317662
FP
42762012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4277
4278 * emacs.c: Move the inclusion of TERM_HEADER after including
4279 windows.h on WINDOWSNT. This avoids compilation problems with
4280 MSVC.
4281
f0e5f225
EZ
42822012-10-01 Eli Zaretskii <eliz@gnu.org>
4283
2d7d1608
EZ
4284 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4285 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4286 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4287 as the previous version used 'void *'.
4288
4289 * ralloc.c (ROUNDUP): Fix last change.
4290 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4291 'size_t'.
4292
f0e5f225
EZ
4293 * w32proc.c <disable_itimers>: New static flag.
4294 (init_timers): Initialize it to zero, after creating the critical
4295 sections used by the timer threads.
4296 (term_timers): Set to 1 before deleting the critical sections.
4297 (getitimer, setitimer): If disable_itimers is non-zero, return an
4298 error indication without doing anything. Reported by Fabrice
4299 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
4300 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4301 return results.
4302 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4303 support timers.
f0e5f225
EZ
4304
4305 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4306 term_ntproc after all the other bookkeeping, to get timers working
4307 as long as possible.
4308
82ef37c1
PE
43092012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4310
b3a4c387
PE
4311 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4312 Suggested by Juri Linkov in
4313 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4314
b0ab8123
PE
4315 Prefer plain 'static' to 'static inline' (Bug#12541).
4316 With static functions, modern compilers inline pretty well by
4317 themselves; advice from programmers often hurts as much as it helps.
4318 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4319 this change shrinks the text size of the Emacs executable by 1.1%
4320 without affecting CPU significantly in my benchmark.
4321 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4322 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4323 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4324 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4325 (bset_auto_fill_function, bset_auto_save_file_format)
4326 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4327 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4328 (bset_cache_long_line_scans, bset_case_fold_search)
4329 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4330 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4331 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4332 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4333 (bset_header_line_format, bset_indicate_buffer_boundaries)
4334 (bset_indicate_empty_lines, bset_invisibility_spec)
4335 (bset_left_fringe_width, bset_major_mode, bset_mark)
4336 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4337 (bset_name, bset_overwrite_mode, bset_pt_marker)
4338 (bset_right_fringe_width, bset_save_length)
4339 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4340 (bset_scroll_up_aggressively, bset_selective_display)
4341 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4342 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4343 (set_buffer_overlays_after):
4344 * category.c (bset_category_table):
4345 * charset.c (read_hex):
4346 * coding.c (produce_composition, produce_charset)
4347 (handle_composition_annotation, handle_charset_annotation)
4348 (char_encodable_p):
4349 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4350 (assign_row, set_frame_matrix_frame, make_current)
4351 (add_row_entry):
4352 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4353 * fns.c (maybe_resize_hash_table):
4354 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4355 * gmalloc.c (register_heapinfo):
4356 * image.c (lookup_image_type):
4357 * intervals.c (set_interval_object, set_interval_left)
4358 (set_interval_right, copy_interval_parent, rotate_right)
4359 (rotate_left, balance_possible_root_interval):
4360 * keyboard.c (kset_echo_string, kset_kbd_queue)
4361 (kset_keyboard_translate_table, kset_last_prefix_arg)
4362 (kset_last_repeatable_command, kset_local_function_key_map)
4363 (kset_overriding_terminal_local_map, kset_real_last_command)
4364 (kset_system_key_syms, clear_event, set_prop):
4365 * lread.c (digit_to_number):
4366 * marker.c (attach_marker, live_buffer, set_marker_internal):
4367 * nsterm.m (ns_compute_glyph_string_overhangs):
4368 * process.c (pset_buffer, pset_command)
4369 (pset_decode_coding_system, pset_decoding_buf)
4370 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4371 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4372 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4373 * syntax.c (bset_syntax_table, dec_bytepos):
4374 * terminal.c (tset_param_alist):
4375 * textprop.c (interval_has_some_properties)
4376 (interval_has_some_properties_list):
4377 * window.c (wset_combination_limit, wset_dedicated)
4378 (wset_display_table, wset_hchild, wset_left_fringe_width)
4379 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4380 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4381 (wset_right_fringe_width, wset_right_margin_cols)
4382 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4383 (wset_vertical_scroll_bar_type, wset_window_parameters):
4384 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4385 (wset_column_number_displayed, wset_region_showing)
4386 (window_box_edges, run_window_scroll_functions)
4387 (append_glyph_string_lists, prepend_glyph_string_lists)
4388 (append_glyph_string, set_glyph_string_background_width)
4389 (append_glyph, append_composite_glyph)
4390 (take_vertical_position_into_account):
4391 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4392 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4393 (lface_hash, lface_same_font_attributes_p, lookup_face):
4394 * xml.c (libxml2_loaded_p):
4395 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4396 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4397 Now 'static', not 'static inline'.
4398
05584c31
PE
4399 * bidi.c: Tune.
4400 (bidi_copy_it): Do the whole copy with a single memcpy.
4401 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4402
86ec63ba
PE
4403 Revert the FOLLOW-SYMLINKS change for file-attributes.
4404 Doing it right would require several changes to Tramp, and there's
4405 not enough time to get that tested before the freeze today.
4406 * dired.c (directory_files_internal, Ffile_attributes):
4407 Undo last change.
4408
82ef37c1
PE
4409 * frame.c (x_report_frame_params): Port better to wider ints.
4410 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4411 or that pointers can be printed in 15 decimal digits.
4412 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4413
62aba0d4
FP
44142012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4415
4416 Support x64 build on MS-Windows.
4417 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4418 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4419 compatibility with x64.
5e4daaf3 4420 (x_get_focus_frame): Add prototype.
62aba0d4
FP
4421
4422 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4423 defining an XRectangle structure.
4424
4425 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4426 arithmetics for compatibility with x64.
4427
4428 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4429 compatibility with x64.
4430
4431 * w32heap.h: Adjust prototypes and declarations.
4432
4433 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4434 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4435 DWORD, long, and unsigned long, for compatibility with x64.
4436 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4437 (sbrk): Argument is now of type ptrdiff_t.
4438
4439 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4440 less than 0x0500.
4441 (w32_msg_pump): Use WPARAM type for 'result'.
4442
4443 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4444 architecture.
4445 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4446 compatibility with x64.
4447
4448 * vm-limit.c (lim_data): Now size_t.
4449 (check_memory_limits): Adjust prototypes of real_morecore and
4450 __morecore to receive argument of type ptrdiff_t. Use size_t for
4451 five_percent and data_size.
4452
4453 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4454 variables, for compatibility with x64.
4455 (rva_to_section, offset_to_section, relocate_offset)
4456 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4457 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4458 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4459 for compatibility with x64.
4460
4461 * sysdep.c (STDERR_FILENO): Define if not already defined.
4462
4463 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4464 (__morecore): Argument type is now ptrdiff_t.
4465 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4466 (relinquish): Use ptrdiff_t type for 'excess'.
4467 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4468
4469 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4470 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4471 instead of a literal number.
4472
4473 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4474 (min): Define only if not already defined.
4475
4476 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4477 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4478 hosts.
4479
4480 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4481 'bitmaps' is a pointer.
4482
4483 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4484
4485 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4486
e7a2937b
PE
44872012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4488
4489 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4490 * dired.c (directory_files_internal, Ffile_attributes):
4491 New arg follow_symlinks. All uses changed.
4492
b43d62ae
SM
44932012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4494
4495 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4496
c06c382a
EZ
44972012-09-30 Eli Zaretskii <eliz@gnu.org>
4498
4499 Support atimers and CPU profiler via profile.c on MS-Windows.
4500 * w32proc.c (sig_mask, crit_sig): New static variables.
4501 (sys_signal): Support SIGALRM and SIGPROF.
4502 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 4503 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
4504 sigfillset, and sigprocmask are no longer no-ops.
4505 (sigismember): New function.
4506 (struct itimer_data): New definition.
4507 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4508 (crit_prof): New static variables.
4509 (MAX_SINGLE_SLEEP): New definition.
4510 (timer_loop, stop_timer_thread, term_timers, init_timers)
4511 (start_timer_thread, getitimer, setitimer): New functions.
4512 (alarm): No longer a no-op, calls setitimer.
4513
4514 * w32.c (term_ntproc): Call term_timers.
4515 (init_ntproc): Make sure all signals are unblocked at startup, to
4516 erase any traces of dumping. Call init_timers.
4517
4518 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4519 Windows-specific code to display the hourglass mouse pointer is no
4520 longer used.
4521 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4522 to hourglass timer expiration.
4523 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4524 Remove, no longer used.
b43d62ae
SM
4525 (w32_note_current_window, show_hourglass, hide_hourglass):
4526 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
4527 window systems.
4528 (syms_of_w32fns): Don't initialize hourglass_timer.
4529
4530 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4531 WINDOWSNT as well.
4532 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4533
4534 * w32.h (init_timers, term_timers): Add prototypes.
4535
95402d5f
KH
45362012-09-30 Kenichi Handa <handa@gnu.org>
4537
4538 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4539 to the buffer relocation which may be caused by ccl_driver.
4540
dd946752
JD
45412012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4542
d7e642cc
JD
4543 * xfns.c (Fx_file_dialog): Update comment.
4544
4545 * w32fns.c (Fx_file_dialog): Update comment.
4546
4547 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4548 Initialize panel name field if OSX >= 10.6.
4549
4550 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4551
dd946752
JD
4552 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4553
4554 * nsterm.m (NEW_STYLE_FS): New define.
4555 (ns_fullscreen_hook, windowWillEnterFullScreen)
4556 (windowDidEnterFullScreen, windowWillExitFullScreen)
4557 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4558 (setFSValue): New functions.
4559 (EmacsFSWindow): New implementation.
4560 (canBecomeKeyWindow): New function for EmacsFSWindow.
4561 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4562 (dealloc): Release nonfs_window if in fullscreen.
4563 (updateFrameSize:): Call windowDidMove to update top/left.
4564 (windowWillResize:toSize:): Check if frame is still maximized.
4565 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4566 next_maximized, maximized_width, maximized_height and nonfs_window.
4567 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4568 tbar_height.
4569 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 4570 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
4571
4572 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4573 (EmacsView): Add variables for fullscreen.
4574 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4575 (EmacsFSWindow): New interface for fullscreen.
4576
427730eb
JB
45772012-09-30 Juanma Barranquero <lekktu@gmail.com>
4578
4579 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4580
48de8b12
CY
45812012-09-30 Chong Yidong <cyd@gnu.org>
4582
4583 * fns.c (Frandom): Doc fix.
4584
5938d519
MR
45852012-09-30 Martin Rudalics <rudalics@gmx.at>
4586
4587 * window.c (Vwindow_combination_limit): New default value.
4588 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4589
cb5b0266
PE
45902012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4591
4592 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4593 Suggested by Eli Zaretskii in
4594 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4595
84f72efd
EZ
45962012-09-30 Eli Zaretskii <eliz@gnu.org>
4597
4598 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4599 HAVE_TIMER_SETTIME is defined.
4600
9d4dcdc9
PE
46012012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4602
d89460ed
PE
4603 Profiler improvements: more-accurate timers, overflow checks.
4604 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4605 signal.h, setjmp.h. Include systime.h instead.
4606 (saturated_add): New function.
4607 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4608 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4609 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4610 New static vars.
84f72efd 4611 (enum profiler_cpu_running): New enum.
d89460ed
PE
4612 (profiler_cpu_running): Now of that enum type, not bool.
4613 All uses changed to store the new value.
4614 (handle_profiler_signal): Rename from sigprof_handler_1,
4615 for consistency with other handlers. Do not check whether
4616 cpu_log is a hash-table if garbage collecting, since it
4617 doesn't matter in that case.
4618 (deliver_profiler_signal): Rename from sigprof_handler,
4619 for consistency with other handlers.
4620 (setup_cpu_timer): New function, with much of what used to be in
4621 Fprofiler_cpu_start. Check for out-of-range argument.
4622 Prefer timer_settime if available, and prefer
4623 thread cputime clocks, then process cputime clocks, then
4624 monotonic clocks, to the old realtime clock. Use make_timeval
4625 to round more-correctly when falling back to setitimer.
4626 (Fprofiler_cpu_start): Use it.
4627 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4628 Don't assume that passing NULL as the 2nd argument of setitimer
4629 is the same as passing a pointer to all-zero storage.
4630 Ignore SIGPROF afterwards.
4631 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4632 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4633 non-fatal signal handlers. Ignore SIGPROF on startup.
4634 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4635 in profiler.c, since sysdep.c now uses it.
4636
9d4dcdc9
PE
4637 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4638 Suggested by Eli Zaretskii in
4639 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4640
8e5691a0
JB
46412012-09-29 Juanma Barranquero <lekktu@gmail.com>
4642
4643 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4644
e7c1b6ef
SM
46452012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4646
4647 * lisp.h (struct backtrace): Remove indirection for `function' field.
4648 * xdisp.c (redisplay_internal):
4649 * profiler.c (record_backtrace, sigprof_handler_1):
4650 * alloc.c (Fgarbage_collect):
4651 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4652 (Fbacktrace_frame): Adjust accordingly.
4653
e61d39cd 46542012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
4655
4656 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4657 (Frun_hook_with_args_until_failure): Doc fixes.
4658
404043ea
EZ
46592012-09-28 Eli Zaretskii <eliz@gnu.org>
4660
4661 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4662 Qautomatic_redisplay and change the symbol name. All users changed.
4663
704d3f45
TM
46642012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4665
4666 * profiler.c (sigprof_handler): Fix race condition.
4667
757140ff
GM
46682012-09-28 Glenn Morris <rgm@gnu.org>
4669
4670 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4671
a615a3ae
PE
46722012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4673
4674 Check more robustly for timer_settime.
89d17fd0
PE
4675 * Makefile.in (LIB_TIMER_TIME): New macro.
4676 (LIBES): Add it.
a615a3ae
PE
4677 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4678 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4679 call timer_settime.
4680
3670daf7
TM
46812012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4682
4683 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4684
6a586b7f
JB
46852012-09-26 Juanma Barranquero <lekktu@gmail.com>
4686
4687 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4688
41c8bfcf
PE
46892012-09-26 Paul Eggert <eggert@cs.ucla.edu>
4690
4691 * character.h (MAYBE_UNIFY_CHAR): Remove.
4692 * charset.c, charset.h (maybe_unify_char): Now static.
4693 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
4694 Since this stuff is now private to charset.c, there's no need for
4695 a public macro and no need to inline by hand.
4696
3a880af4
SM
46972012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4698 Stefan Monnier <monnier@iro.umontreal.ca>
4699 Juanma Barranquero <lekktu@gmail.com>
611b7507 4700
3a880af4
SM
4701 * profiler.c: New file.
4702 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
4703 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
4704 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
4705 * emacs.c (main): Call syms_of_profiler.
4706 * alloc.c (Qautomatic_gc): New constant.
4707 (MALLOC_PROBE): New macro.
4708 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
4709 (total_bytes_of_live_objects): New function.
4710 (Fgarbage_collect): Use it. Record itself in backtrace_list.
4711 Call malloc_probe for the memory profiler.
4712 (syms_of_alloc): Define Qautomatic_gc.
4713 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
4714 race condition.
4715 (struct backtrace): Move definition...
4716 * lisp.h (struct backtrace): ..here.
4717 (Qautomatic_gc, profiler_memory_running): Declare vars.
4718 (malloc_probe, syms_of_profiler): Declare functions.
4719 * xdisp.c (Qautomatic_redisplay): New constant.
4720 (redisplay_internal): Record itself in backtrace_list.
4721 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 4722
5938d519 47232012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
47242012-09-25 Juanma Barranquero <lekktu@gmail.com>
4725
4726 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
4727
e26fd2e4
PE
47282012-09-25 Paul Eggert <eggert@cs.ucla.edu>
4729
4730 Prefer POSIX timers if available.
4731 They avoid a race if the timer is too close to the current time.
4732 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
4733 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 4734 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 4735
eedec3ee
EZ
47362012-09-25 Eli Zaretskii <eliz@gnu.org>
4737
4738 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
4739 CHAR_STRING_ADVANCE.
4740 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
4741 STRING_CHAR_ADVANCE.
4742
aa15c6bb
JB
47432012-09-25 Juanma Barranquero <lekktu@gmail.com>
4744
4745 Move Vlibrary_cache to emacs.c and reset before dumping.
4746
4747 * lisp.h (reset_image_types): Declare.
4748 [WINDOWSNT] (Vlibrary_cache): Declare.
4749
4750 * image.c (reset_image_types): New function.
4751
4752 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
4753 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
4754 (Fdump_emacs): Reset Vlibrary_cache and image_types.
4755
4756 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
4757 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
4758
4759 * w32.h (Vlibrary_cache): Do not declare.
4760
54d629be
EZ
47612012-09-25 Eli Zaretskii <eliz@gnu.org>
4762
16b22fef
EZ
4763 * w32proc.c (sys_signal): Handle all signals defined by the
4764 MS-Windows runtime, not just SIGCHLD. Actually install the signal
4765 handlers for signals supported by Windows. Don't override
4766 term_ntproc as the handler for SIGABRT.
4767 (sigaction): Rewrite to call sys_signal instead of duplicating its
4768 code.
4769 (sys_kill): Improve commentary.
4770
4771 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4772 consistency with a signature of a signal handler. All callers
4773 changed.
4774 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4775 install term_ntproc as a signal handler for SIGABRT, as that
4776 should be done by the dumped Emacs.
4777
4778 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4779
4780 * w32select.c (term_w32select): Protect against repeated
4781 invocation by setting clipboard_owner to NULL after calling
4782 DestroyWindow.
4783
4784 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4785 and term_ntproc to their modified signatures.
4786
54d629be
EZ
4787 * character.c (char_string, string_char): Remove calls to
4788 MAYBE_UNIFY_CHAR. See the discussion starting at
4789 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4790 for the details.
4791
59f7af81
CY
47922012-09-25 Chong Yidong <cyd@gnu.org>
4793
4794 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4795
22e8cf4a
SM
47962012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4797
4798 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4799 when encountering an unknown bytecode.
4800
578098f3
PE
48012012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4802
4803 image.c, indent.c: Use bool for booleans.
4804 * dispextern.h (struct image_type): Members valid_p, load, init
4805 now return bool, not int. All uses changed.
4806 * image.c: Omit unnecessary static decls.
4807 (x_create_bitmap_mask, x_build_heuristic_mask):
4808 Return void, not int, since callers don't care about the return value.
4809 (x_create_bitmap_mask, define_image_type, valid_image_p)
4810 (struct image_keyword, parse_image_spec, image_spec_value)
4811 (check_image_size, image_background)
4812 (image_background_transparent, x_clear_image_1)
4813 (postprocess_image, lookup_image, x_check_image_size)
4814 (x_create_x_image_and_pixmap, xbm_image_p)
4815 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4816 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4817 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4818 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4819 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4820 (png_image_p, init_png_functions, png_load_body, png_load)
4821 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4822 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4823 (init_gif_functions, gif_load, imagemagick_image_p)
4824 (imagemagick_load_image, imagemagick_load, svg_image_p)
4825 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4826 (gs_load):
4827 * nsimage.m (ns_load_image):
4828 * nsterm.m (ns_defined_color):
4829 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
4830 * xfns.c (x_defined_color):
4831 * xterm.c (x_alloc_lighter_color_for_widget)
4832 (x_alloc_nearest_color_1, x_alloc_nearest_color)
4833 (x_alloc_lighter_color):
4834 * indent.c (disptab_matches_widthtab, current_column)
4835 (scan_for_column, string_display_width, indented_beyond_p)
4836 (compute_motion, vmotion, Fvertical_motion):
4837 Use bool for booleans.
4838
a5f2b6ec
CY
48392012-09-24 Chong Yidong <cyd@gnu.org>
4840
4841 * chartab.c (Fset_char_table_default): Obsolete function removed.
4842
18e27ea8
PE
48432012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4844
afea8a8a
PE
4845 Move pid_t related decls out of lisp.h.
4846 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
4847 (interruptible_wait_for_termination):
4848 Move these decls from lisp.h to syswait.h, since they use pid_t.
4849 Needed on FreeBSD; see Herbert J. Skuhra in
4850 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
4851 * callproc.c: Include syswait.h.
4852
18e27ea8
PE
4853 gnutls.c, gtkutil.c: Use bool for boolean.
4854 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
4855 (emacs_gnutls_handle_error):
4856 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
4857 (xg_hide_tooltip, xg_create_frame_widgets)
4858 (create_dialog, xg_uses_old_file_dialog)
4859 (xg_get_file_with_chooser, xg_get_file_with_selection)
4860 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
4861 (xg_item_label_same_p, xg_update_menubar)
4862 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
4863 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
4864 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
4865 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
4866 (update_frame_tool_bar, free_frame_tool_bar):
4867 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
4868 * nsmenu.m (ns_update_menubar):
4869 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
4870 * xfns.c (Fx_show_tip) [USE_GTK]:
4871 Use bool for boolean.
4872 * gtkutil.c (xg_update_frame_menubar):
4873 * xmenu.c (update_frame_menubar):
4874 Return void, not int, since caller ignores return value.
4875 * gtkutil.c (xg_change_toolbar_position):
4876 Return void, not 1.
4877
af0e9f75
JB
48782012-09-23 Juanma Barranquero <lekktu@gmail.com>
4879
4880 * makefile.w32-in (BLOCKINPUT_H): Remove.
4881 (SYSSIGNAL_H): New macro.
4882 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
4883 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
4884 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
4885 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
4886 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
4887 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
4888 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
4889 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
4890 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
4891 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
4892 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
4893 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
4894 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
4895 ($(BLD)/w32xfns.$(O)): Update dependencies.
4896
5101529e
EZ
48972012-09-23 Eli Zaretskii <eliz@gnu.org>
4898
4899 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
4900 fatal_error_backtrace.
4901
4902 * w32proc.c (sys_kill): Undo last change: don't do anything when
4903 invoked to deliver SIGABRT to our own process. This is now
4904 handled by emacs_raise.
4905
2c3ee0ad
JB
49062012-09-23 Juanma Barranquero <lekktu@gmail.com>
4907
4908 * w32term.c (w32_read_socket): Remove leftover reference to
4909 interrupt_input_pending.
4910
62a1d661
PE
49112012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4912
4913 Do not use SA_NODEFER.
4914 Problem reported by Dani Moncayo in
4915 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
4916 * alloc.c (die):
4917 * sysdep.c (emacs_abort): Do not reset signal handler.
4918 * emacs.c (terminate_due_to_signal): Reset signal handler here.
4919 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
4920 wanted even on POSIXish hosts, and it doesn't work on Windows.
4921
a0942b9a
JD
49222012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4923
4924 * xterm.c (x_term_init): Call fixup_locale before and after calling
4925 gtk_init (Bug#12392).
4926
d07ff9db
CY
49272012-09-23 Chong Yidong <cyd@gnu.org>
4928
4929 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
4930 Vdynamic_library_alist.
4931
4932 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
4933 (Fgnutls_available_p): Caller changed.
4934
4935 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
4936 (Flibxml_parse_xml_region): Likewise.
4937
4938 * dispextern.h (struct image_type): Remove arg from init function.
4939
4940 * image.c (Finit_image_library, lookup_image_type)
4941 (define_image_type): Remove now-unneeded second arg.
4942 (init_xpm_functions, init_png_functions, init_jpeg_functions)
4943 (init_tiff_functions, init_gif_functions, init_svg_functions):
4944 Arglist and w32_delayed_load calling convention changed.
4945 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 4946 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 4947
4d7e6e51
PE
49482012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4949
4950 Simplify and avoid signal-handling races (Bug#12471).
4951 * alloc.c (die):
4952 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
4953 Avoid recursive loop if there's a fatal error in the function itself.
4954 * atimer.c (pending_atimers):
4955 * blockinput.h: Don't include "atimer.h"; no longer needed.
4956 (interrupt_input_pending): Remove. All uses removed.
4957 pending_signals now counts both atimers and ordinary interrupts.
4958 This is less racy than having three separate pending-signal flags.
4959 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
4960 (input_blocked_p):
4961 Rename from their upper-case counterparts BLOCK_INPUT,
4962 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
4963 INPUT_BLOCKED_P, and turn into functions. All uses changed.
4964 This makes it easier to access volatile variables more accurately.
4965 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
4966 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
4967 that's more reliable if the code is buggy and sets
4968 interrupt_input_blocked to a negative value. All uses changed.
4969 * atimer.c (deliver_alarm_signal):
4970 Remove. No need to deliver this to the parent; any thread can
4971 handle this signal now. All uses replaced by underlying handler.
4972 * atimer.c (turn_on_atimers):
4973 * dispnew.c (handle_window_change_signal):
4974 * emacs.c (handle_danger_signal):
4975 * keyboard.c (kbd_buffer_get_event):
4976 Don't reestablish signal handler; not needed with sigaction.
4977 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
4978 (UNBLOCK_INPUT_TO):
4979 Rework to avoid unnecessary accesses to volatile variables.
4980 (UNBLOCK_INPUT_TO): Now a function.
4981 (totally_unblock_input, unblock_input): New decls.
4982 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
4983 (init_data): Remove. Necessary stuff now done in init_signal.
4984 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
4985 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
4986 (fatal_error_code): Remove; no longer needed.
4987 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
4988 it doesn't always backtrace. All uses changed. No need to reset
4989 signal to default, since sigaction and/or die does that for us now.
4990 Use emacs_raise (FOO), not kill (getpid (), FOO).
4991 (main): Check more-accurately whether we're dumping.
4992 Move fatal-error setup to sysdep.c
4993 * floatfns.c: Do not include "syssignal.h"; no longer needed.
4994 * gtkutil.c (xg_get_file_name, xg_get_font):
4995 Remove no-longer-needed signal-mask manipulation.
4996 * keyboard.c, process.c (POLL_FOR_INPUT):
4997 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
4998 * keyboard.c (read_avail_input): Remove.
4999 All uses replaced by gobble_input.
5000 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5001 (kbd_buffer_store_event_hold, gobble_input):
5002 (record_asynch_buffer_change) [USABLE_SIGIO]:
5003 (store_user_signal_events):
5004 No need to mess with signal mask.
5005 (gobble_input): If blocking input and there are terminals, simply
5006 set pending_signals to 1 and return. All hooks changed to not
5007 worry about whether input is blocked.
5008 (process_pending_signals): Clear pending_signals before processing
5009 them, in case a signal comes in while we're processing.
5010 By convention callers now test pending_signals before calling us.
5011 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5012 New functions, to support changes to blockinput.h.
5013 (handle_input_available_signal): Now extern.
5014 (reinvoke_input_signal): Remove. All uses replaced by
5015 handle_async_input.
5016 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
5017 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5018 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
5019 Clear sigmask reliably, even if Fsignal returns, which it can.
5020 Omit unnecessary accesses to volatile var.
5021 (quit_throw_to_read_char): No need to restore sigmask.
5022 * keyboard.c (gobble_input, handle_user_signal):
5023 * process.c (wait_reading_process_output):
5024 Call signal-handling code rather than killing ourselves.
5025 * lisp.h: Include <float.h>, for...
5026 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5027 (pending_signals): Now volatile.
5028 (syms_of_data): Now const if IEEE floating point.
5029 (handle_input_available_signal) [USABLE_SIGIO]:
5030 (terminate_due_to_signal, record_child_status_change): New decls.
5031 * process.c (create_process): Avoid disaster if memory is exhausted
5032 while we're processing a vfork, by tightening the critical section
5033 around the vfork.
5034 (send_process_frame, process_sent_to, handle_pipe_signal)
5035 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5036 ignores SIGPIPE.
5037 (send_process): No need for setjmp/longjmp any more, since the
5038 SIGPIPE stuff is now gone. Instead, report an error if errno
5039 is EPIPE.
5040 (record_child_status_change): Now extern. PID and W are now args.
5041 Return void, not bool. All callers changed.
5042 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5043 Remove. All uses removed. This bug should be fixed now in a
5044 different way.
5045 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5046 and record the child status change directly. This avoids the
5047 need to futz with the signal mask.
5048 (process_fatal_action): Move here from emacs.c.
5049 (emacs_sigaction_flags): New function, containing
5050 much of what used to be in emacs_sigaction_init.
5051 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5052 caught by emacs, to make races less likely.
5053 (deliver_process_signal): Rename from handle_on_main_thread.
5054 All uses changed.
5055 (BACKTRACE_LIMIT_MAX): Now at top level.
5056 (thread_backtrace_buffer, threadback_backtrace_pointers):
5057 New static vars.
5058 (deliver_thread_signal, deliver_fatal_thread_signal):
5059 New functions, for more-accurate delivery of thread-specific signals.
5060 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5061 (deliver_arith_signal): Handle in this thread, not
5062 in the main thread, since it's triggered by this thread.
5063 (maybe_fatal_sig): New function.
5064 (init_signals): New arg DUMPING so that we can be more accurate
5065 about whether we're dumping. Caller changed.
5066 Treat thread-specific signals differently from process-general signals.
5067 Block all signals while handling fatal error; that's safer.
5068 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5069 on IEEE hosts.
5070 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5071 Ignore SIGPIPE unless batch.
5072 (emacs_backtrace): Output backtrace for the appropriate thread,
5073 which is not necessarily the main thread.
5074 * syssignal.h: Include <stdbool.h>.
5075 (emacs_raise): New macro.
5076 * xterm.c (x_connection_signal): Remove; no longer needed
5077 now that we use sigaction.
5078 (x_connection_closed): No need to mess with sigmask now.
5079 (x_initialize): No need to reset SIGPIPE handler here, since
5080 init_signals does this for us now.
5081
8f4635e9
JD
50822012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5083
5084 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 5085 background rect may be larger (Bug#12245).
8f4635e9 5086
3296976d
CY
50872012-09-23 Chong Yidong <cyd@gnu.org>
5088
5089 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5090
d41e491e
PE
50912012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5092
5093 * .gdbinit: Just stop at fatal_error_backtrace.
5094 See Stefan Monnier's request in
5095 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5096 Remove no-longer-used query of system type.
5097
c88b867f
CY
50982012-09-22 Chong Yidong <cyd@gnu.org>
5099
5100 * search.c (Freplace_match): Doc fix (Bug#12325).
5101
5102 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5103
5104 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5105 (Fline_end_position): Doc fix.
5106
5107 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5108
bb4d86b4
CY
51092012-09-22 Chong Yidong <cyd@gnu.org>
5110
5111 * dispextern.h (struct image_type): Add new slot, storing a type
5112 initialization function.
5113
5114 * image.c (define_image_type): Call the image initializer function
5115 if it is defined. Arguments and return value changed.
5116 (valid_image_p, make_image): Callers changed.
5117 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
5118 (gif_type, imagemagick_type, svg_type, gs_type):
5119 Add initialization functions.
bb4d86b4
CY
5120 (Finit_image_library): Call lookup_image_type.
5121 (CHECK_LIB_AVAILABLE): Macro deleted.
5122 (lookup_image_type): Call define_image_type here, rather than via
5123 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5124 (syms_of_image): Move define_image_type calls for xbm_type and
5125 pbm_type to lookup_image_type.
5126
df9685f3
EZ
51272012-09-22 Eli Zaretskii <eliz@gnu.org>
5128
5129 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5130 'idle_timers' from here ...
5131 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5132 lists, to avoid infloops when the timer does something stupid,
5133 like reinvoke itself with the same or smaller time-out.
5134 (Bug#12447)
5135
8e17c9ba
MR
51362012-09-22 Martin Rudalics <rudalics@gmx.at>
5137
5138 * window.c (Fsplit_window_internal): Handle only Qt value of
5139 Vwindow_combination_limit separately.
5140 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
5141 (Vwindow_combination_limit): New default value.
5142 Rewrite doc-string.
8e17c9ba 5143
589bd69b
EZ
51442012-09-22 Eli Zaretskii <eliz@gnu.org>
5145
5146 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5147 the new overlay string. (Bug#10159)
5148
01108e3f
PE
51492012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5150
5151 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5152 or that fprintf is async-signal-safe. POSIX doesn't require
5153 either assumption.
5154
82f8cd94
CY
51552012-09-22 Chong Yidong <cyd@gnu.org>
5156
5157 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5158 (Bug#8207).
5159
3cccbd87
KH
51602012-09-22 Kenichi Handa <handa@gnu.org>
5161
5162 * composite.c (composition_reseat_it): Handle the case that a
5163 grapheme cluster is not covered by a single font (Bug#12352).
5164
09c01941
CY
51652012-09-21 Chong Yidong <cyd@gnu.org>
5166
5167 * image.c (define_image_type): Avoid adding duplicate types to
5168 image_types (Bug#12463). Suggested by Jörg Walter.
5169
acfa068f 51702012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
5171
5172 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5173 (print_load_command_name): Add case LC_DATA_IN_CODE.
5174 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5175
acfa068f 51762012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
5177
5178 * eval.c (Frun_hook_with_args_until_success)
5179 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5180
acfa068f 51812012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
5182
5183 * fileio.c (Ffile_selinux_context): Only call freecon when
5184 lgetfilecon succeeded.
5185 (Fset_file_selinux_context): Likewise. (Bug#12444)
5186
acfa068f 51872012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
5188
5189 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5190 reordering, locate the cursor by calling set_cursor_from_row; if
5191 that fails, clear the desired glyph matrix before returning a
5192 failure indication to the caller. Fixes leaving garbled display
5193 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
5194 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5195 scrolling through multibyte text.
aa36e4d2 5196
e99f70c8
SM
51972012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5198
5199 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5200 calling mark_vectorlike since that's the one that marks the window.
5201 (mark_discard_killed_buffers): Mark the final cdr.
5202 * window.h (struct window): Move prev/next_buffers to the
5203 non-standard fields.
5204 * window.c (make_window): Initialize prev/next_buffers manually.
5205
f75beb47
PE
52062012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5207
5208 Omit unused arg EXPECTED from socket hooks.
5209 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5210 * nsterm.m (ns_term_init):
5211 * termhooks.h (struct terminal.read_socket_hook):
5212 * w32inevt.c (w32_console_read_socket):
5213 * w32term.c (w32_read_socket):
5214 * xterm.c (XTread_socket):
5215 Omit unused arg EXPECTED. All callers changed.
5216 (store_user_signal_events): Return void, not int, since callers no
5217 longer care about the return value. All uses changed.
5218
b019b76a
JB
52192012-09-20 Juanma Barranquero <lekktu@gmail.com>
5220
5221 * w32gui.h (XParseGeometry): Do not declare.
5222
05642592
PE
52232012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5224
e4bce92a 5225 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 5226 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
5227 <http://bugs.gnu.org/12471#8> (last line).
5228
05642592
PE
5229 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5230 (XParseGeometry): Now static. Substitute extremal values for
5231 values that are out of range.
5232
e543ae91
JD
52332012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5234
5235 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5236
5237 * nsfns.m (XParseGeometry): Remove.
5238 (Fx_create_frame): Call x_set_offset to correctly interpret
5239 top_pos in geometry.
5240
3a880af4 5241 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
5242 (Fx_parse_geometry): If there is a space in string, call
5243 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5244
45ba16c7
EZ
52452012-09-17 Eli Zaretskii <eliz@gnu.org>
5246
c8b9f1bc
EZ
5247 * search.c (scan_buffer): Use character positions in calls to
5248 region_cache_forward and region_cache_backward, not byte
5249 positions. (Bug#12196)
5250
b4c932a2
EZ
5251 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5252 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5253
45ba16c7
EZ
5254 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5255 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5256 emacs_blocked_malloc, now deleted.
5257
eeceac93
PE
52582012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5259
5260 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5261 The workaround was for improving performance on Solaris 2.4, but
5262 is getting in the way now. Emacs will still work if someone is
5263 still running Solaris 2.4 in a museum somewhere; Sun dropped
5264 support for Solaris 2.4 in 2003.
5265 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5266 * process.c (create_process) [HAVE_WORKING_VFORK]:
5267 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5268 since Emacs no longer uses vfork on that platform.
5269
78f83752
GM
52702012-09-17 Glenn Morris <rgm@gnu.org>
5271
5272 * emacs.c: Use COPYRIGHT.
5273
634b8cac
PE
52742012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5275
0caaedb1
PE
5276 Remove configure's --without-sync-input option (Bug#12450).
5277 When auditing signal-handling in preparation for cleaning it up,
5278 I found that SYNC_INPUT has race conditions and would be a real
5279 pain to fix. Since it's an undocumented and deprecated
5280 configure-time option, now seems like a good time to remove it.
5281 Also see <http://bugs.gnu.org/11080#16>.
5282 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5283 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5284 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5285 (malloc_hysteresis):
5286 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5287 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5288 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5289 (dont_register_blocks, bytes_used_when_reconsidered)
5290 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5291 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5292 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 5293 Remove. All uses removed.
0caaedb1
PE
5294 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5295 implementation, one that depends on whether the new macro
5296 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5297 is defined.
5298 * atimer.c (run_timers, handle_alarm_signal):
5299 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5300 (handle_async_input, process_pending_signals)
5301 (handle_input_available_signal, init_keyboard):
5302 * nsterm.m (ns_read_socket):
5303 * process.c (wait_reading_process_output):
5304 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5305 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5306 (emacs_write):
5307 * xterm.c (XTread_socket):
5308 Assume SYNC_INPUT.
5309 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5310 * eval.c (handling_signal): Remove. All uses removed.
5311 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5312 All uses replaced with the SYNC_INPUT version.
5313 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5314 Remove decls.
5315 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5316 Now static.
5317
634b8cac
PE
5318 * font.c (Ffont_shape_gstring): Remove unused local.
5319
83da1b55
GM
53202012-09-16 Glenn Morris <rgm@gnu.org>
5321
518650a5
GM
5322 * Makefile.in (clean): No longer run nextstep's clean.
5323
83da1b55
GM
5324 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5325 (ns_frag): Remove.
5326 (ns-app): Move here from ns.mk, and simplify.
5327 (clean): Simplify nextstep entry.
5328 * ns.mk: Remove file.
5329
85a43e2e
KH
53302012-09-17 Kenichi Handa <handa@gnu.org>
5331
5332 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5333 not covert the last few charactes.
5334
ba13e616 53352012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
5336
5337 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5338 here, but just check the validity of glyphs in the glyph-string.
5339
a8c729af
MR
53402012-09-16 Martin Rudalics <rudalics@gmx.at>
5341
3a880af4
SM
5342 * window.c (Fwindow_parameter, Fset_window_parameter):
5343 Accept any window as argument (Bug#12452).
a8c729af 5344
c077c059
JD
53452012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5346
5347 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5348 to ns_term_init to avoid memory leak.
5349
5350 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5351 explicit retain/release.
5352 (ns_term_init): Only allow one display. Initialize outerpool and
5353 ns_*_types.
5354
39a57ad0
PE
53552012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5356
5357 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5358 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5359 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5360 the Microsoft problem in a different way, by altering ../nt/config.nt.
5361
7105c8cb
EZ
53622012-09-15 Eli Zaretskii <eliz@gnu.org>
5363
5364 * w32xfns.c:
5365 * w32uniscribe.c:
5366 * w32term.c:
5367 * w32select.c:
5368 * w32reg.c:
5369 * w32proc.c:
5370 * w32menu.c:
5371 * w32inevt.c:
5372 * w32heap.c:
5373 * w32font.c:
5374 * w32fns.c:
5375 * w32console.c:
5376 * w32.c:
5377 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5378 by lisp.h. This completes removal of setjmp.h inclusion
5379 erroneously announced in the previous commit. (Bug#12446)
5380
5381 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5382 more accurate.
5383
5384 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5385 not defined as a macro. The latter happens on MS-Windows.
5386 (Bug#12446)
5387
0328b6de
PE
53882012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5389
5390 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5391 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 5392 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
5393 only reason for the instance was because "lisp.h" was included.
5394 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5395 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5396 and _longjmp with the new symbols. Emacs already uses _setjmp if
5397 available, so this change affects only POSIXish hosts that have
5398 sigsetjmp but not _setjmp, such as some versions of Solaris and
5399 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5400 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5401 (png_load_body) [HAVE_PNG]:
5402 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5403 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5404 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5405 since PNG requires jmp_buf. This is the only exception to the
5406 general rule that we now use sys_setjmp and sys_longjmp.
5407 This exception is OK since this code does not change the signal
5408 mask or longjmp out of a signal handler.
5409
2af03429
PE
54102012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5411
5412 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5413 Include "syssignal.h", for 'main_thread'.
5414
2f294edf
DA
54152012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5416
5417 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
5418 * insdel.c (replace_range, replace_range_2):
5419 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
5420 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5421 Remove redundant check before calling offset_intervals.
5422
6b533e9c
MR
54232012-09-14 Martin Rudalics <rudalics@gmx.at>
5424
5425 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5426 current buffer (Bug#12387).
5427
2a7931e3
JB
54282012-09-14 Juanma Barranquero <lekktu@gmail.com>
5429
5430 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5431
c18e885b
PE
54322012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5433
5434 Use a more backwards-compatible timer format (Bug#12430).
5435 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5436 vector element, not from the 4th, since PSECS is now at the end.
5437 (Fcurrent_idle_time): Doc fix.
5438
d59a1afb
DA
54392012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5440
5441 Function to mark objects and remove killed buffers at once.
5442 * alloc.c (discard_killed_buffers): Rename to ...
5443 (mark_discard_killed buffers) ... new name. Add marking
5444 of remaining objects. Fix comment. Adjust users.
5445 (mark_object): Do not touch frame buffer lists here.
5446 * frame.c (delete_frame): Reset frame buffer lists here.
5447
5f0cb45a
PE
54482012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5449
8ea47e3a
PE
5450 Better workaround for GNOME bug when --enable-gcc-warnings.
5451 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5452 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5453 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5454
4a4bbad2
PE
5455 Simplify SIGIO usage (Bug#12408).
5456 The code that dealt with SIGIO was crufty and confusing, e.g., it
5457 played tricks like "#undef SIGIO" but these tricks were not used
5458 consistently. Simplify mostly by not #undeffing standard symbols,
5459 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5460 or not as we please) rather than "defined SIGIO" (standard symbol
5461 that we probably shouldn't #undef).
5462 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5463 Modules that need it can include it.
5464 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5465 * dispextern.h (ignore_sigio): New decl.
5466 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5467 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5468 * emacs.c (shut_down_emacs):
5469 * keyboard.c (kbd_buffer_store_event_hold):
5470 Use ignore_sigio rather than invoking 'signal' directly.
5471 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5472 for FIONREAD.
5473 (FIONREAD, SIGIO): Do not #undef.
5474 (tty_read_avail_input): Use #error rather than a syntax error.
5475 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5476 for I_PIPE, used by SETUP_SLAVE_PTY.
5477 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5478 * sysdep.c (croak): Remove; no longer needed. This bit of
5479 temporary code, with Fred N. Fish's comment that it's temporary,
5480 has been in Emacs since at least 1992!
5481 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5482 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5483 * syssignal.h (croak): Remove decl.
5484 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5485 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5486 now that we're termios-only.
5487 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5488 * term.c (dissociate_if_controlling_tty): Use #error rather than
5489 a run-time error.
5490
5f0cb45a
PE
5491 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5492 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5493 to work around GNOME bug 683906.
5494 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5495 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5496 This works around GCC bug 54561.
5497
40bce90b
PE
54982012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5499
5500 More fixes for 'volatile' and setjmp/longjmp.
5501 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5502 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5503 (png_load_body) [HAVE_PNG]:
5504 (jpeg_load_body) [HAVE_JPEG]:
5505 New function, with most of the old parent function's body.
5506 (png_load) [HAVE_PNG]:
5507 (jpeg_load) [HAVE_JPEG]:
5508 Invoke the new function, to avoid longjmp munging our locals.
5509 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5510 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5511 longjmp is passed 2, as the C standard doesn't guarantee this.
5512 Instead, store the failure code into mgr->failure_code.
5513
bfeae2cf
SM
55142012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5515
5516 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5517 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5518 (syms_of_keyboard): Remove support for unread-command-char.
5519
8099e36b
EZ
55202012-09-12 Eli Zaretskii <eliz@gnu.org>
5521
5522 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5523 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5524 violation. (Bug#12426)
5525
92547ff9
PE
55262012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5527
5528 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5529
45b82ad0
SM
55302012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5531
5532 * eval.c: Add `inhibit-debugger'.
5533 (Qinhibit_debugger): New symbol.
5534 (call_debugger): Bind it instead of Qdebug_on_error.
5535 (maybe_call_debugger): Test Vinhibit_debugger.
5536 (syms_of_eval): Define inhibit-debugger.
5537 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5538 (syms_of_xdisp): Remove inhibit-debug-on-message.
5539
5779a1dc
PE
55402012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5541
50f2e553
PE
5542 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5543 If a nonvolatile local variable is written before a _longjmp to
5544 the frame containing the variable, and is read after the _longjmp,
5545 the value read is indeterminate. Some local variables of type
5546 'struct handler' and 'struct catchtag' are used in this way, so
5547 mark each of their slots as volatile if the slot can be set before
5548 _longjmp and read afterwards.
5549 * lisp.h (struct handler): var and chosen_clause are now volatile.
5550 (struct catchtag): val, next, and pdlcount are now volatile.
5551
ae1d87e2
PE
5552 * bidi.c (bidi_push_it, bidi_pop_it):
5553 * fns.c (copy_hash_table):
5554 * image.c (define_image_type):
5555 * keyboard.c (kbd_buffer_store_event_hold):
5556 * process.c (Fprocess_send_eof):
5557 * xfaces.c (x_create_gc) [HAVE_NS]:
5558 * xgselect.c (xg_select):
5559 Prefer assignment to memcpy when either will do.
5560
5779a1dc
PE
5561 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5562 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5563 time an item is removed. No need to mark this function 'inline';
5564 the compiler knows better than we do.
5565
c4c9756b
JD
55662012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5567
5568 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5569 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5570 to change_frame_size (Bug#12388).
5571 (windowDidResize:): Pass YES to updateFrameSize.
5572
5573 * nsterm.h: Add delay parameter to updateFrameSize.
5574
d73e321c
DA
55752012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5576
5577 Discard killed buffers from deleted window and frame objects.
5578 This reduces an amount of references to killed buffers and
5579 helps GC to reclaim them faster.
5580 * alloc.c (discard_killed_buffers): New function.
5581 (mark_object): Use it for deleted windows and frames.
5582 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 5583 or deleted frame, restore its global binding.
d73e321c
DA
5584 * data.c (swap_in_global_binding): Add GC notice.
5585 (swap_in_symval_forwarding): Use convenient set_blv_where.
5586 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5587 * window.h: ... to here.
5588
e578f381
DA
55892012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5590
5591 Convenient macro to check whether the buffer is live.
5592 * buffer.h (BUFFER_LIVE_P): New macro.
5593 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5594 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5595
3057e615
YM
55962012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5597
5598 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5599 composition cases (Bug#12364).
5600
5601 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5602 overhang of succeeding glyphs overlapping box cursor.
5603
5604 * w32term.c (x_draw_glyph_string): Likewise.
5605
6fda35f2
PE
56062012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5607
c990426a
PE
5608 Simplify, document, and port floating-point (Bug#12381).
5609 The porting part of this patch fixes bugs on non-IEEE platforms
5610 with frexp, ldexp, logb.
5611 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5612 Now static.
5613 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5614 support, by removing commented-out code and briefly listing the
5615 C89 functions excluded. The commented-out stuff was confusing
5616 maintenance, e.g., we thought we needed cbrt but it was commented out.
5617 (logb): Remove decl; no longer needed.
5618 (isfinite): New macro, if not already supplied.
5619 (isnan): Don't replace any existing macro.
5620 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5621 are present on all C89 platforms.
5622 (Ffrexp): Do not special-case zero, as frexp does the right thing
5623 for that case.
5624 (Flogb): Do not use logb, as it doesn't have the desired meaning
5625 on hosts that use non-base-2 floating point. Instead, stick with
5626 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5627 frexp, to avoid getting an unspecified result.
5628
6fda35f2
PE
5629 * xdisp.c (Qinhibit_debug_on_message): Now static.
5630
16130a58
JD
56312012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5632
5633 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5634 NSBezierPath (Bug#12131).
5635
d105a573
CY
56362012-09-10 Chong Yidong <cyd@gnu.org>
5637
5638 * fns.c (Fdelq, Fdelete): Doc fix.
5639
ff55dfe8
PE
56402012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5641
5642 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5643 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5644
e7032e7c
SM
56452012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5646
5647 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5648 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5649 Use it.
5650
e9957956
EZ
56512012-09-09 Eli Zaretskii <eliz@gnu.org>
5652
aba05ce9
EZ
5653 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5654 left fringe if the window has a left margin. This avoids leaving
5655 traces of the cursor because its leftmost pixel is not drawn over.
5656
e9957956
EZ
5657 * dispnew.c (update_window_line): When the left margin area of a
5658 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5659 that screen line. (Bug#12277)
5660
f6196b87
PE
56612012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5662
5663 Assume C89 or later for math functions (Bug#12381).
5664 This simplifies the code, and makes it a bit smaller and faster,
5665 and (most important) makes it easier to clean up signal handling
5666 since we can stop worring about floating-point exceptions in
5667 library code. That was a problem before C89, but the problem
5668 went away many years ago on all practical Emacs targets.
5669 * data.c, image.c, lread.c, print.c:
5670 Don't include <math.h>; no longer needed.
5671 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5672 might be autoconfigured, as that never happens.
5673 * data.c (fmod):
5674 * doprnt.c (DBL_MAX_10_EXP):
5675 * print.c (DBL_DIG):
5676 Remove. C89 or later always defines these.
5677 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5678 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5679 (arith_error, domain_error, domain_error2):
5680 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5681 no longer needed -- we simply return what C returns. All uses removed.
5682 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5683 the wrapped code.
5684 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5685 Remove. All uses expanded, as these macros are no longer used
5686 more than once and are now more trouble than they're worth.
5687 (Ftan): Use tan, not sin / cos.
5688 (Flogb): Assume C89 frexp.
5689 (fmod_float): Assume C89 fmod.
5690 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
5691 (init_floatfns): Remove. All uses removed.
5692
9d7f1863
JD
56932012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5694
5695 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
5696 compositeToPoint for OSX < 10.6 (Bug#12390).
5697
eabf0404
PE
56982012-09-08 Paul Eggert <eggert@cs.ucla.edu>
5699
5700 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
5701 This produces more-accurate results.
5702
0b3b1d23
JD
57032012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5704
5705 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
5706 changes (Bug#12088).
5707
6dcef6ec
CY
57082012-09-08 Chong Yidong <cyd@gnu.org>
5709
5710 * syntax.c (Fstring_to_syntax): Doc fix.
5711
aa7d57c5
JD
57122012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5713
5714 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
5715 in the internal border.
5716 (x_set_window_size): Remove static variables and their usage.
5717 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
5718 (ns_after_update_window_line, ns_draw_fringe_bitmap):
5719 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
5720 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
5721 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
5722 (ns_fix_rect_ibw): Remove.
5723 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
5724 (ns_dumpglyphs_box_or_relief): Ditto.
5725 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
5726 adjustment.
5727 (ns_dumpglyphs_image): Ditto.
fc0c31f8 5728 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
5729 border adjustment.
5730 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
5731 their usage. Add fringe_extended_p and its use as in other terms.
5732 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
5733 scroll bar was removed.
5734 (updateFrameSize): New function.
5735 (windowDidResize): Move code to updateFrameSize and call it.
5736
5737 * nsterm.h (EmacsView): Add updateFrameSize.
5738
1a5432bc
CY
57392012-09-07 Chong Yidong <cyd@gnu.org>
5740
b4f5313e
CY
5741 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
5742
1a5432bc
CY
5743 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
5744
1a4f1e9b
PE
57452012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5746
5747 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
5748 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
5749 Problem introduced when merging patches. Noted by Eli Zaretskii in
5750 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
5751 * floatfns.c: Comment fix.
5752 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
5753 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
5754 and anyway the declaration is harmless even if SIGDANGER is not defined.
5755 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
5756 defined BROKEN_FIONREAD). systty.h formerly did this, but other
5757 source files not surprisingly expected syssignal.h to define, or
5758 not define, SIGIO, and it's cleaner to do it that way, for consistency.
5759 Include <sys/ioctl.h>, for FIONREAD.
5760 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
5761 This eliminates a problem whereby other files mysteriously had
5762 to include "syssignal.h" before including "systty.h" if they
5763 wanted to use "#ifdef SIGIO".
5764
bc8000ff
EZ
57652012-09-07 Eli Zaretskii <eliz@gnu.org>
5766
3e6d6928
EZ
5767 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
5768
5769 * w32.c (sigemptyset): Empty the set.
5770 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
5771
bc8000ff
EZ
5772 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5773
b4fa72f2
DA
57742012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5775
5776 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5777 (mark_object): Likewise for frame objects.
5778
30730c93
PE
57792012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5780
5781 * syssignal.h (handle_on_main_thread): Always declare,
5782 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5783 This ports to platforms without HAVE_PTHREAD.
5784
2fe28299
PE
57852012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5786
5787 Signal-handler cleanup (Bug#12327).
5788 Emacs's signal handlers were written in the old 4.2BSD style with
5789 sigblock and sigmask and so forth, and this led to some
5790 inefficiencies and confusion. Rewrite these to use
5791 pthread_sigmask etc. without copying signal sets around. Also,
5792 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5793 'signal', and instead use functions that do not attempt to take
5794 over the system name space. This patch causes Emacs's text
5795 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5796 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5797 Do not include <signal.h> or "syssignal.h", as these
5798 modules do not use signals.
5799 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5800 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5801 Do not include <signal.h>, as "syssignal.h" does that for us now.
5802 * atimer.c (sigmask_atimers): New function.
5803 (block_atimers, unblock_atimers): New functions,
5804 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5805 All uses replaced.
5806 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5807 no longer needed here.
5808 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 5809 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
5810 * sysdep.c (struct save_signal): New member 'action', replacing
5811 old member 'handler'.
5812 (save_signal_handlers, restore_signal_handlers):
5813 Use sigaction instead of 'signal' to save and restore.
5814 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5815 New function. All users of 'signal' modified to use set_sighandler
5816 if they're writeonly, and to use sys_signal if they're read+write.
5817 (emacs_sigaction_init, forwarded_signal): New functions.
5818 (sys_signal): Remove. All uses replaced by calls to sigaction
5819 and emacs_sigaction_init, or by direct calls to 'signal'.
5820 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5821 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5822 all uses replaced by pthread_sigmask etc. calls.
5823 * syssignal.h: Include <signal.h>.
5824 (emacs_sigaction_init, forwarded_signal): New decls.
5825 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5826 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5827 (sigmask, sys_sigmask): Remove; no longer needed.
5828 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5829 (sigblock, sigunblock, sigfree):
5830 (sigsetmask) [!defined sigsetmask]:
5831 Remove. All uses replaced by pthread_sigmask.
5832 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
5833 no longer need to be replaced, and its typical old uses
5834 are now done via emacs_sigaction_init and sigaction.
5835 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
5836 (sys_sigdel): Remove; unused.
5837 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
5838
0216c128
EZ
58392012-09-06 Eli Zaretskii <eliz@gnu.org>
5840
5841 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
5842 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5843
c752cfa9
DA
58442012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5845
5846 Explicitly mark buffer_defaults and buffer_local_symbols.
5847 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5848 mark_local_symbols here.
5849 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
5850 since special buffers aren't marked here any more.
5851 (allocate_buffer): Chain new buffer with all_buffers here...
5852 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
5853 not here.
5854 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
5855 (syms_of_buffer): Remove staticpro of the above.
5856 (init_buffer_once): Set names for buffer_defaults and
5857 buffer_local_symbols.
5858
a864ef14
PE
58592012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5860
5861 Use bool for booleans in font-related modules.
5862 * font.c (font_intern_prop, font_style_to_value)
5863 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
5864 (generate_otf_features, font_check_otf_features, font_check_otf)
5865 (font_match_p, font_list_entities, font_at):
5866 * fontset.c (fontset_id_valid_p, reorder_font_vector
5867 (fontset_find_font, Fset_fontset_font)
5868 (face_suitable_for_char_p) [0]:
5869 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
5870 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
5871 (m17n_flt_initialized, ftfont_shape_by_flt):
5872 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
5873 * nsfont.m (nsfont_draw):
5874 * w32font.c (w32font_draw):
5875 * w32term.c (x_draw_glyphless_glyph_string_foreground):
5876 Use bool for booleans.
5877 * font.h: Adjust to above API changes.
5878 (struct font, struct font_driver, struct font_driver_list):
5879 Use bool for booleans.
5880 (struct font): Remove useless member encoding_type.
5881 All users removed.
5882 * fontset.c, xftfont.c: Omit unnecessary static decls.
5883
0699fc18
DA
58842012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5885
5886 * alloc.c (mark_object): Revert window marking code
5887 since it's unsafe for the Fset_window_configuration.
5888
20ef56db
PE
58892012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5890
2fe28299 5891 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
5892 Be more systematic about preserving errno whenever a signal
5893 handler returns, even if it's not in the main thread. Do this by
5894 renaming signal handlers to distinguish between signal delivery
5895 and signal handling. All uses changed.
5896 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
5897 * data.c (deliver_arith_signal): Rename from arith_error.
5898 * dispnew.c (deliver_window_change_signal): Rename from
5899 window_change_signal.
5900 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
5901 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
5902 * keyboard.c (deliver_input_available_signal): Rename from
5903 input_available_signal.
5904 (deliver_user_signal): Rename from handle_user_signal.
5905 (deliver_interrupt_signal): Rename from interrupt_signal.
5906 * process.c (deliver_pipe_signal): Rename from send_process_trap.
5907 (deliver_child_signal): Rename from sigchld_handler.
5908 * atimer.c (handle_alarm_signal):
5909 * data.c (handle_arith_signal):
5910 * dispnew.c (handle_window_change_signal):
5911 * emacs.c (handle_fatal_signal, handle_danger_signal):
5912 * keyboard.c (handle_input_available_signal):
5913 * keyboard.c (handle_user_signal, handle_interrupt_signal):
5914 * process.c (handle_pipe_signal, handle_child_signal):
5915 New functions, with the actual signal-handling code taken from the
5916 original respective signal handlers, sans the sporadic attempts to
5917 preserve errno, since that's now done by handle_on_main_thread.
5918 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
5919 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
5920 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5921 Move to sysdep.c.
5922 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5923 Move initialization of main_thread to sysdep.c's init_signals.
5924 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
5925 our usage, and simplifies the mainline code.
5926 (record_child_status_change): New static function, as a helper
5927 for handle_child_signal, and with most of the old child handler's
5928 contents.
5929 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
5930 (handle_child_signal): Use the above.
5931 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5932 Moved here from emacs.c.
5933 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
5934 code moved here from emacs.c's main function.
5935 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
5936 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
5937 This lets callers save and restore errno properly.
20ef56db 5938
e3ccf108
DA
59392012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5940
5941 Remove redundant or unused things here and there.
5942 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
5943 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
5944 * editfns.c (Fcompare_buffer_substrings): Likewise.
5945 * frame.h (struct terminal, struct font_driver_list):
5946 Remove redundant declarations.
5947 * window.h (Qleft, Qright): Likewise.
5948
697e1e39
DA
59492012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5950
5951 Do not mark objects from deleted buffers, windows and frames.
5952 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
5953 (mark_object): Likewise for windows and frames.
5954
c1ca42ca
DA
59552012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5956
5957 * alloc.c (valid_lisp_object_p): Treat killed buffers,
5958 buffer_defaults and buffer_local_symbols as valid objects.
5959 Return special value to denote them.
5960
014d93be
PE
59612012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5962
f75d7a91
PE
5963 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
5964 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
5965 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
5966 (file_name_absolute_p, Fsubstitute_in_file_name):
5967 (check_executable, check_writable, Ffile_accessible_directory_p)
5968 (Fset_file_selinux_context, Fdefault_file_modes)
5969 (Finsert_file_contents, choose_write_coding_system)
5970 (Fwrite_region, build_annotations, a_write, e_write)
5971 (Fdo_auto_save):
5972 * filelock.c (boot_time_initialized, get_boot_time)
5973 (get_boot_time_1, lock_file_1, within_one_second):
5974 * floatfns.c (in_float):
5975 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
5976 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
5977 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
5978 * lisp.h (struct Lisp_Hash_Table.cmpfn):
5979 * window.c (compare_window_configurations):
5980 Use bool for booleans.
5981 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
5982 (Fdefault_file_modes): Now mode_t, not int, for modes.
5983 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
5984 (internal_delete_file): Now returns void, not a (boolean) int,
5985 since nobody was looking at the return value.
5986 * lisp.h, window.h: Adjust to above API changes.
5987
014d93be
PE
5988 * xdisp.c (set_message): Simplify and reindent last change.
5989
776f29e1
JB
59902012-09-05 Juanma Barranquero <lekktu@gmail.com>
5991
5992 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
5993
7f7e0167
LI
59942012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
5995
5996 * eval.c (call_debugger): Make the function non-static so that we
5997 can call it from set_message.
5998
5999 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6000 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6001
cf29dd84
PE
60022012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6003
6004 Give more-useful info on a fatal error (Bug#12328).
6005 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6006 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6007 of doing the work ourselves.
6008 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6009 do most of the work.
6010 (fatal_error_backtrace): New function, taken from the guts
6011 of the old fatal_error_signal, but with a new option to output
6012 a backtrace.
6013 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6014 info about the signal than just its number.
6015 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6016 * sysdep.c: Include <execinfo.h>
6017 (emacs_backtrace): New function, taken partly from the previous
6018 code of the 'die' function.
6019 (emacs_abort): Call fatal_error_backtrace rather than abort.
6020
972debf2
SM
60212012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6022
6023 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6024 eager (load-time) macro-expansion.
6025 * lisp.mk (lisp): Add macroexp.
6026
1088b922
PE
60272012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6028
6029 Simplify redefinition of 'abort' (Bug#12316).
6030 Do not try to redefine the 'abort' function. Instead, redo
6031 the code so that it calls 'emacs_abort' rather than 'abort'.
6032 This removes the need for the NO_ABORT configure-time macro
6033 and makes it easier to change the abort code to do a backtrace.
6034 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6035 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6036 Remove; sysdep.c's emacs_abort now takes its place.
6037 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6038 'abort' changed to use 'emacs_abort'.
6039 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6040 (abort) [!defined abort]: Rename to ...
6041 (emacs_abort): ... new name.
6042 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6043 the place of the old 'abort' in emacs.c.
6044 * w32.c, w32fns.c (abort): Do not #undef.
6045 * w32.c (emacs_abort): Rename from w32_abort.
6046
30934d33
EZ
60472012-09-04 Eli Zaretskii <eliz@gnu.org>
6048
6049 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6050 offsets[j].dv, since the y axis of the screen coordinates points
6051 down, while the y axis of the font definition coordinates points
6052 up. This fixes display of Arabic diacritics such as KASRA and
6053 KASRATAN. (Bug#11860)
6054
af26b72c
PE
60552012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6056
6057 Be more systematic about _setjmp vs setjmp.
6058 * alloc.c (test_setjmp, mark_stack):
6059 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6060 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6061 (png_load, my_error_exit, jpeg_load):
6062 * process.c (send_process_trap, send_process):
6063 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6064 The underscored versions are up to 30x faster on some hosts.
6065 Formerly, the code used setjmp+longjmp sometimes and
6066 _setjmp+_longjmp at other times, with no particular reason to
6067 prefer setjmp+longjmp.
6068
26d4541d
PE
60692012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6070
d42f4f0f 6071 Fix minor problem found by static checking.
26d4541d 6072 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 6073
c5e28e39
MR
60742012-09-03 Martin Rudalics <rudalics@gmx.at>
6075
6076 * buffer.c (Fdelete_all_overlays): New function.
6077
3eab3ca9
CY
60782012-09-03 Chong Yidong <cyd@gnu.org>
6079
6080 * gtkutil.c: Add extern decl for Qxft.
6081
c04889f8
PE
60822012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6083
1882aa38
PE
6084 * emacs.c, eval.c: Use bool for boolean.
6085 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6086 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6087 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6088 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6089 (main, decode_env_path, Fdaemon_initialized):
6090 * eval.c (call_debugger, Finteractive_p, interactive_p):
6091 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6092 (maybe_call_debugger, Fbacktrace):
6093 * process.c (read_process_output, exec_sentinel):
6094 Use bool for booleans.
6095 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6096 All callers changed.
6097 * eval.c (interactive_p): Omit always-true boolean argument
6098 EXCLUDE_SUBRS_P. All callers changed.
6099 * dispextern.h, lisp.h: Reflect above API changes.
6100 * firstfile.c (dummy): Use the address of 'main', whose signature
6101 won't change, instead of the address of 'initialize', whose
6102 signature just changed from int to bool.
6103 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6104 * msdos.c (fatal_error_in_progress): ... from here.
6105 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6106 of incrementing it.
6107 (redisplay_internal, unwind_redisplay): Simply clear
6108 REDISPLAYING_P when unwinding, instead of saving its previous,
6109 always-false value and then restoring it.
6110
a411ac43
PE
6111 Clean up some extern decls.
6112 Mostly, this hoists extern decls out of .c files and into .h files.
6113 That way, we're more likely to catch errors if the interfaces change.
6114 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6115 declare xg_mark_data.
6116 * dispextern.h (x_frame_parm_handlers):
6117 * font.h (Qxft):
6118 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6119 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6120 (Qultra_bold, Qoblique, Qitalic):
6121 Move extern decl here from .c file.
6122 * alloc.c (xg_mark_data) [USE_GTK]:
6123 * doc.c (Qclosure):
6124 * eval.c (Qlexical_binding):
6125 * fns.c (time) [!HAVE_UNISTD_H]:
6126 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6127 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6128 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6129 * lread.c (Qinternal_interpreter_environment):
6130 * minibuf.c (Qbuffer):
6131 * process.c (QCfamily, QCfilter):
6132 * widget.c (free_frame_faces):
6133 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6134 * xfont.c (x_clear_errors):
6135 * xterm.c (x_frame_parm_handlers):
6136 Remove now-redundant extern decls.
6137 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6138 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6139 Now static.
6140 * xfaces.c: Remove unnecessary static decls.
6141 * xterm.c (updating_frame): Remove decl of nonexistent object.
6142
c04889f8
PE
6143 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6144 when building globals.h, as the objects that are not built on
6145 this host are not needed to compile C files on this host.
6146
8b339673
JD
61472012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6148
6149 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6150
6151 * frame.h: Add missing prototype for x_wm_set_size_hint.
6152
a08d4ba7
PE
61532012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6154
6155 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6156 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6157 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6158 (Fsubstitute_command_keys):
6159 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6160 (save_excursion_save, save_excursion_restore)
6161 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6162 (format_time_string, general_insert_function)
6163 (make_buffer_string, make_buffer_string_both)
6164 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6165 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6166 (copy_text, insert_1, insert_1_both, insert_from_string)
6167 (insert_from_string_before_markers, insert_from_string_1)
6168 (insert_from_buffer, insert_from_buffer_1, replace_range)
6169 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6170 (del_range_2, modify_region):
6171 * intervals.c (intervals_equal, balance_possible_root_interval)
6172 (adjust_intervals_for_insertion, merge_properties_sticky)
6173 (graft_intervals_into_buffer, lookup_char_property)
6174 (adjust_for_invis_intang, set_point_both)
6175 (get_property_and_range, compare_string_intervals)
6176 (set_intervals_multibyte_1, set_intervals_multibyte):
6177 * keyboard.c (decode_timer):
6178 Use bool for boolean.
6179 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6180 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6181
48c948de
CY
61822012-09-02 Chong Yidong <cyd@gnu.org>
6183
6184 * keymap.c (push_key_description): Print M-TAB as C-M-i
6185 (Bug#11758).
6186
6c49a40b
JB
61872012-09-02 Juanma Barranquero <lekktu@gmail.com>
6188
6189 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6190 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6191 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6192 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6193 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6194 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6195 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6196
4dfbd238
EZ
61972012-09-01 Eli Zaretskii <eliz@gnu.org>
6198
7e510e28
EZ
6199 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6200 more than one grapheme cluster passed to the shaper: compute the
6201 offset adjustment values separately for each cluster. (Bug#11860)
6202
4dfbd238
EZ
6203 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6204 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6205 about implicit conversions from integer to pointer.
6206
86571ae0
DC
62072012-09-01 Daniel Colascione <dancol@dancol.org>
6208
6209 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6210 system used too early.
6211
0e23ef9d
PE
62122012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6213
6214 Better seed support for (random).
6215 * emacs.c (main): Call init_random.
6216 * fns.c (Frandom): Set the seed from a string argument, if given.
6217 Remove long-obsolete Gentzel cruft.
6218 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6219 (init_random): New function.
6220
17a2cbbd
DC
62212012-09-01 Daniel Colascione <dancol@dancol.org>
6222
6223 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6224 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6225 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6226 x_wm_set_size_hint, x_query_colors, x_real_positions,
6227 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6228 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6229 all of which have been moved to common code.
6230
6231 * xfaces.c: Include TERM_HEADER instead of listing all possible
6232 window-system headers.
6233
6234 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6235 to match header.
6236
6237 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6238 directly accessing frame internals.
6239
f18cbb28 6240 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
6241 globals_of_w32font.
6242
6243 * process.c: Include TERM_HEADER instead of listing all possible
6244 window-system headers.
6245
3a880af4
SM
6246 * nsterm.h: Remove declarations now in frame.h.
6247 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
6248
6249 * menu.c: Include TERM_HEADER instead of listing all possible
6250 window-system headers.
6251
6252 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6253 window system.
6254
6255 * keyboard.c: Include TERM_HEADER instead of listing all possible
6256 window-system headers.
6257
6258 * image.c: Include TERM_HEADER instead of listing all possible
6259 window-system headers. Declare Vlibrary_cache when compiling for
6260 Windows.
6261
6262 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6263 window system declarations.
6264
6265 * frame.h: Move common functions here: set_frame_menubar,
6266 x_set_window_size, x_sync, x_get_focus_frame,
6267 x_set_mouse_position, x_set_mouse_pixel_position,
6268 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6269 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6270 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6271 x_activate_menubar, x_real_positions, x_bitmap_icon,
6272 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6273 and x_query_colors.
6274
6275 * frame.c: Include TERM_HEADER instead of listing all possible
6276 window-system headers.
6277
6278 * font.c: Include TERM_HEADER instead of listing all possible
6279 window-system headers.
6280
6281 * emacs.c: Include TERM_HEADER.
6282
f18cbb28
EZ
6283 * dispnew.c: Include TERM_HEADER instead of listing all possible
6284 window-system headers.
17a2cbbd 6285
f18cbb28 6286 * ccl.h: Include character.h.
17a2cbbd
DC
6287
6288 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6289 the current window system; include in list of objects to link into
6290 Emacs.
6291
c650a5de
DA
62922012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6293
6294 Remove mark_ttys function and fix tty_display_info initialization.
6295 * lisp.h (mark_ttys): Remove prototype.
6296 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6297 to mark_ttys because all possible values of 'top_frame' slot are
6298 the frames which are reachable from Vframe_list.
6299 * term.c (mark_ttys): Remove.
6300 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6301
4e0f6479
DA
63022012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6303
6304 Change struct frame bitfields from unsigned char to unsigned.
6305 * frame.h (struct frame): Change type of 'display_preempted',
6306 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6307 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6308 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6309 bitfields from unsigned char to unsigned.
6310
8b96a52c
DA
63112012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6312
6313 Remove unused member of struct x_output and struct w32_output.
6314 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6315 * w32term.h (struct w32_output): Likewise.
6316
b4444c8a
JD
63172012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6318
6319 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6320 does not become zero (Bug#12234).
6321
b98521db
PE
63222012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6323
6324 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6325 for GCC 4.7.1 x86-64.
6326
31d02438
GM
63272012-08-30 Glenn Morris <rgm@gnu.org>
6328
6329 * lread.c (init_lread): For out-of-tree builds, only add the
6330 source directory's site-lisp dir to the load-path if it exists,
6331 consistent with in-tree builds. (Bug#12302)
6332
7f8941d8
JD
63332012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6334
6335 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 6336 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
6337 (windowShouldClose:): Set window_closed.
6338 (dealloc): New member, free button_values.
fc0c31f8
JB
6339 (process_dialog:): Make member function. Remove window argument,
6340 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
6341 in button_values.
6342 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 6343 with tag. Remove return self, declare return value as void.
7f8941d8
JD
6344 (addString:row:): Remove return self, declare return value as void.
6345 (addSplit): Remove return self, declare return value as void.
6346 (clicked:): Remove return self, declare return value as void.
fc0c31f8 6347 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
6348 (initFromContents:isQuestion:): Adjust call to process_dialog.
6349 Code formatting change.
6350 (timeout_handler:): Set timer_fired to YES.
6351 (runDialogAt:): Set timer_fired to NO.
6352 Handle click on close button as quit.
6353
6354 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6355 Add window_closed and button_values. Add void as return value for
6356 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6357 Add process_dialog as new member.
6358
eada0861 63592012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 6360
eada0861
GM
6361 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6362 is not one of the heaps we manage. (Bug#12242)
6363
63642012-08-28 Glenn Morris <rgm@gnu.org>
6365
6366 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6367
457294dd
MR
63682012-08-28 Martin Rudalics <rudalics@gmx.at>
6369
6370 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
6371 auto-buffer-name window parameter. Install revision of reverted
6372 fix.
457294dd 6373
4f2daf31
DA
63742012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6375
6376 Do not allow to set major mode for a dead buffer.
6377 * buffer.c (Fset_buffer_major_mode): Signal an error
6378 if the buffer is dead.
6379 (Fother_buffer, other_buffer_safely): Remove redundant
6380 nested declaration.
6381
66322887
DA
63822012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6383
6384 Always use set_buffer_if_live to restore original buffer at unwind.
6385 * buffer.h (record_unwind_current_buffer): New function.
6386 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6387 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6388 * undo.c, window.c: Adjust users.
6389 * buffer.c (set_buffer_if_live): Fix comment.
6390
a3d794a1
DA
63912012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6392
6393 Fix usage of set_buffer_internal.
6394 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6395 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6396 * coding.c (decode_coding): Omit redundant test.
6397 * fileio.c (decide_coding_unwind): Likewise.
6398 * fns.c (secure_hash): Likewise.
6399 * insdel.c (modify_region): Likewise.
6400 * keyboard.c (command_loop_1): Likewise.
6401 * print.c (PRINTFINISH): Likewise.
6402 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6403
59ea14cd
PE
64042012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6405
6406 * dispnew.c: Use bool for boolean.
6407 (frame_garbaged, display_completed, delayed_size_change)
6408 (fonts_changed_p, add_window_display_history)
6409 (add_frame_display_history, verify_row_hash)
6410 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6411 (row_equal_p, realloc_glyph_pool)
6412 (allocate_matrices_for_frame_redisplay)
6413 (showing_window_margins_p)
6414 (adjust_frame_glyphs_for_frame_redisplay)
6415 (build_frame_matrix_from_leaf_window, make_current)
6416 (mirrored_line_dance, mirror_line_dance, update_frame)
6417 (update_window_tree, update_single_window)
6418 (check_current_matrix_flags, update_window, update_text_area)
6419 (update_window_line, set_window_update_flags, scrolling_window)
6420 (update_frame_1, scrolling, buffer_posn_from_coords)
6421 (do_pending_window_change, change_frame_size)
6422 (change_frame_size_1, sit_for):
6423 Use bool for boolean.
6424 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6425 and remove last int (actually boolean) argument, which was always 0.
6426 All callers changed.
6427 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6428 * dispextern.h (struct composition_it): Use bool for boolean.
6429 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6430 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6431 * dired.c (file_name_completion):
6432 Use bool for boolean. (This was missed in an earlier change.)
6433
95072a94
MR
64342012-08-27 Martin Rudalics <rudalics@gmx.at>
6435
6436 * window.c (Fset_window_configuration): Revert first part of
6437 last change.
6438
0f19feff
JD
64392012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6440
6441 * nsterm.h (NSPanel): New class variable dialog_return.
6442
3a880af4
SM
6443 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6444 Initialize dialog_return.
0f19feff
JD
6445 (windowShouldClose:): Use stop instead of stopModalWithCode.
6446 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6447 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6448 event.
6449 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6450 modal loop returns.
6451
f10fe38f
PE
64522012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6453
de1339b0
PE
6454 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6455 * composite.c (find_composition, composition_gstring_p)
6456 (composition_reseat_it, find_automatic_composition):
6457 * data.c (let_shadows_buffer_binding_p)
6458 (let_shadows_global_binding_p, set_internal, make_blv)
6459 (Fmake_variable_buffer_local, Fmake_local_variable)
6460 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6461 (cons_to_signed, arith_driver):
6462 * dbusbind.c (xd_in_read_queued_messages):
6463 * dired.c (directory_files_internal, file_name_completion):
6464 Use bool for booleans.
6465 * dired.c (file_name_completion):
6466 * process.h (fd_callback):
6467 Omit int (actually boolean) argument. It wasn't being used.
6468 All uses changed.
6469 * composite.h, lisp.h: Reflect above API changes.
6470
f10fe38f
PE
6471 * cmds.c, coding.c: Use bool for booleans.
6472 * cmds.c (move_point, Fself_insert_command):
6473 * coding.h (struct composition status, struct coding_system):
6474 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6475 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6476 (emacs_mule_char, decode_coding_emacs_mule)
6477 (encode_coding_emacs_mule, detect_coding_iso_2022)
6478 (decode_coding_iso_2022, encode_invocation_designation)
6479 (encode_designation_at_bol, encode_coding_iso_2022)
6480 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6481 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6482 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6483 (encode_coding_raw_text, detect_coding_charset)
6484 (decode_coding_charset, encode_coding_charset, detect_eol)
6485 (detect_coding, get_translation_table, produce_chars)
6486 (consume_chars, reused_workbuf_in_use)
6487 (make_conversion_work_buffer, code_conversion_save)
6488 (decode_coding_object, encode_coding_object)
6489 (detect_coding_system, char_encodable_p)
6490 (Funencodable_char_position, code_convert_region)
6491 (code_convert_string, code_convert_string_norecord)
6492 (Fset_coding_system_priority):
6493 * fileio.c (Finsert_file_contents):
6494 Use bool for booleans.
6495 * coding.h, lisp.h: Reflect above API changes.
6496 * coding.c: Remove unnecessary static function decls.
6497 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6498 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6499 not a boolean 'int', since callers never look at the return value.
6500 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6501 * coding.h (decoding_buffer_size, encoding_buffer_size)
6502 (emacs_mule_string_char): Remove unused extern decls.
6503 (struct iso_2022_spec, struct coding_system):
6504 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6505 (struct emacs_mule_spec): Remove unused field 'full_support'.
6506 All initializations removed.
6507 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6508
5474c384
DA
65092012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6510
f10fe38f 6511 Fix spare memory change (Bug#12286).
5474c384
DA
6512 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6513 (valid_lisp_object_p): Likewise.
6514
c4b6914d
MR
65152012-08-27 Martin Rudalics <rudalics@gmx.at>
6516
6517 * window.c (Fset_window_configuration): Record any window's old
6518 buffer if it's replaced (see Bug#8789). If the new current
6519 buffer doesn't appear in the selected window, go to its old
6520 point (Bug#12208).
6521
35aaa1ea
DA
65222012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6523
6524 Special MEM_TYPE_SPARE to denote reserved memory.
6525 * alloc.c (enum mem_type): New memory type.
6526 (refill_memory_reserve): Use new type for spare memory.
6527 This prevents live_cons_p and live_string_p from incorrect
6528 detection of uninitialized objects from spare memory as live.
6529
6af64513
PE
65302012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6531
8b2e00a3
PE
6532 Spelling fixes.
6533 * Makefile.in (.PHONY): versioclean -> versionclean.
6534
b52d6985
PE
6535 Remove unused external symbols.
6536 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6537 * window.c (Qwindow_valid_p, decode_valid_window):
6538 Now static, not extern.
6539 * data.c (Qinterval): Remove; unused.
6540 (syms_of_data): Do not define 'interval'.
6541 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6542 * window.h (decode_valid_window):
6543 Remove decls.
6544
d5172d4f
PE
6545 * character.c, charset.c, chartab.c: Use bool for booleans.
6546 * character.c (lisp_string_width, string_count_byte8)
6547 (string_escape_byte8):
6548 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6549 (load_charset_map_from_file, map_charset_chars)
6550 (Fdefine_charset_internal, define_charset_internal)
6551 (Fdeclare_equiv_charset, find_charsets_in_text)
6552 (Ffind_charset_region, char_charset, Fiso_charset):
6553 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6554 (sub_char_table_set, sub_char_table_set_range)
6555 (char_table_set_range, optimize_sub_char_table)
6556 (map_sub_char_table):
6557 Use bool for boolean.
6558 * character.c (str_to_unibyte): Omit last boolean argument; it was
6559 always 0. All callers changed.
6560 * character.h, charset.h: Adjust to match previous changes.
6561 * character.h (char_printable_p): Remove decl of nonexistent function.
6562 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6563 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6564 are all boolean, so make them single-bit bitfields.
6565
6af64513
PE
6566 * lisp.h (ASET): Remove attempt to detect side effects.
6567 It was meant to be temporary and it often doesn't work,
6568 because when IDX has side effects the behavior of IDX==IDX
6569 is undefined. See Stefan Monnier in
6570 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6571
e1f29348
BR
65722012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6573
6574 * lisp.h (functionp): New function (extracted from Ffunctionp).
6575 (FUNCTIONP): Use it.
6576 * eval.c (Ffunctionp): Use it.
6577
17c05d74
PE
65782012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6579
0f46bc75
PE
6580 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6581 as that's faster and simpler than static storage. Don't bother
6582 with the g_main_context_query overhead if g_main_context_pending
6583 says no events are pending.
6584 (gfds, gfds_size): Remove these static vars.
6585 (xgselect_initialize): Remove; no longer needed.
6586 All uses and decls removed.
6587
ee4c0f69
PE
6588 * emacs.c (fatal_error_signal_hook): Remove.
6589 All uses removed. This leftover from old code was always 0.
6590
17c05d74
PE
6591 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6592 * casefiddle.c (casify_object, casify_region):
6593 * casetab.c (set_case_table):
6594 * category.c, category.h (word_boundary_p):
6595 * category.h (CHAR_HAS_CATEGORY):
6596 Use bool for booleans, instead of int.
6597
391ceac5
EZ
65982012-08-25 Eli Zaretskii <eliz@gnu.org>
6599
6600 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6601
2f221583
PE
66022012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6603
f4a681b0
PE
6604 On assertion failure, print backtrace if available.
6605 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6606 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6607 * Makefile.in (LIB_EXECINFO): New macro.
6608 (LIBES): Use it.
6609
2f221583
PE
6610 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6611 * bytecode.c (exec_byte_code):
6612 * callint.c (check_mark, Fcall_interactively):
6613 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6614 (getenv_internal, sync_process_alive, call_process_exited):
6615 * lisp.h (USE_SAFE_ALLOCA):
6616 Use bool for booleans, instead of int.
6617 * lisp.h, process.h: Adjust prototypes to match above changes.
6618 * callint.c (Fcall_interactively): Don't assume the mark's
6619 offset fits in 'int'.
6620
37ef52bb
PE
66212012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6622
6623 * buffer.c, buffer.h: Use bool for boolean.
6624 * buffer.c (reset_buffer_local_variables)
6625 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6626 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6627 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6628 (overlay_touches_p, overlay_strings, Foverlay_put)
6629 (report_overlay_modification, call_overlay_mod_hooks):
6630 (mmap_enlarge, mmap_set_vars):
6631 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6632 Use bool for booleans, instead of int.
6633 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6634 since the 1-or-0 return value is always ignored anyway.
6635 (mmap_initialized_p):
6636 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6637 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6638
2cc21167
PE
66392012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6640
6641 * bidi.c: Use bool for boolean.
6642 This is a bit more readable, and makes the text segment of bidi.o
6643 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6644 Presumably it's faster too.
6645 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6646 Now bool.
6647 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6648 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6649 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6650 (bidi_explicit_dir_char, bidi_level_of_next_char)
6651 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6652 Use bool for booleans, instead of int.
6653 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6654 (bidi_unshelve_cache): Adjust decls to match code.
6655
7db4ddf4
MR
66562012-08-23 Martin Rudalics <rudalics@gmx.at>
6657
6658 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6659 argument.
6660
b1bb8011
PE
66612012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6662
6663 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6664 * atimer.h: Include <stdbool.h>.
6665
ff687885
DN
66662012-08-22 Dan Nicolaescu <dann@gnu.org>
6667
6668 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6669 compile time tests instead of run time tests on systems that do
6670 not use them.
6671 (FRAME_MAC_P): Remove leftover from deleted code.
6672 * frame.c (syms_of_frame): Remove leftover from deleted code.
6673
4ce7a138
JD
66742012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6675
6676 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6677
d733ec6d
PE
66782012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6679
6680 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6681 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 6682 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
6683 (fontset_add): Return void, for FONTSET_ADD.
6684
d0d2d26f
PE
66852012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6686
fce31d69
PE
6687 * alloc.c: Use bool for booleans.
6688 (gc_in_progress, abort_on_gc)
6689 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6690 (dont_register_blocks) [GC_MALLOC_CHECK]:
6691 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
6692 (check_string_bytes, make_specified_string, memory_full)
6693 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
6694 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
6695 (mark_stack, valid_pointer_p, make_pure_string)
6696 (Fgarbage_collect, survives_gc_p, gc_sweep):
6697 Use bool for booleans, instead of int.
6698 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6699 Remove unused local.
6700 * alloc.c (PURE_POINTER_P):
6701 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
6702 * editfns.c (Fformat):
6703 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
6704 (Fdo_auto_save):
6705 * fns.c (sweep_weak_table):
6706 * lisp.h (suppress_checking, push_message, survives_gc_p)
6707 (make_pure_string, gc_in_progress, abort_on_gc):
6708 * lread.c (readchar, read1):
6709 * print.c (Fprin1_to_string):
6710 * xdisp.c (push_message):
6711 Use bool for booleans affected directly or indirectly by
6712 alloc.c's changes.
6713
d0d2d26f
PE
6714 Make recently-introduced setters macros.
6715 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
6716 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
6717 (set_fontset_default, set_fontset_fallback): Rename from their
6718 upper-case counterparts, and make them functions rather than macros.
6719 This is more consistent with the other recently-introduced setters.
6720 These don't need to be inline, since they're local.
6721
d18e2bb6
JD
67222012-08-21 Jan Djärv <jan.h.d@swipnet.se>
6723
6724 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
6725 the loop (Bug#12247).
6726
1b9d9d16
PE
67272012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6728
6729 * lisp.h (vcopy): Use memcpy rather than our own loop.
6730 This fixes a performance regression introduced by the recent
6731 addition of vcopy. This means 'vcopy' will need to be modified
6732 for a copying collector, but that's OK. Also, tighten the
6733 checking in the assertion.
6734
b2f09701
EZ
67352012-08-21 Eli Zaretskii <eliz@gnu.org>
6736
6737 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
6738 components for RTL text (Bug#11860). Adjust X-OFFSET of each
6739 non-base glyph for the width of the base character, according to
e1f29348
BR
6740 what x_draw_composite_glyph_string_foreground expects.
6741 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
6742 expectations, to produce correct width of the composed character.
6743 Reverse the sign of the DU offset produced by ScriptPlace.
6744
9b994fed
PE
67452012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6746
6747 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
6748
086ca913
DA
67492012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6750
6751 Avoid direct writes to contents member of struct Lisp_Vector.
6752 * lisp.h (vcopy): New function to copy data into vector.
6753 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
6754 * fns.c (Ffillarray): Use ASET.
6755 * keyboard.c (timer_check_2): Use AREF and ASET.
6756 (append_tool_bar_item, Frecent_keys): Use vcopy.
6757 * lread.c (read_vector): Use ASET.
6758 * msdos.c (Frecent_doskeys): Use vcopy.
6759 * xface.c (Finternal_copy_lisp_face): Use vcopy.
6760 (Finternal_merge_in_global_face): Use ASET and vcopy.
6761 * xfont.c (xfont_list_pattern): Likewise.
6762
5481664a
MR
67632012-08-21 Martin Rudalics <rudalics@gmx.at>
6764
6765 * window.c (Fwindow_point): For the selected window always return
6766 the position of its buffer's point.
6767 (Fset_window_point): For the selected window always go in its
6768 buffer to the specified position.
6769
6d470bdd
DA
67702012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6771
6772 Setter macros for fontsets.
6773 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6774 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6775 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6776 Adjust users.
6777
24564fe1
GM
67782012-08-20 Glenn Morris <rgm@gnu.org>
6779
6780 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6781 Don't assume that `ln -f' works.
6782
0a05a035
EZ
67832012-08-20 Eli Zaretskii <eliz@gnu.org>
6784
6785 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6786 and later about non-assignments with no effect. See discussion at
6787 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6788 details.
6789
e46f2325
DA
67902012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6791
6792 Inline setter functions for Lisp_Objects slots of struct specbinding.
6793 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6794 Adjust users.
6795
734fbd86
MR
67962012-08-20 Martin Rudalics <rudalics@gmx.at>
6797
6798 * window.c (select_window): Always make selected window's buffer
6799 current.
6800
f1a95992
DA
68012012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6802
6803 Use AREF and ASET for docstrings of category tables.
6804 * category.h (CATEGORY_DOCSTRING): Use AREF.
6805 (SET_CATEGORY_DOCSTRING): Use ASET.
6806 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6807
e83064be
DA
68082012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6809
6810 Inline setter functions for hash table members.
6811 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6812 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6813 (set_hash_key_and_value, set_hash_index, set_hash_next)
6814 (set_hash_hash): New functions.
6815 * charset.c, fns.c: Adjust users.
6816
4ce60d2e
DA
68172012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6818
6819 Inline getter and setter functions for per-buffer values.
6820 * buffer.h (per_buffer_default, set_per_buffer_default)
6821 (per_buffer_value, set_per_buffer_value): New functions.
6822 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6823 * buffer.c, data.c: Adjust users.
6824
c06c9690
JB
68252012-08-20 Juanma Barranquero <lekktu@gmail.com>
6826
6827 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6828
32bd4250
PE
68292012-08-19 Paul Eggert <eggert@cs.ucla.edu>
6830
bad03192 6831 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
6832 as gnulib does this if the system doesn't.
6833 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
6834 Remove declaration. MS-Windows declares it on stdlib.h which is
6835 included by conf_post.h.
b69a6d22
PE
6836 * emacs.c (environ) [DOUG_LEA_MALLOC]:
6837 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
6838 * vm-limit.c: Include <unistd.h>, for 'environ'.
6839
22d7feb2
PE
6840 * unexaix.c, unexcoff.c: Include "mem-limits.h".
6841 (start_of_data): Remove decl; mem-limits.h provides it.
6842
32bd4250
PE
6843 * xdisp.c (handle_invisible_prop): Make it a bit faster
6844 and avoid a gcc -Wmaybe-uninitialized diagnostic.
6845
450809af
CY
68462012-08-19 Chong Yidong <cyd@gnu.org>
6847
6848 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
6849 ends (Bug#3874).
6850
9e677988
AS
68512012-08-19 Andreas Schwab <schwab@linux-m68k.org>
6852
6b1319ce
AS
6853 * .gdbinit: Use call instead of set when calling a function in the
6854 inferior.
6855
9e677988
AS
6856 * data.c (set_internal): Don't use set_blv_found.
6857 (Fkill_local_variable): Likewise.
6858
d7191076
AA
68592012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
6860
6861 * nsfont.m (ns_ascii_average_width): Ensure the string
6862 ascii_printable is initialized with a null-terminated character
6863 array. Otherwise, it can contain undesired extra characters.
6864
e757f1c6
PE
68652012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6866
6867 port new setting code to Sun C 5.8 2005/10/13
6868 * chartab.c, lisp.h (char_table_set, char_table_set_range):
6869 Return void, not Lisp_Object. Otherwise, the compiler
6870 complains about (A?B:C) where B is void and C is Lisp_Object
6871 when compiling CHAR_TABLE_SET, due to the recent change to
6872 the API of sub_char_table_set_contents.
6873
a999ce26
CY
68742012-08-18 Chong Yidong <cyd@gnu.org>
6875
6876 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
6877 for the string case (Bug#3874).
6878
3f22b86f
PE
68792012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6880
39eb03f1
PE
6881 * buffer.h (BSET): Remove (Bug#12215).
6882 Replace all uses with calls to new setter functions.
6883 (bset_bidi_paragraph_direction, bset_case_canon_table)
6884 (bset_case_eqv_table, bset_directory, bset_display_count)
6885 (bset_display_time, bset_downcase_table)
6886 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
6887 (bset_last_selected_window, bset_local_var_alist)
6888 (bset_mark_active, bset_point_before_scroll, bset_read_only)
6889 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
6890 (bset_width_table):
6891 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6892 (bset_auto_fill_function, bset_auto_save_file_format)
6893 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6894 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6895 (bset_cache_long_line_scans, bset_case_fold_search)
6896 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6897 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6898 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6899 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6900 (bset_header_line_format, bset_indicate_buffer_boundaries)
6901 (bset_indicate_empty_lines, bset_invisibility_spec)
6902 (bset_left_fringe_width, bset_major_mode, bset_mark)
6903 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6904 (bset_name, bset_overwrite_mode, bset_pt_marker)
6905 (bset_right_fringe_width, bset_save_length)
6906 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6907 (bset_scroll_up_aggressively, bset_selective_display)
6908 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6909 (bset_word_wrap, bset_zv_marker):
6910 * category.c (bset_category_table):
6911 * syntax.c (bset_syntax_table):
6912 New setter functions.
6913
6a09a33b
PE
6914 * process.h (PSET): Remove (Bug#12215).
6915 Replace all uses with calls to new setter functions.
6916 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6917 (PROCESS_INLINE): New macro.
6918 (pset_childp): New setter function.
6919 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
6920 * process.c (PROCESS_INLINE):
6921 Define to EXTERN_INLINE, so that the corresponding functions
6922 are compiled into code.
6923 (pset_buffer, pset_command, pset_decode_coding_system)
6924 (pset_decoding_buf, pset_encode_coding_system)
6925 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
6926 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
6927 (pset_type, pset_write_queue): New setter functions.
6928
e8c17b81
PE
6929 * window.h (WSET): Remove (Bug#12215).
6930 Replace all uses with calls to new setter functions.
6931 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6932 (WINDOW_INLINE): New macro.
6933 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
6934 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
6935 (wset_total_lines, wset_vertical_scroll_bar)
6936 (wset_window_end_pos, wset_window_end_valid)
6937 (wset_window_end_vpos): New setter functions.
6938 * window.c (WINDOW_INLINE):
6939 Define to EXTERN_INLINE, so that the corresponding functions
6940 are compiled into code.
6941 (wset_combination_limit, wset_dedicated, wset_display_table)
6942 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
6943 (wset_new_normal, wset_new_total, wset_next_buffers)
6944 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6945 (wset_prev_buffers, wset_right_fringe_width)
6946 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
6947 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
6948 (wset_window_parameters):
6949 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6950 (wset_column_number_displayed, wset_region_showing):
6951 New setter functions.
6952
3f22b86f
PE
6953 * termhooks.h (TSET): Remove (Bug#12215).
6954 Replace all uses with calls to new setter functions.
6955 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6956 (TERMHOOKS_INLINE): New macro.
6957 (tset_charset_list, tset_selection_alist): New setter functions.
6958 * terminal.c (TERMHOOKS_INLINE):
6959 Define to EXTERN_INLINE, so that the corresponding functions
6960 are compiled into code.
6961 (tset_param_alist): New setter function.
6962
742af32f
PE
69632012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6964
15dbb4d6
PE
6965 * keyboard.h (KSET): Remove (Bug#12215).
6966 Replace all uses with calls to new setter functions.
6967 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6968 (KEYBOARD_INLINE): New macro.
6969 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
6970 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
6971 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
6972 New setter functions.
6973 * keyboard.c (KEYBOARD_INLINE):
6974 Define to EXTERN_INLINE, so that the corresponding functions
6975 are compiled into code.
6976 (kset_echo_string, kset_kbd_queue)
6977 (kset_keyboard_translate_table, kset_last_prefix_arg)
6978 (kset_last_repeatable_command, kset_local_function_key_map)
6979 (kset_overriding_terminal_local_map, kset_real_last_command)
6980 (kset_system_key_syms): New setter functions.
6981
f00af5b1
PE
6982 * frame.h (FSET): Remove (Bug#12215).
6983 Replace all uses with calls to new setter functions.
6984 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6985 (FRAME_INLINE): New macro.
6986 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
6987 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
6988 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
6989 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
6990 (fset_param_alist, fset_root_window, fset_scroll_bars)
6991 (fset_selected_window, fset_title, fset_tool_bar_items)
6992 (fset_tool_bar_position, fset_tool_bar_window): New functions.
6993 * frame.c (FRAME_INLINE):
6994 Define to EXTERN_INLINE, so that the corresponding functions
6995 are compiled into code.
6996 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
6997
0c94c8d6
PE
6998 A few more naming-convention fixes for getters and setters.
6999 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7000 and rename from buffer_overlays_set_before.
7001 (set_buffer_overlays_after): Move here from buffer.h, and rename
7002 from buffer_overlays_set_after.
7003 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7004 All uses changed.
7005 (set_buffer_intervals): Rename from buffer_set_intervals.
7006 * intervals.c (set_interval_object): Move here from intervals.h,
7007 and rename from interval_set_object.
7008 (set_interval_left): Move here from intervals.h, and rename from
7009 interval_set_left.
7010 (set_interval_right): Move here from intervals.h, and rename from
7011 interval_set_right.
7012 (copy_interval_parent): Move here from intervals.h, and rename from
7013 interval_copy_parent.
7014 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7015 (set_interval_plist): Rename from interval_set_plist.
7016 Return void, not Lisp_Object, since no caller uses the result.
7017 * lisp.h (string_intervals): Rename from string_get_intervals.
7018 (set_string_intervals): Rename from string_set_intervals.
7019
34dabdb7
PE
7020 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7021 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 7022 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
7023 All uses changed. See the end of
7024 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7025
742af32f
PE
7026 * lisp.h (CSET): Remove (Bug#12215).
7027 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7028 (set_char_table_purpose): New functions,
7029 replacing CSET. All uses changed. For example, replace
7030 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 7031 "set_char_table_parent (char_table, parent);".
742af32f
PE
7032 The old version was confusing because it used the same name
7033 'parent' for two different things.
7034
a04e2c62
DA
70352012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7036
7037 Functions to get and set Lisp_Object fields of buffer-local variables.
7038 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7039 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7040 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7041 * data.c, eval.c, frame.c: Adjust users.
7042
383dcbf9
CY
70432012-08-17 Chong Yidong <cyd@gnu.org>
7044
7045 * xfaces.c (merge_face_vectors): If the target font specfies a
7046 font spec, make the font's attributes take precedence over
7047 directly-specified attributes.
7048 (merge_face_ref): Recognize :font.
7049
44386687
DA
70502012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7051
7052 Do not use memcpy for copying intervals.
7053 * intervals.c (reproduce_interval): New function.
7054 (reproduce_tree, reproduce_tree_obj): Use it.
7055 (reproduce_tree_obj): Remove prototype.
7056
927c7216
PE
70572012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7058
7059 * lisp.h (duration_to_sec_usec): Remove unused decl.
7060
93044f7b
AA
70612012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7062
7063 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7064 to an allocated instance of NSString, not to the class itself.
7065
9851e4a5
JB
70662012-08-17 Juanma Barranquero <lekktu@gmail.com>
7067
7068 * makefile.w32-in (C_CTYPE_H): New macro.
7069 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7070 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7071 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7072
620f13b0
PE
70732012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7074
7075 Use ASCII tests for character types.
7076 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7077 * xfns.c, xterm.c:
7078 Don't include <ctype.h>; was not needed.
7079 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7080 * sysdep.c, xfaces.c:
7081 Include <c-ctype.h> instead of <ctype.h>.
7082 * nsterm.m: Include <c-ctype.h>.
7083 * charset.c (read_hex):
7084 * doc.c (Fsnarf_documentation):
7085 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7086 (DRIVE_LETTER) [DOS_NT]:
7087 (Ffile_name_directory, Fexpand_file_name)
7088 (Fsubstitute_in_file_name):
7089 * font.c (font_parse_xlfd, font_parse_fcname):
7090 * frame.c (x_set_font_backend):
7091 * gtkutil.c (xg_get_font):
7092 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7093 * nsimage.m (hexchar):
7094 * nsterm.m (ns_xlfd_to_fontname):
7095 * sysdep.c (system_process_attributes):
7096 * xfaces.c (hash_string_case_insensitive):
7097 Use C-locale tests instead of locale-specific tests for character
7098 types, since we want the ASCII interpretation here, not the
7099 interpretation suitable for whatever happens to be the current locale.
7100
52162052
MR
71012012-08-16 Martin Rudalics <rudalics@gmx.at>
7102
7103 Consistently check windows for validity/liveness
7104 (Bug#11984, Bug#12025, Bug#12026).
7105 * lisp.h (CHECK_VALID_WINDOW): New macro.
7106 * window.c (decode_window): Rename to decode_live_window.
7107 (decode_valid_window, Fwindow_valid_p): New functions.
7108 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7109 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7110 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7111 (Fwindow_prev_sibling, Fwindow_combination_limit)
7112 (Fset_window_combination_limit, Fwindow_use_time)
7113 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7114 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7115 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7116 (Fwindow_hscroll, Fset_window_hscroll)
7117 (Fwindow_redisplay_end_trigger)
7118 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7119 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7120 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7121 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7122 (Fwindow_end, Fset_window_point, Fset_window_start)
7123 (Fpos_visible_in_window_p, Fwindow_line_height)
7124 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7125 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7126 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7127 (Fset_window_parameter, Fwindow_display_table)
7128 (Fset_window_display_table, Fdelete_other_windows_internal)
7129 (Fset_window_buffer, Fset_window_new_total)
7130 (Fset_window_new_normal, Fdelete_window_internal)
7131 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7132 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7133 (Fwindow_scroll_bars): Check whether argument window is a valid or
7134 live window. Update doc-strings.
7135 (syms_of_window): New symbol Qwindow_valid_p.
7136 * keyboard.c (Fposn_at_x_y): Check whether argument
7137 frame_or_window denotes a valid window.
7138
2751c80f
DA
71392012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7140
7141 Fix previous char table change.
7142 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7143 * chartab.c (optimize_sub_char_table): Likewise.
7144
032a42c8
CY
71452012-08-16 Chong Yidong <cyd@gnu.org>
7146
a2d19368
CY
7147 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7148
032a42c8
CY
7149 * xfont.c (xfont_open):
7150 * xftfont.c (xftfont_open): Set the font's max_width field.
7151
7152 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7153 min_width to space_width and average_width to the average over
7154 printable ASCII characters.
7155 (ns_char_width): Code cleanup.
7156 (ns_ascii_average_width): New utility function.
7157
7158 * font.h (struct font): Update comments.
7159
a098c930
DA
71602012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7161
032a42c8 7162 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
7163 * lisp.h (CSET): New macro.
7164 (char_table_set_extras, char_table_set_contents)
7165 (sub_char_table_set_contents): New function.
7166 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7167 * syntax.c: Adjust users.
7168
8be3a09c
SM
71692012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7170
7171 * eval.c (eval_sub): Bind lexical-binding.
7172 * lread.c (Qlexical_binding): Make non-static.
7173
ac4845a6
JD
71742012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7175
ddee6515
JD
7176 * nsmenu.m (popupSession): Remove.
7177 (pop_down_menu): Remove endModalSession.
7178 (timeout_handler:): New method.
7179 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7180 Call runModalForWindow. Check timer_fired when it returns.
7181 If not set, cancel timer and break out of loop.
7182 Otherwise loop again, with a new timeout.
7183
7184 * nsterm.m: Include fcntl.h if present.
7185 (fd_entry, t_readfds, inNsSelect): Remove.
7186 (select_writefds, select_valid, select_timeout, selfds)
7187 (select_mutex, apploopnr): Add.
7188 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7189 Otherwise call kbd_buffer_store_event.
7190 (ns_send_appdefined): Remove release of fd_entry.
7191 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7192 Increment and decrement apploopnr.
7193 (ns_select): If no file descriptors, just do a NSTimer.
7194 Otherwise copy read/write masks and start select thread (fd_handler).
7195 Start main loop and wait for application defined event.
7196 Inform select thread to stop selecting after main loop is exited.
7197 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 7198 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
7199 (fd_handler:): Loop forever, wait for info from the main thread
7200 to either start or stop selecting. When select returns, send
7201 and appdefined event.
7202 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7203 If not call kbd_buffer_store_event.
7204
7205 * nsterm.h (EmacsApp): fd_handler takes id argument.
7206 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7207
ac4845a6
JD
7208 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7209
eb424fe3
EZ
72102012-08-15 Eli Zaretskii <eliz@gnu.org>
7211
7212 * region-cache.c (move_cache_gap): Update gap_len using the actual
7213 growth of the boundaries array. Do not change cache_len.
7214 (Bug#12196)
7215
4e6a86c6
DA
72162012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7217
7218 Generalize and cleanup font subsystem checks.
7219 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
7220 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7221 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 7222
5bf192ca
DA
72232012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7224
7225 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7226
f2045622
CY
72272012-08-15 Chong Yidong <cyd@gnu.org>
7228
8be3a09c
SM
7229 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7230 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7231 extract the font descriptor instead of just the font name.
7232 In that case, return a font spec instead of a string.
f2045622
CY
7233 (x_last_font_name): Move to this file from xfns.c.
7234
7235 * xfns.c (Fx_select_font): The return value can also be a font
7236 spec. Move x_last_font_name management to gtkutil.c.
7237
7238 * xfaces.c: Make font weight and style symbols non-static.
7239
7f6feb56
SM
72402012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7241
7242 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7243 (bug#12117).
7244
fecbd8ff
SM
72452012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7246
7247 * alloc.c (Fgarbage_collect): Use plural form consistently.
7248
9b8d5165
EZ
72492012-08-14 Eli Zaretskii <eliz@gnu.org>
7250
7251 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7252 iteration through the command loop. Fixes a problem whereby mouse
7253 movements are ignored until the first mouse click.
7254
f5d9e83a
PE
72552012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7256
7257 Use bool, not int, for Lisp booleans.
7258 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7259 makes Emacs a bit smaller and presumably a bit faster.
7260 * lisp.h: Include <stdbool.h>.
7261 (struct Lisp_Boolfwd, defvar_bool):
7262 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7263 * regex.c [!emacs]: Include <stdbool.h>.
7264 (false, true): Remove; <stdbool.h> does this for us now.
7265
55802e4a
CY
72662012-08-14 Chong Yidong <cyd@gnu.org>
7267
4abcdac8
CY
7268 * character.c (Fcharacterp): Doc fix (Bug#12076).
7269
7270 * data.c (Findirect_variable): Doc fix (Bug#11040).
7271
55802e4a
CY
7272 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7273
7274 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 7275 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 7276
8e99d072
BR
72772012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7278
7279 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7280 (bug#12022).
7281
08908aca
MR
72822012-08-14 Martin Rudalics <rudalics@gmx.at>
7283
7284 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7285 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7286 * minibuf.c (choose_minibuf_frame, read_minibuf):
7287 * w32fns.c (x_create_tip_frame):
7288 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7289 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7290
56120d6f
PE
72912012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7292
7293 * intervals.c (offset_intervals): Remove obsolete comment.
7294
67b77c0b
AS
72952012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7296
7297 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7298
f48b82fd
GR
72992012-08-14 Gergely Risko <gergely@risko.hu>
7300
7301 * coding.c (decode_coding): Record buffer modification before
7302 disabling undo_list (Bug#11773).
7303
fd318b54
DA
73042012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7305
7306 Revert and cleanup some recent overlay changes.
7307 * buffer.h (enum overlay_type): Remove.
7308 (buffer_get_overlays, buffer_set_overlays): Likewise.
7309 (buffer_set_overlays_before, buffer_set_overlays_after):
7310 New function. Adjust users.
7311 (unchain_both): Add eassert.
7312
41a62dd9
DA
73132012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7314
7315 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7316
5884c324
PE
73172012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7318
7319 * gtkutil.c (xg_mark_data): Don't assume C99.
7320
ca06f160
JD
73212012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7322
7323 * gtkutil.c (xg_frame_tb_info): New struct.
7324 (TB_INFO_KEY): New define.
7325 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7326 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7327 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7328 if not present.
7329 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 7330 is up to date. Otherwise store new data.
ca06f160
JD
7331 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7332
7864a3f7
DA
73332012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7334
7335 Use KSET for write access to Lisp_Object members of struct kboard.
7336 * keyboard.h (KSET): New macro.
7337 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7338 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7339 * xterm.c: Adjust users.
7340
4c31be61
DA
73412012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7342
7343 Use BSET for write access to Lisp_Object members of struct buffer.
7344 * buffer.h (BSET): New macro.
7345 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7346 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7347 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7348 * window.c, xdisp.c, xfns.c: Adjust users.
7349
14ae4239
BT
73502012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7351
7352 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7353
32bcadb4
JD
73542012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7355
3d29b2ce 7356 * nsterm.m (not_in_argv): New function.
fc0c31f8 7357 (application:openFile, application:openTempFile:):
3d29b2ce
JD
7358 (application:openFileWithoutUI:, application:openFiles:): Open file
7359 if not_in_argv returns non-zero (bug#12171).
7360
32bcadb4 7361 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
7362 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7363 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
7364 (xg_get_font_name): Use those functions/macros here.
7365 Reported by Frans Oilinki <moilinki@gmail.com>.
7366
9ff9402d 73672012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
7368
7369 * unexmacosx.c (copy_data_segment): Copy initialized data in
7370 statically linked libraries from input file rather than memory.
7371
db74a5fc
YM
7372 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7373 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7374 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7375
25e65510
GM
73762012-08-10 Glenn Morris <rgm@gnu.org>
7377
7378 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7379 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7380
7961135c
DA
73812012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7382
7383 Fix last change to allow compilation with low optimization levels.
7384 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7385 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7386
42b3a444
DA
73872012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7388
7389 Use common inline syntax in intervals.h.
7390 * intervals.h (INTERVALS_INLINE): New macro.
7391 Change all users from LISP_INLINE.
7392
9fb0c957
DA
73932012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7394
7395 Define Qnone once for all platforms.
7396 * frame.c (Qnone): Define here.
7397 (syms_of_frame): DEFSYM it.
7398 * lisp.h (Qnone): New declaration.
7399 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7400 * xfns.c: Remove duplication. Adjust users.
7401
65e8ee52
DA
74022012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7403
7404 Remove unused macros from intervals.h.
7405 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7406 * intervals.c: Adjust comment.
7407
9b855fd6
EZ
74082012-08-10 Eli Zaretskii <eliz@gnu.org>
7409
7410 * w32fns.c <w32_unicode_gui>: New static variable.
7411 (globals_of_w32fns): Initialize it according to os_subtype.
7412 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7413 testing os_subtype.
7414
39cb9e56 74152012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
7416 Eli Zaretskii <eliz@gnu.org>
7417
7418 Fix bug #10299 with Unicode characters sent by customized
7419 keyboards created by MSKLC.
7420 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7421 (w32_init_class): Use it to initialize the Emacs class with either
7422 ANSI or Unicode API calls.
7423 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7424 later.
7425 (w32_wnd_proc): If the character code sent by WM_CHAR or
7426 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7427 original message. Call DefWindowProcW on NT and later.
7428
9374581a
GM
74292012-08-10 Glenn Morris <rgm@gnu.org>
7430
4b94e8cf
GM
7431 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7432
9374581a
GM
7433 * lisp.h (DIRECTORY_SEP): Let configure set it.
7434
a2752828
DA
74352012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7436
7437 Use TSET for write access to Lisp_Object slots of struct terminal.
7438 * termhooks.h (TSET): New macro.
7439 * coding.c, terminal.c, xselect.c: Adjust users.
7440
cc92c454
SM
74412012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7442
7443 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7444 the failing expression, include them in the error message.
7445 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7446 * lisp.h (internal_condition_case_n): Update declaration.
7447
4cb3e6b3
DA
74482012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7449
7450 Inline functions to examine and change buffer overlays.
7451 * buffer.c (unchain_both): New function.
7452 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7453 (buffer_has_overlays): New function.
7454 (enum overlay_type): New enum.
7455 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7456 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7457
8707c1e5
DA
74582012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7459
7460 Inline functions to examine and change buffer intervals.
7461 * alloc.c (mark_interval_tree): Remove.
7462 (MARK_INTERVAL_TREE): Simplify.
7463 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7464 * intervals.c (buffer_balance_intervals): New function.
7465 (graft_intervals_into_buffer): Adjust indentation.
7466 (set_intervals_multibyte): Simplify.
7467 * buffer.h (BUF_INTERVALS): Remove.
7468 (buffer_get_intervals, buffer_set_intervals): New function.
7469 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7470 * intervals.c, textprop.c: Adjust users.
7471
ad8c997f
DA
74722012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7473
7474 Inline functions to examine and change string intervals.
7475 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7476 (string_get_intervals, string_set_intervals): New function.
7477 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7478 * lread.c, print.c, textprop.c: Adjust users.
7479
32ac3a6b
GM
74802012-08-08 Glenn Morris <rgm@gnu.org>
7481
7482 * lisp.mk (lisp): Remove language/persian.elc.
7483
77c7bcb1
DA
74842012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7485
7486 Cleanup intervals.
7487 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7488 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
7489 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7490 Adjust comment. Move under #if 0.
77c7bcb1
DA
7491 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7492 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7493
9c08a8d4
DA
74942012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7495
7496 Check total length of intervals with eassert.
7497 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7498 * intervals.c: Change all users to eassert.
7499
26d16b35
EZ
75002012-08-07 Eli Zaretskii <eliz@gnu.org>
7501
14ae4239
BT
7502 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7503 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
7504 INTERNAL_FIELD in Lisp_Cons.
7505
c644523b
DA
75062012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7507
7508 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7509 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7510 name since all xname users are fixed long time ago. Do not
7511 use INTERNAL_FIELD.
7512 (set_symbol_name, set_symbol_function, set_symbol_plist):
7513 (set_symbol_next, set_overlay_plist): New function.
7514 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7515 (struct Lisp_Overlay): Likewise.
7516 (CVAR, MVAR, SVAR): Remove.
7517 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7518 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7519 * xterm.c: Adjust users.
7520 * .gdbinit: Change to use name field of struct Lisp_Symbol
7521 where appropriate.
7522
6a3d20cc
DA
75232012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7524
7525 Basic functions to set Lisp_Object and pointer slots of intervals.
7526 * intervals.h (interval_set_parent, interval_set_object):
7527 (interval_set_left, interval_set_right, interval_set_plist):
7528 (interval_copy_parent): New function.
7529 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
7530 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7531 Adjust indentation.
6a3d20cc
DA
7532 (INTERVAL_SIZE): Remove. Adjust users.
7533 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7534
4d2b044c
DA
75352012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7536
7537 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7538 * process.h (PGET): Remove.
7539 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7540 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7541
d3d50620
DA
75422012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7543
7544 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7545 * window.h (WGET): Remove.
7546 (struct window): Do not use INTERNAL_FIELD.
7547 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7548 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7549 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7550 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7551 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7552 Adjust users.
7553
d10a51dc
CY
75542012-08-07 Chong Yidong <cyd@gnu.org>
7555
7556 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7557 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7558 (Fdelete_window_internal): Signal an error if the window is not on
7559 a live frame (Bug#12025).
7560
e69b0960
DA
75612012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7562
7563 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7564 * frame.h (FGET): Remove.
7565 (struct frame): Do not use INTERNAL_FIELD.
7566 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7567 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7568 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7569 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7570
25a20a3a
JB
75712012-08-06 Juanma Barranquero <lekktu@gmail.com>
7572
7573 * w32.c: Silence compiler warnings.
7574 (map_w32_filename): Remove unused variable `is_fat'.
7575 (chase_symlinks): Add parentheses around expression.
7576
1c6f11f4
GM
75772012-08-06 Glenn Morris <rgm@gnu.org>
7578
1db4583a
GM
7579 * sysdep.c: Respect BROKEN_GETWD.
7580
1c6f11f4
GM
7581 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7582 Let configure handle it.
7583 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7584
2b90362b
DA
75852012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7586
7587 Use GCALIGNMENT where appropriate.
7588 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7589 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7590 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7591
5f50daf2
EZ
75922012-08-06 Eli Zaretskii <eliz@gnu.org>
7593
14ae4239
BT
7594 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7595 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 7596
cbcc7007
SM
75972012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7598
7599 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7600 that should be sufficient for everyone.
7601
4d365fa4
JD
76022012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7603
7604 * keyboard.c (timer_check_2): Add break so timer_check returns next
7605 timeout.
7606
dd86bd82
DA
76072012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7608
7609 Fix Windows build errors introduced after converting to WGET and WSET.
7610 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7611 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7612
054e1668
JD
76132012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7614
7615 * nsterm.m (ns_frame_rehighlight): Use FSET.
7616
7617 * nsmenu.m (ns_update_menubar): Use FSET.
7618
21238f11
DA
76192012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7620
7621 Separate read and write access to Lisp_Object slots of Lisp_Process.
7622 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7623 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7624
077288cf
DA
76252012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7626
7627 Separate read and write access to Lisp_Object slots of struct window.
7628 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7629 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7630 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7631 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7632 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7633 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7634 Adjust users.
7635
71688bd7
DA
76362012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7637
7638 Fix Windows build errors introduced after converting to FGET and FSET.
7639 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7640 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7641 (w32_judge_scroll_bars): Change to use FSET.
7642 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7643
f99bac93
DA
76442012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7645
7646 Fix replacement typo.
7647 * window.c (replace_window): Set root_window instead of
7648 selected_window. This fixes a total window subsystem
7649 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7650
8c2a0f2d
GM
76512012-08-06 Glenn Morris <rgm@gnu.org>
7652
7653 * lisp.mk (lisp): Add language/persian.elc.
7654
edd74c35
DA
76552012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7656
7657 Separate read and write access to Lisp_Object slots of struct frame.
7658 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7659 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7660 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7661 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7662 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7663
8671676c
AS
76642012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7665
7666 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7667
663e2b3f
DA
76682012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7669
7670 Generalize common compile-time constants.
7671 * lisp.h (header_size, bool_header_size, word_size): Now here.
7672 (struct Lisp_Vector): Add comment.
7673 (struct Lisp_Bool_Vector): Move up to define handy constants.
7674 (VECSIZE, PSEUDOVECSIZE): Simplify.
7675 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7676 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7677 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7678 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7679 * xfont.c, xmenu.c: Use word_size where appropriate.
7680
d32e47af
LM
76812012-08-05 Lawrence Mitchell <wence@gmx.li>
7682
7683 * search.c (Freplace_match): Treat \? in the replacement text
7684 literally (Bug#8161).
7685
e5d9c0d1
CY
76862012-08-05 Chong Yidong <cyd@gnu.org>
7687
7688 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
7689 * frame.c (Vdelete_frame_functions):
7690 * emacs.c (Vkill_emacs_hook): Doc fix.
7691
8da0576b
EZ
76922012-08-04 Eli Zaretskii <eliz@gnu.org>
7693
7694 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
7695 --with-x-toolkit=no builds.
7696 Reported by Carsten Mattner <carstenmattner@gmail.com>.
7697
02676e5d
CY
76982012-08-04 Chong Yidong <cyd@gnu.org>
7699
7700 * syntax.c (Fmodify_syntax_entry): Doc fix.
7701
97147da9
EZ
77022012-08-04 Eli Zaretskii <eliz@gnu.org>
7703
76151e2c
EZ
7704 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
7705 * w32.c (init_environment): Change the default values of many
7706 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
7707 them into environment when they were not already defined.
7708 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 7709 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
7710 (check_windows_init_file): Now external, not static.
7711 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
7712 called when Vload_path is already set up.
7713
7714 * w32.h (check_windows_init_file): Add prototype.
7715
7716 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
7717 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
7718 compatibility with Posix platforms.
7719 (main): Move the call to check_windows_init_file to here from
7720 w32.c.
7721 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
7722 any, in the DEFALT argument into the root of the Emacs build or
7723 installation tree, as appropriate.
7724
7725 * callproc.c (init_callproc_1): Call decode_env_path instead of
7726 doing its equivalent by hand.
7727 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
7728 the code that sets Vexec_path run on MS-Windows.
7729
7730 * lread.c (init_lread): Add comments to #ifdef's.
7731
97147da9
EZ
7732 * msdos.c (dos_set_window_size, IT_update_begin)
7733 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
7734 instead of direct references.
7735
185ee146
PE
77362012-08-04 Paul Eggert <eggert@cs.ucla.edu>
7737
7738 Export DEFAULT_REHASH_* to GDB.
7739 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
7740 Now constants, not macros.
7741
8834c57a
PE
77422012-08-03 Paul Eggert <eggert@cs.ucla.edu>
7743
98c6f1e3
PE
7744 Remove unnecessary casts involving pointers.
7745 These casts are no longer needed now that we assume C89 or later,
7746 since they involve casting to or from void *.
7747 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
7748 (make_pure_float, make_pure_vector):
7749 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
7750 * macros.c (Fstart_kbd_macro):
7751 * menu.c (find_and_return_menu_selection):
7752 * minibuf.c (read_minibuf_noninteractive):
7753 * sysdep.c (closedir):
7754 * xdisp.c (x_produce_glyphs):
7755 * xfaces.c (compare_fonts_by_sort_order):
7756 * xfns.c (x_real_positions, select_visual):
7757 * xselect.c (x_stop_queuing_selection_requests)
7758 (x_get_window_property, x_get_window_property_as_lisp_data):
7759 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
7760 Remove unnecessary pointer casts.
7761 * alloc.c (record_xmalloc): New function.
7762 * lisp.h (record_xmalloc): New decl.
7763 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
7764 more like a function. This is because the pointer cast is not
7765 needed. All uses changed.
7766 * print.c (print_string, print_error_message): Avoid length recalc.
7767
8834c57a
PE
7768 Improve fix for macroexp crash with debugging (Bug#12118).
7769 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
7770 ARRAY_MARK_FLAG when checking subscripts, because ASET is
7771 not supposed to be invoked from the garbage collector.
7772 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7773 (gc_aset): New function, which is like ASET but can be
7774 used in the garbage collector.
7775 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7776 (set_hash_index): Use it instead of ASET.
7777
6dad7178
EZ
77782012-08-03 Eli Zaretskii <eliz@gnu.org>
7779
7780 Support symlinks on latest versions of MS-Windows.
7781 * w32.c: Include winioctl.h and aclapi.h.
7782 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7783 (revert_to_self): Forward declarations of static functions.
7784 <static BOOL g_b_init_get_security_info>:
7785 <g_b_init_create_symbolic_link>: New static flags.
7786 (globals_of_w32): Initialize them to zero.
7787 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7788 (map_w32_filename): Improve commentary. Simplify switch.
7789 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7790 headers (most versions of MinGW w32api don't).
7791 (get_security_info, create_symbolic_link)
7792 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7793 New functions.
7794 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7795 in the argument file name.
7796 (sys_access): Call unc_volume_file_attributes only if
7797 GetFileAttributes fails with network-related error codes.
7798 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7799 have the required privileges.
14ae4239 7800 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
7801 get_file_security_desc.
7802 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
7803 with addition of handling of symlinks and support for 'lstat'.
7804 If possible, get file's attributes and security information by
6dad7178
EZ
7805 handle, not by name. Produce S_IFLNK bit for symlinks, when
7806 called from 'lstat'.
7807 (stat, lstat): New functions, call 'stat_worker'.
7808 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7809 symlinks when the underlying filesystem supports them.
7810
f162bcc3
PE
78112012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7812
79ea6c20
PE
7813 Fix macroexp crash on Windows with debugging (Bug#12118).
7814 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7815 checking subscripts; problem introduced with the recent
7816 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7817 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7818 since it's used in non-static inline functions now.
7819
c0ce93fd
PE
7820 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7821 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 7822
f162bcc3
PE
7823 Use C99-style 'extern inline' if available.
7824 * buffer.h (BUFFER_INLINE):
7825 * category.h (CATEGORY_INLINE):
7826 * character.h (CHARACTER_INLINE):
7827 * charset.h (CHARSET_INLINE):
7828 * composite.h (COMPOSITE_INLINE):
7829 * dispextern.h (DISPEXTERN_INLINE):
7830 * lisp.h (LISP_INLINE):
7831 * systime.h (SYSTIME_INLINE):
7832 New macro, replacing 'static inline' in this header.
7833 * buffer.h, category.h, character.h, charset.h, composite.h:
7834 * dispextern.h, lisp.h, systime.h:
7835 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7836 * alloc.c (LISP_INLINE):
7837 * buffer.c (BUFFER_INLINE):
7838 * category.c (CATEGORY_INLINE):
7839 * character.c (CHARACTER_INLINE):
7840 * charset.c (CHARSET_INLINE):
7841 * composite.c (COMPOSITE_INLINE):
7842 * dispnew.c (DISPEXTERN_INLINE):
7843 * sysdep.c (SYSTIME_INLINE):
7844 Define to EXTERN_INLINE, so that the corresponding functions
7845 are compiled into code.
7846 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
7847 (INLINE_HEADER_END): New macros.
7848 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
7849 since it's used in non-static inline functions now.
a8333d03 7850 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 7851
837b365b
GM
78522012-08-02 Glenn Morris <rgm@gnu.org>
7853
d66b744d
GM
7854 * s/: Remove empty directory.
7855
837b365b
GM
7856 * s/ms-w32.h: Move to ../nt/inc.
7857 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
7858 Update for new ms-w32.h location.
7859
13294f95
PE
78602012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7861
7862 Port to Solaris 8.
7863 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
7864
90df0db3
GM
78652012-08-02 Glenn Morris <rgm@gnu.org>
7866
7867 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
7868 hard-coding the path separator.
7869
4939150c
PE
78702012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7871
7872 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
7873 This how ASET and AREF are supposed to work, and makes
7874 it easier to think about future improvements. See
7875 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
7876 * charset.h (set_charset_attr): New function.
7877 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
7878 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
7879 (aref_addr): New function. All uses of &AREF(...) changed.
7880 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7881 (set_hash_index): New functions. All lvalue-style uses of
7882 HASH_KEY etc. changed.
7883 * keyboard.c (set_prop): New function. All lvalue-style uses
7884 of PROP changed.
7885
947b2afd
AA
78862012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
7887
7888 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
7889 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 7890 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
7891 * nsfns.m (ns_set_name_as_filename): Likewise.
7892 * nsmenu.m (ns_update_menubar): Likewise.
7893 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
7894
4f5d0325
EZ
78952012-08-01 Eli Zaretskii <eliz@gnu.org>
7896
2008beae
EZ
7897 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
7898 Adapt to latest changes in field names of the corresponding Lisp
288479f6 7899 objects.
2008beae 7900
4f5d0325
EZ
7901 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
7902
fe3cc771
GM
79032012-08-01 Glenn Morris <rgm@gnu.org>
7904
7905 * s/msdos.h: Remove file.
7906 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
7907 * Makefile.in (S_FILE): Remove.
7908 (config_h): Remove S_FILE.
7909
c90acc54
JB
79102012-08-01 Juanma Barranquero <lekktu@gmail.com>
7911
7912 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
7913 Remove; moved to nt/config.nt.
7914
d8a05828
DA
79152012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7916
7917 Use INTERNAL_FIELD for conses and overlays.
7918 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
7919 Remove obsolete comment.
7920 (MVAR): New macro.
7921 (struct Lisp_Overlay): Use INTERNAL_FIELD.
7922 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
7923
8271d590
DA
79242012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7925
7926 Use INTERNAL_FIELD for symbols.
7927 * lisp.h (SVAR): New macro. Adjust users.
7928 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
7929 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
7930
3193acd2
DA
79312012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7932
7933 Use INTERNAL_FIELD for processes.
7934 * process.h (PVAR): New macro. Adjust style.
7935 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
7936 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
7937
3a45383a
DA
79382012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7939
7940 Use INTERNAL_FIELD for windows.
7941 * window.h (WVAR): New macro.
7942 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
7943 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7944 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7945 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
7946 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
7947 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7948
c1dbc63c
PE
79492012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7950
7951 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
7952
5c0c0e8a
GM
79532012-08-01 Glenn Morris <rgm@gnu.org>
7954
7955 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
7956 Move to configure.ac.
7957
552a99b4
JB
79582012-08-01 Juanma Barranquero <lekktu@gmail.com>
7959
7960 * makefile.w32-in (CONFIG_H): Update dependencies.
7961 (CONF_POST_H): New macro.
7962
7963 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
7964
8d8e2dfe
GM
79652012-07-31 Glenn Morris <rgm@gnu.org>
7966
bc96620a
GM
7967 * Makefile.in (S_FILE): No longer set by configure.
7968
476b1b2d
GM
7969 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
7970 is available.
7971 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
7972
b2c7a106
GM
7973 * process.h (NULL_DEVICE):
7974 * emacs.c (SEPCHAR):
7975 * editfns.c (USER_FULL_NAME): Let configure set them.
7976
d53d062a
GM
7977 * s/README, s/template.h: Remove files.
7978
4515017f
GM
7979 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
7980
8d8e2dfe
GM
7981 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
7982 Move to configure.ac.
7983
5b20b3cc
EZ
79842012-07-31 Eli Zaretskii <eliz@gnu.org>
7985
1e0afd9a
EZ
7986 * .gdbinit (xframe): Adapt to introduction of FVAR and the
7987 resulting renaming of 'struct frame' members.
7988
5b20b3cc
EZ
7989 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
7990
7991 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
7992 after introduction of FVAR.
7993
f1310128
JD
79942012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7995
79e721e0
JD
7996 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
7997
7998 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
7999 instead of compositeToPoint.
8000 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8001
8d7c7eed 8002 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 8003
e34f7f79
DA
80042012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8005
8006 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8007 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 8008 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
8009 (BVAR): Change to use INTERNAL_FIELD.
8010 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8011 (KVAR): Change to use INTERNAL_FIELD.
8012 * frame.h (FVAR): New macro.
8013 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
8014 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8015 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8016 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
8017 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8018
c09bfb2f
DA
80192012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8020
8021 Miscellaneous fixes for non-default X toolkits.
8022 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8023 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8024 Move under #ifdef USE_LUCID.
8025 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8026 definition and usage to avoid warnings.
8027
14c114ae
JD
80282012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8029
8030 * nsterm.m (openFiles): Fix previous checkin.
8031
3bd21e82
PE
80322012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8033
8034 * indent.c (compute_motion): Remove unused local.
8035
c1529ded
GM
80362012-07-31 Glenn Morris <rgm@gnu.org>
8037
400d5621
GM
8038 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8039
268e2432
GM
8040 * conf_post.h [USG5_4]:
8041 Move remaining contents of s/usg5-4-common.h here.
8042 * s/usg5-4-common.h: Remove file.
8043
7552f3ee
GM
8044 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8045 * s/irix6-5.h: Remove file.
8046
6a381852
GM
8047 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8048 * s/darwin.h: Remove file.
8049
c1529ded
GM
8050 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8051 * s/hpux10-20.h: Remove file, which is now empty.
8052
b429a4ee
GM
80532012-07-30 Glenn Morris <rgm@gnu.org>
8054
8055 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8056 * Makefile.in (config_h): Add conf_post.h.
8057 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8058
adff3182
JD
80592012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8060
8061 * nsterm.m (ns_do_open_file): New variable.
b9031d69 8062 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
8063 (openFile, openTempFile, openFileWithoutUI, openFiles):
8064 Open files only if ns_do_open_file.
adff3182 8065
c32af1e4
PE
80662012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8067
7393bcbb
PE
8068 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8069 This no-op macro hasn't been needed for many years.
8070 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8071
c32af1e4
PE
8072 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8073 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8074 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8075 gdb_make_enums_visible.
8076 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8077 (DIRECTORY_SEP): Now a constant, not a macro.
8078
302fc036
EZ
80792012-07-30 Eli Zaretskii <eliz@gnu.org>
8080
8081 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8082 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8083
8084 * w32term.c <w32_keyboard_codepage>: Renamed from
8085 keyboard_codepage and now external. All users changed.
8086
8087 * w32term.h: Add declaration of w32_keyboard_codepage.
8088
8089 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8090 the codepage to translate keys to Unicode. If this argument is
8091 -1, use the value returned by GetConsoleCP. All callers changed.
8092
88fb40b4
PE
80932012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8094
0aee6912
PE
8095 Update .PHONY listings in makefiles.
8096 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8097 bootstrap-clean, distclean, maintainer-clean, versioclean,
8098 extraclean, frc.
8099
88fb40b4
PE
8100 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8101 This is a bit clearer. Fix some commentary typos.
8102
0a763bd1
GM
81032012-07-30 Glenn Morris <rgm@gnu.org>
8104
32bac6d6
GM
8105 * s/netbsd.h: Let configure include signal.h if needed.
8106 Remove file, which is now empty.
8107
b65e7c46
GM
8108 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8109 Let configure set them.
8110 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8111 No more need to undefine.
0a763bd1 8112
169304bd
AS
81132012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8114
8115 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8116 non-single-byte char when adding meta modifier. (Bug#12090)
8117
6cd7a139
DA
81182012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8119
8120 Convert safe_call to use variable number of arguments.
8121 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8122 (safe_call2): Fix comment.
8123 * lisp.h (safe_call): Adjust prototype.
8124 * coding.c (encode_coding_object): Change to use safe_call2.
8125 * xfaces.c (merge_face_heights): Change to use safe_call1.
8126
d34d6ffc
GM
81272012-07-30 Glenn Morris <rgm@gnu.org>
8128
7b8a48e4 8129 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 8130 does that unconditionally. Remove file, which is now empty.
7b8a48e4 8131
d34d6ffc
GM
8132 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8133 Remove empty files.
8134
03a660a6
PE
81352012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8136
8137 Export to GDB most of lisp.h's remaining object-like macros.
8138 * lisp.h (min, max): Move earlier, because they're used earlier now.
8139 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8140 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8141 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8142 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8143 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8144 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8145 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8146 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8147 Now constants, for GDB. They need not be macros.
8148 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8149 Now constants, for GDB, as well as macros, for static initializers.
8150 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8151 Move to after the definition of struct Lisp_Char_Table,
8152 since the former now needs that type defined.
8153 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8154 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8155 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8156 New enums, for gdb_make_enums_visible.
8157 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 8158 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
8159 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8160 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8161 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8162 enum maxargs, enum MAX_ALLOCA.
8163 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8164 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8165 no longer needed, now that they are done in lisp.h.
8166
e499d0ee
DA
81672012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8168
8169 Cleanup string bytes checking.
8170 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8171 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8172 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8173 (check_sblock, compact_small_strings): Simplify.
8174
d5040d2d
PE
81752012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8176
8177 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8178 These macros are confusing and no longer need to be defined, as
8179 the enum values now suffice. All uses replaced with definiens.
8180 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8181
7f259ae6
JB
81822012-07-29 Juanma Barranquero <lekktu@gmail.com>
8183
8184 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8185 ($(BLD)/w32console.$(O)): Update dependencies.
8186
7e63e0c3
DA
81872012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8188
8189 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8190 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8191 time. Adjust users.
8192 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8193
ffd817eb
JD
81942012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8195
8196 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8197 setting sitelisp (Bug#12010).
8198
417a7a0e
EZ
81992012-07-29 Eli Zaretskii <eliz@gnu.org>
8200
14ae4239 8201 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
8202
8203 * w32heap.c (cache_system_info):
8204 * w32.c (sys_rename):
8205 * w32proc.c (find_child_console, sys_kill): All users changed.
8206
387d4d92
PE
82072012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8208
8209 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8210
55a6cca6
EZ
82112012-07-29 Eli Zaretskii <eliz@gnu.org>
8212
8213 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8214
dbcf001c
DA
82152012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8216
8217 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
8218 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8219 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 8220
e2688e4a
DA
82212012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8222
8223 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8224 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8225 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8226 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8227 (replace_range, replace_range_2, del_range_2): Change to eassert.
8228 * marker.c (byte_char_debug_check): Adjust style.
8229
b46a6a83
PE
82302012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8231
8232 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8233 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8234 long-ago-commented-out code that talks about "WIN32".
8235 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8236 All uses changed.
8237
e32a5799
PE
82382012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8239
8240 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8241 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8242 Simplify by using alignof.
8243 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8244 * lisp.h: Include <stdalign.h>.
8245 (GCALIGNMENT): New macro and constant.
8246 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8247 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8248 (stdalign): New macro, if not already defined.
8249
df81cd29
EZ
82502012-07-28 Eli Zaretskii <eliz@gnu.org>
8251
01bd1b0d
EZ
8252 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8253 * w32inevt.c: Include w32inevt.h.
8254 (w32_read_console_input): New inline function, calls either
8255 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8256 w32_console_unicode_input.
8257 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8258 (w32_kbd_patch_key, key_event): Use the codepage returned by
8259 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8260 (key_event): use uChar.UnicodeChar only if
8261 w32_console_unicode_input is non-zero.
8262
8263 * w32console.c: Include w32heap.h.
8264 <w32_console_unicode_input>: New global variable.
8265 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8266 family of Windows, zero otherwise.
8267
8268 * w32inevt.h: Declare w32_console_unicode_input.
8269
df81cd29
EZ
8270 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8271 --without-x. (Bug#11742)
8272
c20fdd9e
PE
82732012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8274
8275 Adjust GDB to reflect pvec_type changes (Bug#12036).
8276 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
8277 2012-07-04 changes to pseudovector representation.
8278 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 8279
32770973 82802012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
8281
8282 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8283 bus address.
8284 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8285
3438fe21
EZ
82862012-07-27 Eli Zaretskii <eliz@gnu.org>
8287
bcfbc9de
EZ
8288 * alloc.c (listn): Fix the order the arguments are consed onto the
8289 list.
8290
3438fe21
EZ
8291 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8292 enumeration constants, as PURE and HEAP are too general, and clash
8293 with other headers and sources, such as gmalloc.c and the
8294 MS-Windows system headers. All users changed.
8295
eeaea515
DA
82962012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8297
8298 Revert last save_excursion_save and save_excursion_restore changes.
8299 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8300 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8301
073c88c2
DA
83022012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8303
8304 Fix recently-introduced typos in Windows port.
8305 Reported by Martin Rudalics <rudalics@gmx.at>.
8306 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 8307 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 8308
4706125e
PE
83092012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8310
8311 Improve GDB symbol export (Bug#12036).
8312 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8313 arms of an 'if', not using conditional expressions; otherwise GDB
8314 complains about the types in the unevaluated arm when the argument
8315 is an integer literal.
8316 (xgetint): Simplify expression.
8317 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8318 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8319 Zaretskii in <http://bugs.gnu.org/12036#13>.
8320 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8321 needed now that we have gdb_make_enums_visible.
8322 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8323 (enum enum_USE_LSB_TAG):
8324 New enum types, packaging up enums that need to be exported to GDB.
8325
694b6c97
DA
83262012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8327
8328 Utility function to make a list from specified amount of objects.
8329 * lisp.h (enum constype): New datatype.
8330 (listn): New prototype.
8331 * alloc.c (listn): New function.
8332 (Fmemory_use_count, syms_of_alloc): Use it.
8333 * buffer.c (syms_of_buffer): Likewise.
8334 * callint.c (syms_of_callint): Likewise.
8335 * charset.c (define_charset_internal): Likewise.
8336 * coding.c (syms_of_coding): Likewise.
8337 * keymap.c (syms_of_keymap): Likewise.
8338 * search.c (syms_of_search): Likewise.
8339 * syntax.c (syms_of_syntax): Likewise.
8340 * w32.c (init_environment): Likewise.
8341 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8342 * xdisp.c (syms_of_xdisp): Likewise.
8343 * xfns.c (syms_of_xfns): Likewise.
8344
6195f384
DA
83452012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8346
8347 Fast save_excursion_save and save_excursion_restore.
8348 * lisp.h (struct Lisp_Excursion): New data type.
8349 (PVEC_EXCURSION): New pseudovector type.
8350 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8351 to deal with it. Adjust comments.
8352 (init_marker, attach_marker): New prototype.
8353 (unchain_marker): Adjust prototype.
8354 * marker.c (attach_marker): Change to global.
8355 (init_marker): New function.
8356 * alloc.c (Fmake_marker, build_marker): Use it.
8357 (build_marker): More easserts.
8358 (mark_object): Handle struct Lisp_Excursion.
8359 * editfns.c (save_excursion_save, save_excursion_restore):
8360 Reimplement to use struct Lisp_Excursion. Add comments.
8361
5eceb8fb
PE
83622012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8363
8364 Fix export of symbols to GDB (Bug#12036).
8365 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8366 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8367 emacs.c, as this is a more-suitable home. Had this been done earlier
8368 the fix for 12036 would have avoided some of the problems noted in
8369 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8370 would have been more obvious.
562157c8
PE
8371 * emacs.c: Do not include <verify.h>; no longer needed.
8372 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
8373 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8374 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8375 Remove; now done in lisp.h.
8376 * lisp.h (PUBLISH_TO_GDB): New macro.
8377 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8378 (DATA_SEG_BITS): Use it.
8379 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8380 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8381 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8382 not be usable in #if. This simplifies things.
8383
d6749401
JB
83842012-07-26 Juanma Barranquero <lekktu@gmail.com>
8385
8386 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8387
1781b9e9
PE
83882012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8389
d89518db 8390 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
8391 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8392 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8393 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8394 Adjust to changes in lisp.h and emacs.c, by using
8395 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8396 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8397 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8398 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8399 instead of gdb_valbits.
8400 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8401 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8402 instead of gdb_array_mark_flag.
8403 (xboolvector): Get size from $->size, not $->header.size.
8404 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8405 (xreload, hook-run, hookpost-run): Remove.
8406 * emacs.c: Include <verify.h>.
8407 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8408 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8409 Remove.
8410 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8411 (gdb_USE_LSB_TAG): New enum constants.
8412 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8413 Also define these as enum constants, so they're visible to GDB.
8414 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8415 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8416 as constants, so they're visible to GDB.
8417 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8418 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8419 Now enum constants, not macros, so they're visible to GDB.
8420 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8421 more convenient now. All uses changed.
8422 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8423 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8424
3628596a
DA
84252012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8426
8427 Explicitly free restriction data that are not needed anymore.
8428 * editfns.c (save_restriction_restore): Free restriction data.
8429
7abaf5cc
SM
84302012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8431
8432 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8433 add argument, tune behavior, and adjust all callers.
8434
71f88e00
PE
84352012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8436
8437 Use typedef for EMACS_INT, EMACS_UINT.
8438 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8439 than macros. This simplifies debugging in the usual case, since
8440 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8441 and it allows expressions involving EMACS_INT casts.
8442 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8443
57ec3034
JD
84442012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8445
8446 * nsterm.m (ns_read_socket): Return early if there is a modal
8447 window (Bug#12043).
8448
8137e7b3
MR
84492012-07-25 Martin Rudalics <rudalics@gmx.at>
8450
8451 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8452 that FOCUS-FRAME can be omitted.
8453
04e9897c
DA
84542012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8455
8456 Adjust buffer text indirection counters at the end of Fkill_buffer.
8457 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8458 buffer is definitely dead. This should really fix an issue reported
8459 by Christoph Scholtes again. (Bug#12007).
8460 (init_buffer_once): Initialize indirection counters of
8461 buffer_defaults and buffer_local_symbols (for sanity and safety).
8462
8a0484e1
EZ
84632012-07-24 Eli Zaretskii <eliz@gnu.org>
8464
8465 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8466 and continuation glyphs on tooltip frames, leave them at zero.
8467 Avoids continued lines in tooltips. (Bug#11832)
8468
fa691a83
DA
84692012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8470
8471 Simplify copy_overlay.
04e9897c 8472 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
8473 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8474
436bc8e0
EZ
84752012-07-23 Eli Zaretskii <eliz@gnu.org>
8476
8477 * print.c (print_object): Don't crash when a frame's name is nil
8478 or invalid. (Bug#12025)
8479
8480 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8481 it signals an error when a tooltip frame is being created.
8482
d7a7fda3
DA
84832012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8484
8485 Cleanup miscellaneous objects allocation and initialization.
8486 * alloc.c (allocate_misc): Change to static. Add argument to
8487 specify the subtype. Adjust comment and users.
8488 (build_overlay): New function.
8489 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8490 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8491 (allocate_misc): Remove prototype.
8492 (build_overlay): Add prototype.
8493
84942012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
8495
8496 Swap buffer text indirection counters in Fbuffer_swap_text.
8497 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8498 This avoids crash reported by Christoph Scholtes at
8499 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8500
9d7fa573
JD
85012012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8502
8503 * nsmenu.m (Popdown_data): New struct.
8504 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8505 free Popdown_data.
8506 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8507 (initWithContentRect): Make imgView and contentView non-static
8508 and autorelease them. Also autorelease img and matrix (Bug#12005).
8509 (dealloc): Remove (Bug#12005).
8510
0dd6d66d
DA
85112012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8512
8513 Adjust consing_since_gc when objects are explicitly freed.
8514 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8515 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8516 (free_cons, free_misc): Subtract object size from consing_since_gc.
8517
d36d71df
DA
85182012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8519
8520 Simplify and cleanup markers positioning code.
8521 * marker.c (attach_marker): More useful eassert.
8522 (live_buffer, set_marker_internal): New function.
8523 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8524 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8525
fb9ea40f
PE
85262012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8527
8528 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8529 as it's limited by the amount of memory, not by INT_MAX.
8530
2d5c5f7d
EZ
85312012-07-21 Eli Zaretskii <eliz@gnu.org>
8532
07fb592e
EZ
8533 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8534 in special-event-map. See the discussion at
8535 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8536 for the reasons.
8537
37a9eac8 8538 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
8539 info.dwItemData. Fixes crashes on 64-bit Windows.
8540 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 8541
c4328746
JD
85422012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8543
fc0c31f8 8544 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 8545 (conversationIdentifier): Return value is NSInteger.
784051c4 8546 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 8547
6e5d1c12
CY
85482012-07-21 Chong Yidong <cyd@gnu.org>
8549
8550 * window.c (decode_any_window): Signal an error if the window is
8551 on a dead frame (Bug#11984).
8552
9928463d
DA
85532012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8554
8555 Add indirection counting to speed up Fkill_buffer.
8556 * buffer.h (struct buffer): New member.
8557 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8558 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8559 base buffer indirection counter.
8560 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8561 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8562 through buffer list if indirection counter is 0.
8563
f8643a6b
DA
85642012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8565
8566 Extend the value returned by Fgarbage_collect with heap statistics.
8567 * alloc.c (Qheap): New symbol.
8568 (syms_of_alloc): DEFSYM it.
8569 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8570 (Fmemory_free): Remove.
8571 (syms_of_alloc): Don't defsubr it.
8572 * buffer.c (Fcompact_buffer): Remove.
8573 (syms_of_buffer): Don't defsubr it.
8574
dac616ff
DA
85752012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8576
8577 Make maybe_gc inline.
8578 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8579 * lisp.h (consing_since_gc, gc_relative_threshold)
8580 (memory_full_cons_threshold): Revert declaration.
8581 (maybe_gc): Remove prototype, define as inline.
8582 * alloc.c: Remove old commented-out code.
8583 (consing_since_gc, gc_relative_threshold)
8584 (memory_full_cons_threshold): Revert to global.
8585 (maybe_gc): Remove.
8586
d7ea76b4
DA
85872012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8588
8589 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8590 * lisp.h (build_unibyte_string): New function.
8591 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8592 * sysdep.c, w32fns.c, xfns.c: Use it.
8593 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8594 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8595 Adjust users accordingly.
8596 * font.h (font_open_by_name): Adjust prototype.
8597
765e61e3
DA
85982012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8599
8600 Cleanup calls to Fgarbage_collect.
8601 * lisp.h (maybe_gc): New prototype.
8602 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8603 Remove declarations.
8604 * alloc.c (maybe_gc): New function.
8605 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8606 Make them static.
8607 * bytecode.c (MAYBE_GC): Use maybe_gc.
8608 * eval.c (eval_sub, Ffuncall): Likewise.
8609 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8610 to avoid dependency from auto-save feature.
8611
52b852c7
PE
86122012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8613
8614 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8615 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8616 'for_each_per_buffer_object_at'.
8617 All uses changed. It's better to use upper-case for macros that
8618 cannot be implemented as functions, to give the reader a clue
8619 that they're special.
8620
5db81e33
SM
86212012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8622
8623 * alloc.c (Fgarbage_collect): Tweak docstring.
8624
5b835e1d
DA
86252012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8626
8627 Tweak the value returned from Fgarbage_collect again.
8628 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8629 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8630 Adjust documentation.
8631 (total_vector_bytes): Rename to total_vector_slots, adjust
8632 accounting.
8633 (total_free_vector_bytes): Rename to total_free_vector_slots,
8634 adjust accounting.
8635 (Qstring_bytes, Qvector_slots): New symbols.
8636 (syms_of_alloc): DEFSYM them.
8637
9cd47b72
DA
86382012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8639
8640 Buffer compaction primitive which may be used from Lisp.
8641 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8642 (syms_of_buffer): Register Fcompact_buffer.
8643 * alloc.c (Fgarbage_collect): Use compact_buffer.
8644 * buffer.h (compact_buffer): New prototype.
8645 (struct buffer_text): New member.
8646
d17337e5
DA
86472012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8648
8649 New macro to iterate over all buffers, miscellaneous cleanups.
8650 * lisp.h (all_buffers): Remove declaration.
8651 * buffer.h (all_buffers): Add declaration, with comment.
8652 (for_each_buffer): New macro.
8653 * alloc.c (Fgarbage_collect, mark_object): Use it.
8654 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8655 (init_buffer): Likewise.
8656 * data.c (Fset_default): Likewise.
8657 * coding.c (code_conversion_restore): Remove redundant check
8658 for dead buffer.
8659 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8660
60cfd278
AS
86612012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8662
8663 Fix bug that created negative-length intervals.
8664 * intervals.c (merge_interval_right, merge_interval_left):
8665 Do not zero out this interval if it is absorbed by its children,
8666 as this interval's total length doesn't change in that case. See
8667 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8668
d06714cb
PE
86692012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8670
83713154
PE
8671 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8672 when invoking (make-bool-vector N t) and N is a positive
8673 multiple of 8 -- the last 8 bits were mistakenly cleared.
8674
d06714cb
PE
8675 Remove some struct layout assumptions in bool vectors.
8676 * alloc.c (bool_header_size): New constant.
8677 (header_size, word_size): Move earlier, as they're now used earlier.
8678 Use 'word_size' in a few more places, where it's appropriate.
8679 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8680 padding before the data member of a bool vector.
8681 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8682 than doing the check by hand with an abort ().
8683
464d5a5e
SM
86842012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8685
5fbc0409
SM
8686 * eval.c (Fdefvar): Don't check constants since we only set the var if
8687 it's not yet defined anyway (bug#11904).
8688
464d5a5e
SM
8689 * lisp.h (last_undo_boundary): Declare new var.
8690 * keyboard.c (command_loop_1): Set it.
8691 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
8692 were auto-added by the command loop (bug#11774).
8693
8dc2e44a
AS
86942012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8695
8696 * w32font.c (Qsymbol): Remove local definition.
8697 (syms_of_w32font): Don't DEFSYM it.
8698
169925ec
DA
86992012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8700
8701 Fix sweep_vectors to handle large bool vectors correctly.
8702 * alloc.c (sweep_vectors): Account total_vector_bytes for
8703 bool vectors larger than VBLOCK_BYTES_MAX.
8704
5fbfb018
CY
87052012-07-18 Chong Yidong <cyd@gnu.org>
8706
8707 * frame.c (x_set_frame_parameters): Revert bogus change introduced
8708 in 2012-05-25 commit by Paul Eggert (Bug#11738).
8709
3ab6e069
DA
87102012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8711
8712 Return more descriptive data from Fgarbage_collect.
8713 Suggested by Stefan Monnier in
8714 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
8715 * alloc.c (bounded_number): New function.
8716 (total_buffers, total_vectors): New variable.
8717 (total_string_size): Rename to total_string_bytes, adjust users.
8718 (total_vector_size): Rename to total_vector_bytes, adjust users.
8719 (sweep_vectors): Account total_vectors and total_vector_bytes.
8720 (Fgarbage_collect): New return value. Adjust documentation.
8721 (gc_sweep): Account total_buffers.
8722 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
8723 (VECTOR_SIZE): Remove.
8724 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
8725 (Qinterval, Qmisc): New symbols.
8726 (syms_of_data): Initialize them.
8727 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
8728 (Qcons, Qbuffer): New declarations.
8729
6d02fe5b
PE
87302012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8731
8732 * alloc.c (Fmemory_free): Account for memory-free's own storage.
8733 Round up, not down. Improve doc.
8734
b7ffe040
DA
87352012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8736
8737 Restore old code in allocate_string_data to avoid Faset breakage.
8738 Reported by Julien Danjou <julien@danjou.info> in
8739 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
8740 * alloc.c (allocate_string_data): Restore old code with minor
8741 adjustments, fix comment to explain this subtle issue.
8742
4dc7c8d5
SM
87432012-07-17 Eli Zaretskii <eliz@gnu.org>
8744
8745 Remove FILE_SYSTEM_CASE.
8746 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
8747
8748 * fileio.c (FILE_SYSTEM_CASE): Don't define.
8749 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
8750 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
8751 call-process-region passes it through expand-file-name.
8752
8753 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
8754
87552012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8756
8757 Fix crash when creating indirect buffer (Bug#11917)
8758 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
8759 Don't handle unbound variables specially if non-zero.
8760 (Fbuffer_local_variables): Pass zero.
8761 (clone_per_buffer_values): Pass non-zero.
8762
87632012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8764
8765 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
8766 to make the loop interruptible.
8767
87682012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8769
8770 * gnutls.c (emacs_gnutls_handshake): Only retry if
8771 GNUTLS_E_INTERRUPTED.
8772
cce7fefc
DA
87732012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8774
8775 Cleanup and convert miscellaneous checks to eassert.
8776 * alloc.c (mark_interval): Fix comment, partially rephrase
8777 old comment from intervals.h (see below).
8778 * intervals.c (find_interval, adjust_intervals_for_insertion)
8779 (delete_interval, adjust_intervals_for_deletion)
8780 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8781 Convert to eassert.
8782 (adjust_intervals_for_insertion, make_new_interval):
8783 Remove obsolete and unused code.
8784 * intervals.h (struct interval): Remove obsolete comment.
8785 * textprotp.c (erase_properties): Remove unused code.
8786 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8787 (Fremove_list_of_text_properties): Convert to eassert.
8788
9ea10cc3
CY
87892012-07-17 Chong Yidong <cyd@gnu.org>
8790
8791 * editfns.c (Finsert_char): Doc fix.
8792
3900d5de
DA
87932012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8794
8795 Fix previous change to make Fmemory_free always accurate.
8796 * alloc.c (make_interval): Update total_free_intervals.
8797 (make_float): Likewise for total_free_floats.
8798 (free_cons, Fcons): Likewise for total_free_conses.
8799 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8800 Likewise for total_free_vector_bytes.
8801 (Fmake_symbol): Likewise for total_free_symbols.
8802 (bytes_free): Remove.
8803
7098646f
DA
88042012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8805
8806 Simple free memory accounting feature.
8807 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8808 (sweep_vectors): Accumulate size of free vectors.
8809 (Fgarbage_collect): Setup bytes_free.
8810 (Fmemory_free): New function.
8811 (syms_of_alloc): Register it.
8812
22657b40
DA
88132012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8814
8815 Cleanup overlays checking.
8816 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8817 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8818 eassert and OVERLAYP.
8819 (sort_overlays): Change to use OVERLAYP.
8820
ddfc8813
RK
88212012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8822
8823 * editfns.c (Finsert_char): Make it interactive, and make the
8824 second arg optional. Copy interactive spec and docstring from
8825 ucs-insert.
8826
7c26cf3c
PE
88272012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8828
8829 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
8830 Unlike the other wrapped functions, fabs has an unspecified
8831 effect on errno.
8832
5d127af9
JD
88332012-07-16 Jan Djärv <jan.h.d@swipnet.se>
8834
8835 * nsterm.m (keyDown): Interpret flags without left/right bits
8836 as the left key (Bug#11670).
8837
6a0dd1d7
DA
88382012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8839
8840 Remove empty and useless init functions.
8841 * lisp.h (init_character_once, init_fns, init_image)
8842 (init_filelock, init_sound): Remove prototype.
8843 * character.c (init_character_once): Remove.
8844 * filelock.c (init_filelock): Likewise.
8845 * fns.c (init_fns): Likewise.
8846 * image.c (init_image): Likewise.
8847 * sound.c (init_sound): Likewise.
8848 * emacs.c (main): Adjust accordingly.
8849
7a6136fd
DA
88502012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8851
8852 * gtkutil.h: Tiny cleanups.
8853 (use_old_gtk_file_dialog): Remove useless declaration.
8854 (xg_uses_old_file_dialog): Add suggested const attribute.
8855
ce811ad9
EZ
88562012-07-15 Eli Zaretskii <eliz@gnu.org>
8857
8858 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
8859 (bidi_paragraph_init): Use it to limit search forward for a strong
8860 directional character in abnormally large paragraphs full of
8861 neutral or weak characters. (Bug#11943)
8862
c9adfeaa
SF
88632012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
8864
8865 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
8866 the toolbar (Bug#9451).
8867 (xg_make_tool_item): Give the widget event box a transparent
8868 background.
8869
fff62aa9
DA
88702012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8871
8872 Cleanup basic allocation variables and functions.
8873 * alloc.c (ignore_warnings, init_intervals, init_float)
8874 (init_cons, init_symbol, init_marker): Remove.
8875 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
8876 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
8877 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
8878 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
8879 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
8880 (staticidx, init_alloc_once, init_strings, free_ablock):
8881 Remove redundant initialization.
8882 * fns.c (init_weak_hash_tables): Remove.
8883 * lisp.h (init_weak_hash_tables): Remove prototype.
8884
9730daca
DA
88852012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8886
8887 Use zero_vector where appropriate.
8888 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
8889 accordingly.
8890 * lisp.h (zero_vector): New declaration.
8891 * font.c (null_vector): Remove.
8892 (syms_of_font): Remove initialization and staticpro.
8893 (font_list_entities, font_find_for_lface): Change to use zero_vector.
8894 * keymap.c (Faccessible_keymaps): Likewise.
8895
2e2d2a13
LL
88962012-07-15 Leo Liu <sdl.web@gmail.com>
8897
8898 * fringe.c: Fix typo in comments.
8899
cd276f6e
LL
89002012-07-14 Leo Liu <sdl.web@gmail.com>
8901
8902 * fringe.c: Add a new bitmap exclamation-mark.
8903
5a1131d9
EZ
89042012-07-14 Eli Zaretskii <eliz@gnu.org>
8905
8906 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
8907
8908 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
8909 (HAVE_MENUS): Don't define, defined by editing config.in with
8910 msdos/sed2v2.inp.
8911 (GMALLOC_INHIBIT_VALLOC): Don't define.
8912 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
8913
22e983b7
JB
89142012-07-14 Juanma Barranquero <lekktu@gmail.com>
8915
8916 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
8917
5b3f250f
GM
89182012-07-14 Glenn Morris <rgm@gnu.org>
8919
8920 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
8921 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
8922 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
8923
33d63ff4
GM
89242012-07-13 Glenn Morris <rgm@gnu.org>
8925
5b633342
GM
8926 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
8927
33d63ff4
GM
8928 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
8929 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
8930
b55b9f85
JD
89312012-07-13 Jan Djärv <jan.h.d@swipnet.se>
8932
0dc8cf50
JD
8933 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
8934 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
8935 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
8936 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
8937 where appropriate.
8938 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
8939 as boolean expression.
8940 (x_set_window_size): Remove unused variable toolbar.
8941 (ns_get_color_default, ns_mod_to_lisp): Remove.
8942 (ns_mouse_position): Remove unused variables xchar and ychar.
8943 (ns_compute_glyph_string_overhangs): Remove unused variable face.
8944 (ns_set_vertical_scroll_bar): Remove unused variable count.
8945 (ns_delete_terminal): Remove unused variable i.
8946 (ns_term_init): Remove unused variables r, g and b.
8947 (mouseDown): Remove unused variable window.
8948 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
8949 (initFrameFromEmacs): Remove unused variable vbextra.
8950 (mouseEntered): Remove unused variables p and dpyinfo.
8951 (mouseExited): Remove unused variables p and r.
8952 (ns_define_frame_cursor, ns_clear_frame_area)
8953 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
8954 (menuDown): Assign [sender tag] to variable and cast the variable.
8955
8956 * nsterm.h (menuDown): Add id as type to argument sender.
8957 (ns_display_info_for_name): Add Lisp_Object argument.
8958 (ns_term_init): Add Lisp_Object argument.
8959 (ns_map_event_to_object): Add void argument.
8960 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
8961 prototype with arguments and only declare if __OBJC__.
8962 (nxatoms_of_nsselect): Add void argument.
8963 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
8964 (ns_alloc_autorelease_pool): Add void argument.
8965 (ns_release_autorelease_pool): Add void* argument.
8966 (ns_get_defaults_value): Add const char* argument.
8967
8968 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
8969 (initFromContents): Use SSDATA where appropriate.
8970 (ns_update_menubar): Add braces to ambigous if-else.
8971 (initWithTitle): Put () around assignment in if statement.
8972 (ns_menu_show): Remove unused variables window and keymap.
8973 (update_frame_tool_bar): Remove unused variable selected_p.
8974 (initWithContentRect): Remove unused variable this_cmd_name.
8975
8976 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
8977 appropriate.
8978 (setXBMColor): Remove unused variable len.
8979 (setPixmapData): Put () around assignment in loop statement.
8980
8981 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
8982 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
8983 where appropriate.
8984 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
8985 around assignment in loop statement.
8986 (nsfont_open): Remove unused variable i.
8987 (nsfont_open): Remove unused variable len.
8988 (nsfont_draw): Remove unused variable cs.
8989
8990 * nsfns.m (x_set_icon_name, ns_set_name_internal)
8991 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
8992 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
8993 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
8994 (Fns_font_name, Fns_perform_service)
8995 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
8996 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
8997 (ns_set_name): Remove unused variable view.
8998 (x_set_menu_bar_lines): Remove unused variable olines.
8999 (x_set_tool_bar_lines): Remove unused variable root_window.
9000 (Fns_list_colors): Put () around assignment in while statement.
9001 (Fns_perform_service): Remove unused variable len.
9002 (Fns_display_usable_bounds): Remove unused variable top.
9003 (syms_of_nsfns): Remove unused variable i.
9004
b55b9f85
JD
9005 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9006 memcpy (Bug#11907).
9007
ed9265fc 90082012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
9009
9010 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9011 and free it with DestroyExceptionInfo (Bug#11558).
9012
ef099b57
JB
90132012-07-13 Juanma Barranquero <lekktu@gmail.com>
9014
9015 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9016 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9017 Set here, not in nt/config.nt.
9018
ea814a5d
EZ
90192012-07-13 Eli Zaretskii <eliz@gnu.org>
9020
9021 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9022 cursor overflow into the last glyph on display line when the right
9023 fringe is off. (Bug#11832)
9024
1a952767
PE
90252012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9026
9027 * xdisp.c (produce_special_glyphs): Now static.
9028 * dispextern.h (produce_special_glyphs): Remove decl.
9029
983188fd
GM
90302012-07-13 Glenn Morris <rgm@gnu.org>
9031
8d7c7eed 9032 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
9033 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9034
983188fd
GM
9035 * s/usg5-4-common.h (USG, USG5):
9036 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9037 * s/sol2-6.h (SOLARIS2):
9038 * s/irix6-5.h (IRIX6_5):
9039 * s/hpux10-20.h (USG, USG5, HPUX):
9040 * s/gnu-linux.h (USG, GNU_LINUX):
9041 * s/freebsd.h (BSD_SYSTEM):
9042 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9043 * s/cygwin.h (CYGWIN):
9044 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9045 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9046
d1e68667 90472012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
9048
9049 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 9050
6de0e799
GM
90512012-07-13 Glenn Morris <rgm@gnu.org>
9052
739ae010
GM
9053 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9054
dbee5793
GM
9055 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9056
6de0e799
GM
9057 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9058 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9059
b82da769
GM
90602012-07-12 Glenn Morris <rgm@gnu.org>
9061
4fae5a7a 9062 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
9063
9064 * process.c (init_process_emacs): Rename from init_process.
9065 The old name is also the name of a Mach system call.
9066 * lisp.h, emacs.c: Update for this name change.
9067 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9068 longer needed.
9069
5a979817
EZ
90702012-07-12 Eli Zaretskii <eliz@gnu.org>
9071
9072 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9073 memmove call that removes glyphs covered by the left truncation
9074 glyph. Improve commentary.
9075 (display_line): Fix display of continuation glyphs on GUI frames
9076 when the right fringe is turned off and variable-size fonts are
9077 used in the window. Move the code that appends a stretch glyph to
9078 produce_special_glyphs, so that it could be used for truncation
9079 and continuation glyphs alike.
9080 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9081 glyph of a suitably computed width, to align the special glyphs at
9082 the window margin. Code moved from display_line. (Bug#11832)
9083
3e91a053
GM
90842012-07-12 Glenn Morris <rgm@gnu.org>
9085
ba9e4b84
GM
9086 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9087
9088 * s/gnu-linux.h, s/hpux10-20.h:
9089 Do not unconditionally define HAVE_XRMSETDATABASE.
9090
3e91a053
GM
9091 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9092
b300b1f4
PE
90932012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9094
9095 Fix typos that broke OS X build.
9096 Reported by Randal L. Schwartz in
9097 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9098 * nsterm.m (ns_timeout): Add missing local decl.
9099 (ns_get_color): snprintf -> sprintf, to fix typo.
9100
6e777848
GM
91012012-07-12 Glenn Morris <rgm@gnu.org>
9102
3f922c37
GM
9103 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9104 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9105 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9106 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9107
0ab7b23a
GM
9108 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9109 Move PTY_OPEN to configure.
9110
6e777848
GM
9111 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9112 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9113 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9114
4a7edc24
DA
91152012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9116
9117 Use empty_unibyte_string where applicable.
9118 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9119 * lread.c (read1): Likewise.
9120 * xsettings.c (syms_of_xsettings): Likewise.
9121
308aab79
GM
91222012-07-12 Glenn Morris <rgm@gnu.org>
9123
42bd1719
GM
9124 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9125 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
9126 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9127 * s/hpux10-20.h (RUN_TIME_REMAP):
9128 * s/bsd-common.h (TABDLY): Move to configure.
9129
9130 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9131
9132 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9133
ea0bbd17 9134 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 9135 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
9136
9137 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 9138
308aab79
GM
9139 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9140 * s/template.h: Move NARROWPROTO to configure.
9141
ee1cf5cf
GM
91422012-07-11 Glenn Morris <rgm@gnu.org>
9143
30fe9bf4
GM
9144 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9145 unused since 2011-01-17 change to systty.h.
9146
ee1cf5cf
GM
9147 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9148 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9149 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9150
63e47e07
PE
91512012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9152
9153 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9154
c43fb4c3
GM
91552012-07-11 Glenn Morris <rgm@gnu.org>
9156
9157 * s/darwin.h, s/gnu-linux.h, s/template.h:
9158 Move INTERRUPT_INPUT to configure.
9159
e8df9267
DA
91602012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9161
9162 Minor adjustments to interning code.
9163 * lisp.h (intern, intern_c_string): Redefine as static inline
9164 wrappers for intern_1 and intern_c_string_1, respectively.
9165 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
9166 * lread.c (intern_1, intern_c_string_1, oblookup):
9167 Simplify Vobarray checking.
e8df9267
DA
9168 * font.c (font_intern_prop): Likewise. Adjust comment.
9169 * w32font.c (intern_font_name): Likewise.
9170
34348bd4
AS
91712012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9172
d96a1e0c
AS
9173 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9174
34348bd4
AS
9175 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9176 of Fcar/Fcdr if possible.
9177 * font.c (check_otf_features): Likewise.
9178 * fontset.c (Fnew_fontset): Likewise.
9179 * gnutls.c (Fgnutls_boot): Likewise.
9180 * minibuf.c (read_minibuf): Likewise.
9181 * msdos.c (IT_set_frame_parameters): Likewise.
9182 * xmenu.c (Fx_popup_dialog): Likewise.
9183 * w32menu.c (Fx_popup_dialog): Likewise.
9184
c8add24e
GM
91852012-07-11 Glenn Morris <rgm@gnu.org>
9186
4b575b3c
GM
9187 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9188 since nothing has defined it on these platforms.
9189
09f4e3b0
GM
9190 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9191 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9192
172bedef
GM
9193 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9194 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9195 Move CLASH_DETECTION to configure.
9196
249685df
GM
9197 * s/gnu.h: Remove file, which is now empty.
9198
c8add24e
GM
9199 * s/gnu.h, s/gnu-linux.h:
9200 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9201
b41253a3
JW
92022012-07-11 John Wiegley <johnw@newartisans.com>
9203
9204 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9205 function attribute, so we only use it if it exists in the
9206 compiler.
9207
d923b542
DA
92082012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9209
9210 Avoid call to strlen in fast_c_string_match_ignore_case.
9211 * search.c (fast_c_string_match_ignore_case): Change to use
9212 length argument. Adjust users accordingly.
9213 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9214
5ebbef1d
PE
92152012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9216
bb352260
PE
9217 Assume mkdir, rmdir.
9218 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9219 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9220
57054ddd
PE
9221 Assume rename.
9222 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9223
b747d3f7
PE
9224 Assume perror.
9225 * s/hpux10-20.h (HAVE_PERROR): Remove.
9226 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9227 Remove dummy definition, as this problem was obsolete long ago.
9228
5ebbef1d
PE
9229 Assume strerror.
9230 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9231
984e7f30
DA
92322012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9233
9234 Avoid calls to strlen in font processing functions.
9235 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
9236 (font_open_by_name): Change to use length argument.
9237 Adjust users accordingly.
d923b542
DA
9238 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9239 Adjust prototypes.
9240 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9241 Change to return ptrdiff_t.
984e7f30
DA
9242 (xfont_list_pattern, xfont_match): Use length returned by
9243 xfont_decode_coding_xlfd.
9244 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9245
20e94fdd
GM
92462012-07-11 Glenn Morris <rgm@gnu.org>
9247
9d596af3
GM
9248 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9249 Move DONT_REOPEN_PTY to configure.
9250
20e94fdd
GM
9251 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9252 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9253
e99a530f
PE
92542012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9255
22ffb973
PE
9256 Remove "#define unix" that is no longer needed (Bug#11905).
9257 * s/aix4-2.h (unix): Remove; no longer needed.
9258
e9a9ae03
PE
9259 EMACS_TIME simplification (Bug#11875).
9260 This replaces macros (which typically do not work in GDB)
9261 with functions, typedefs and enums, making the code easier to debug.
9262 The functional style also makes code easier to read and maintain.
9263 * systime.h: Include <sys/time.h> on all hosts, not just if
9264 WINDOWSNT, since 'struct timeval' is needed in general.
9265 (EMACS_TIME): Now a typedef, not a macro.
9266 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9267 not macros.
9268 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9269 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9270 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9271 (EMACS_TIME_LE): Now functions, not macros.
9272 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9273 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9274 which are not functions. All uses rewritten to use:
9275 (make_emacs_time): New function.
9276 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9277 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9278 not functions. All uses rewritten to use the following, respectively:
9279 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9280 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 9281 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
9282 * fileio.c (Fcopy_file):
9283 * xterm.c (XTflash): Get the current time closer to when it's used.
9284 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9285
ffacb126
PE
9286 * bytecode.c (targets): Suppress -Woverride-init warnings.
9287
e99a530f
PE
9288 Simplify by avoiding confusing use of strncpy etc.
9289 * doc.c (Fsnarf_documentation):
9290 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9291 * frame.c (Fmake_terminal_frame):
9292 * gtkutil.c (get_utf8_string):
9293 * lread.c (openp):
9294 * nsmenu.m (ns_update_menubar):
9295 * regex.c (regerror):
9296 Prefer memcpy to strncpy and strncat when either will do.
9297 * fileio.c (Fsubstitute_in_file_name):
9298 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9299 (menu_separator_name_p):
9300 * nsmenu.m (ns_update_menubar):
9301 Prefer memcmp to strncmp when either will do.
9302 * nsterm.m: Include <ftoastr.h>.
9303 (ns_get_color):
9304 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9305 Prefer snprintf to strncpy.
9306 * nsterm.m (ns_term_init):
9307 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9308 * nsterm.m (ns_term_init):
9309 Avoid the need for strncpy, by using build_string or
9310 make_unibyte_string directly. Use dtoastr, not snprintf.
9311 * process.c (Fmake_network_process): Diagnose service names that
9312 are too long, rather than silently truncating them or creating
9313 non-null-terminated names.
9314 (Fnetwork_interface_info): Likewise, for interface names.
9315 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9316 Prefer sprintf to strncat.
9317 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9318 Prefer vsnprintf to vsprintf + strncpy.
9319
c59592b3
GM
93202012-07-10 Glenn Morris <rgm@gnu.org>
9321
9322 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9323 Clarify fallback case.
9324
7d7bbefd
DA
93252012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9326
9327 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9328 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9329 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 9330 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
9331 where argument type is known to be a Lisp_Cons.
9332
3a4c8000
TT
93332012-07-10 Tom Tromey <tromey@redhat.com>
9334
9335 * bytecode.c (BYTE_CODE_THREADED): New macro.
9336 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9337 (enum byte_code_op): New type.
9338 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9339 (exec_byte_code): Use them. Use token threading when applicable.
9340
2a0213a6
DA
93412012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9342
9343 Optimize pure C strings initialization.
9344 * lisp.h (make_pure_string): Fix prototype.
9345 (build_pure_c_string): New function, defined as static inline. This
9346 provides a better opportunity to optimize away calls to strlen when
9347 the function is called with compile-time constant argument.
9348 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9349 argument, adjust users accordingly. Use build_pure_c_string where
9350 appropriate.
9351 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9352 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9353 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9354
cb1caeaf
DA
93552012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9356
9357 Avoid calls to strlen in miscellaneous functions.
9358 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9359 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9360 * lread.c (openp): Likewise.
9361
c293e30c
DA
93622012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9363
9364 Avoid calls to strlen in path processing functions.
9365 * fileio.c (file_name_as_directory): Add comment. Change to add
9366 srclen argument and return the length of result. Adjust users
9367 accordingly.
9368 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
9369 swap 1st and 2nd arguments to obey the common convention.
9370 Adjust users accordingly.
c293e30c
DA
9371 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9372
9e059e3f
GM
93732012-07-10 Glenn Morris <rgm@gnu.org>
9374
d02eb359
GM
9375 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9376 Move PENDING_OUTPUT_COUNT definition to configure.
9377
882cf227
GM
9378 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9379 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9380 * s/gnu.h (DATA_START): Move definitions to configure.
9381
af6e839f
GM
9382 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9383 We include usg5-4-common.h, which defines them both.
9384
40289a12
GM
9385 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9386 O_RDONLY already includes it).
9387
9e059e3f
GM
9388 Stop ns builds setting the EMACSLOADPATH environment variable.
9389 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9390 Now it does not set EMACSLOADPATH, just returns the load-path string.
9391 * nsterm.h: Update accordingly.
9392 * lread.c [HAVE_NS]: Include nsterm.h.
9393 (init_lread) [HAVE_NS]: Use ns_load_path.
9394 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9395
7c4e8ec0
GM
93962012-07-09 Glenn Morris <rgm@gnu.org>
9397
d4f600ff
GM
9398 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9399 since the included bsd-common.h does so.
9400
cbb31951
GM
9401 Stop ns builds setting the EMACSPATH environment variable.
9402 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9403 (ns_init_paths): Do not set EMACSPATH.
9404 * nsterm.h (ns_exec_path): Add it.
9405 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9406 Use ns_exec_path.
9407
7c4e8ec0
GM
9408 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9409
26bccfae
PE
94102012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9411
a0bee46f
PE
9412 * process.c (wait_reading_process_output): 'waitchannels' was unset
9413 when read_kbd || !NILP (wait_for_cell); fix this.
9414
5994c183
PE
9415 Add GCC-style 'const' attribute to functions that can use it.
9416 * character.h (char_resolve_modifier_mask):
9417 * keyboard.h (make_ctrl_char):
9418 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9419 (init_character_once, next_almost_prime, init_fns, init_image)
9420 (flush_pending_output, init_sound):
9421 * mem-limits.h (start_of_data):
9422 * menu.h (finish_menu_items):
9423 Add ATTRIBUTE_CONST.
9424 * emacs.c (DEFINE_DUMMY_FUNCTION):
9425 Declare the dummy function with ATTRIBUTE_CONST.
9426 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9427 Add decls with ATTRIBUTE_CONST.
9428
26bccfae
PE
9429 Minor improvements to make_formatted_string.
9430 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9431 where int is good enough, as vsprintf returns an int.
9432 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9433
a8290ec3
DA
94342012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9435
9436 Use make_formatted_string to avoid double length calculation.
9437 * lisp.h (make_formatted_string): New prototype.
9438 * alloc.c (make_formatted_string): New function.
9439 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 9440 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
9441 * editfns.c (Fcurrent_time_zone): Likewise.
9442 * filelock.c (get_boot_time): Likewise.
9443 * frame.c (make_terminal_frame, set_term_frame_name)
9444 (x_report_frame_params): Likewise.
9445 * image.c (gs_load): Likewise.
9446 * minibuf.c (get_minibuffer): Likewise.
9447 * msdos.c (dos_set_window_size): Likewise.
9448 * process.c (make_process): Likewise.
9449 * xdisp.c (ensure_echo_area_buffers): Likewise.
9450 * xsettings.c (apply_xft_settings): Likewise.
9451
d01ba2f1
GM
94522012-07-09 Glenn Morris <rgm@gnu.org>
9453
9454 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9455 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9456 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9457 * nsterm.h (ns_etc_directory): Add it.
9458 * callproc.c [HAVE_NS]: Include nsterm.h.
9459 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9460
f1f924b6
DA
94612012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9462
9463 Move marker debugging code under MARKER_DEBUG.
9464 * marker.c (MARKER_DEBUG): Move marker debugging code under
9465 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9466 for bootstrap with --enable-checking (~3x slowdown reported
9467 by Juanma Barranquero <lekktu@gmail.com>).
9468 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9469
ab531b66
PE
94702012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9471
9472 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9473 See <http://bugs.gnu.org/11825#29>.
9474
c4b3bc8a
EZ
94752012-07-08 Eli Zaretskii <eliz@gnu.org>
9476
9477 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9478 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
9479 (display_line): Add commentary about displaying truncation glyphs
9480 on GUI frames.
9481 (produce_special_glyphs): Move here from term.c.
9482
9483 * term.c (produce_special_glyphs): Move to xdisp.c.
9484
9485 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9486 section.
c4b3bc8a 9487
b676b881
AS
94882012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9489
f17c5273
AS
9490 * xdisp.c (display_line): Avoid warning about implicit declaration
9491 of FRAME_FONT.
9492
298819b9
AS
9493 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9494
b676b881
AS
9495 * lisp.h: Remove empty conditional.
9496
6045c4fd
PE
94972012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9498
b3350bf9
PE
9499 * lread.c (load_path_check): Now static.
9500
6045c4fd
PE
9501 Fix some minor --with-ns problems found by static checking.
9502 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9503 (x_set_font) [!HAVE_X_WINDOWS]:
9504 * image.c (xpm_load_image) [HAVE_NS]:
9505 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9506 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9507 Remove unused local.
9508 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9509 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9510 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9511 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9512 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9513 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9514 Fix pointer signedness problem.
9515 * xfaces.c (FRAME_X_FONT_TABLE):
9516 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9517
929e7845
GM
95182012-07-07 Glenn Morris <rgm@gnu.org>
9519
9520 * lread.c (load_path_check): New function, split from init_lread.
9521 (init_lread): Reorganize. Motivation:
9522 If EMACSLOADPATH is set, check/warn about that rather than the
9523 defaults, which we are not going to use. Hence we can remove
9524 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9525 Don't warn if site-lisp directories are missing.
9526 If not installed, start from a blank load-path, since
9527 PATH_LOADSEARCH refers to the eventual installation directories.
9528
58dd0aa4
EZ
95292012-07-07 Eli Zaretskii <eliz@gnu.org>
9530
9531 Support truncation and continuation glyphs on GUI frames, when
9532 fringes are disabled. (Bug#11832)
9533 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
9534 continuation glyphs even if on GUI frames.
9535 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
9536 or both, are absent.
9537 (start_display, move_it_in_display_line_to): Handle the case of a
9538 GUI frame without a fringe to display continuation or truncation
9539 glyphs.
9540 (insert_left_trunc_glyphs): Support GUI frames: make sure
9541 truncation glyphs overwrite enough glyphs from the current line to
9542 have sufficient space in pixels.
9543 (display_line): Support truncation and continuation glyphs on GUI
9544 frames. If some spare pixels are left on the line after inserting
9545 the truncation glyphs, fill that space with a stretch glyph of a
9546 suitably computed width.
9547
9548 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9549 produce_glyphs, to support GUI sessions.
9550
31571fd7
PE
95512012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9552
5a16b9bc
PE
9553 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9554
f3047c75
PE
9555 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9556
31571fd7
PE
9557 Do not require float-time's arg to fit in time_t (Bug#11825).
9558 This works better on hosts where time_t is unsigned, and where
9559 float-time is applied to the (negative) difference between two times.
9560 * editfns.c (decode_time_components): Last arg is now double *,
9561 not int *, and means to store all the result as a double, without
9562 worrying about whether the seconds part fits in time_t.
9563 All callers changed.
9564 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9565 All callers changed.
9566 (Ffloat_time): Do not fail merely because the specified time falls
9567 outside of time_t range.
9568
4516fbef
GM
95692012-07-07 Glenn Morris <rgm@gnu.org>
9570
9571 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9572 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9573 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9574
07adc2c6
JB
95752012-07-07 Juanma Barranquero <lekktu@gmail.com>
9576
9577 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9578 Update dependencies.
9579
9580 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9581
fd573f31
PE
95822012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9583
fee5959d
PE
9584 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9585 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9586 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9587 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9588 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9589 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9590
fd573f31
PE
9591 * xfont.c (compare_font_names): Redo to omit the need for casts.
9592
ddadbc0e
AS
95932012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9594
fca8d6b6
AS
9595 * xfns.c (Fx_change_window_property): Doc fix.
9596 * w32fns.c (Fx_change_window_property): Doc fix.
9597
ddadbc0e
AS
9598 * w32fns.c (Fx_window_property): Accept the same arguments as the
9599 X Windows version. Doc fix.
9600 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9601
ed9265fc 96022012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
9603 Eli Zaretskii <eliz@gnu.org>
9604
9605 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9606 Windows-specific code from nt/config.nt moved here.
9607 Obsolete settings removed.
9608
216ee680
PE
96092012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9610
9611 * process.c: Avoid unnecessary calls to gettime.
9612 (wait_reading_process_output): Don't get the time of day
9613 when gobbling data immediately and not waiting, as there's no need
9614 for it in that case. This removes a FIXME.
9615
bdd091e4
JD
96162012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9617
9618 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9619 is defined (Bug#11768).
9620
9d44f8ce
DA
96212012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9622
9623 Fix marker debugging code.
9624 * marker.c (byte_char_debug_check): Do not perform the check
9625 if buffer is not multibyte.
090bd7cb
JB
9626 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9627 Call byte_char_debug_check with correct arguments.
9d44f8ce 9628
90fc4786
DA
96292012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9630
9631 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
9632 * marker.c (byte_char_debug_check, count_markers):
9633 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
9634 (byte_debug_flag): Remove.
9635 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9636 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9637
7b7ae965
DA
96382012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9639
4e57b342
DA
9640 Avoid code repetition in marker-related functions.
9641 * marker.c (attach_marker): New function.
9642 (Fset_marker, set_marker_restricted, set_marker_both)
9643 (set_marker_restricted_both): Use it.
9644 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9645 Consistently rename charno to charpos.
9646 (marker_position): Add eassert.
9647 (marker_byte_position): Convert to eassert.
9648
96492012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9650
9651 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 9652 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 9653 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 9654
657924ff
DA
96552012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9656
9657 Introduce fast path for the widely used marker operation.
9658 * alloc.c (build_marker): New function.
9659 * lisp.h (build_marker): New prototype.
9660 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9661 * composite.c (autocmp_chars): Likewise.
9662 * editfns.c (buildmark): Remove.
9663 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9664 (save_restriction_save): Use build_marker.
9665 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9666 * window.c (save_window_save): Likewise.
9667
041a49a6
DA
96682012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9669
9670 Do not use Fdelete_overlay in delete_all_overlays
9671 to avoid redundant calls to unchain_overlay.
9672 * buffer.c (drop_overlay): New function.
9673 (delete_all_overlays, Fdelete_overlay): Use it.
9674 * minibuf.c (get_minibuffer): Fix comment.
9675
7dca65a4
PE
96762012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9677
9678 Port to OpenBSD 5.1 amd64.
9679 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9680 This is needed for OpenBSD, and should be harmless on all BSD systems.
9681 Also, include <sys/sysctl.h>, as it should be available on all
9682 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9683 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9684 use p_pid member, not kp_proc.pid.
9685
8eb876e2
GM
96862012-07-06 Glenn Morris <rgm@gnu.org>
9687
9688 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
9689
38182d90
PE
96902012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9691
9692 More xmalloc and related cleanup.
9693 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
9694 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
9695 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
9696 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
9697 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
9698 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
9699 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
9700 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
9701 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
9702 * xterm.c:
9703 Omit needless casts involving void * pointers and allocation.
9704 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
9705 as the former is more robust if P's type is changed.
9706 Prefer xzalloc to xmalloc + memset 0.
9707 Simplify malloc-or-realloc to realloc.
9708 Don't worry about xmalloc returning a null pointer.
9709 Prefer xstrdup to xmalloc + strcpy.
9710 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
9711 growing it.
9712 * keyboard.c (apply_modifiers_uncached): Prefer local array to
9713 alloca of a constant.
9714
6dd5a677
EZ
97152012-07-05 Eli Zaretskii <eliz@gnu.org>
9716
9717 * xdisp.c (display_line): Fix horizontal pixel coordinates when
9718 hscroll is larger than the line width. Fixes long and futile
9719 looping inside extend_face_to_end_of_line (on a TTY) producing
9720 glyphs that are not needed and thrown away.
9721
6b312f0f
DA
97222012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9723
9724 * marker.c (set_marker_restricted_both): Simplify by using
9725 clip_to_bounds.
9726
f520ef9b
PE
97272012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9728
9729 * editfns.c (region_limit): Simplify by using clip_to_bounds.
9730
383b7c95
JD
97312012-07-05 Jan Djärv <jan.h.d@swipnet.se>
9732
9733 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
9734 not defined (Bug#11768).
9735 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
9736 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
9737 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
9738 followed by gtk_box_set_homogeneous (Bug#11768).
9739 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
9740 (update_theme_scrollbar_width, xg_create_scroll_bar):
9741 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
9742 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
9743 (is_box_type): New function (Bug#11768).
9744 (xg_tool_item_stale_p): Call is_box_type.
5293d758 9745 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
9746 with default display (Bug#11768).
9747
d6e7bf45
EZ
97482012-07-05 Eli Zaretskii <eliz@gnu.org>
9749
9750 * xdisp.c (window_hscroll_limited): New function.
9751 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
9752 coordinates when window's hscroll is set to insanely large
9753 values. (Bug#11857)
9754
431391ec
JB
97552012-07-05 Juanma Barranquero <lekktu@gmail.com>
9756
9757 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
9758 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
9759
23f86fce
DA
97602012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9761
9762 Cleanup xmalloc.
9763 * lisp.h (xzalloc): New prototype. Omit needless casts.
9764 * alloc.c (xzalloc): New function. Omit needless casts.
9765 * charset.c: Omit needless casts. Convert all calls to
9766 xmalloc with following memset to xzalloc.
9767 * dispnew.c: Likewise.
9768 * fringe.c: Likewise.
9769 * image.c: Likewise.
9770 * sound.c: Likewise.
9771 * term.c: Likewise.
9772 * w32fns.c: Likewise.
9773 * w32font.c: Likewise.
9774 * w32term.c: Likewise.
9775 * xfaces.c: Likewise.
9776 * xfns.c: Likewise.
9777 * xterm.c: Likewise.
9778 * atimer.c: Omit needless casts.
9779 * buffer.c: Likewise.
9780 * callproc.c: Likewise.
9781 * ccl.c: Likewise.
9782 * coding.c: Likewise.
9783 * composite.c: Likewise.
9784 * doc.c: Likewise.
9785 * doprnt.c: Likewise.
9786 * editfns.c: Likewise.
9787 * emacs.c: Likewise.
9788 * eval.c: Likewise.
9789 * filelock.c: Likewise.
9790 * fns.c: Likewise.
9791 * gtkutil.c: Likewise.
9792 * keyboard.c: Likewise.
9793 * lisp.h: Likewise.
9794 * lread.c: Likewise.
9795 * minibuf.c: Likewise.
9796 * msdos.c: Likewise.
9797 * print.c: Likewise.
9798 * process.c: Likewise.
9799 * region-cache.c: Likewise.
9800 * search.c: Likewise.
9801 * sysdep.c: Likewise.
9802 * termcap.c: Likewise.
9803 * terminal.c: Likewise.
9804 * tparam.c: Likewise.
9805 * w16select.c: Likewise.
9806 * w32.c: Likewise.
9807 * w32reg.c: Likewise.
9808 * w32select.c: Likewise.
9809 * w32uniscribe.c: Likewise.
9810 * widget.c: Likewise.
9811 * xdisp.c: Likewise.
9812 * xmenu.c: Likewise.
9813 * xrdb.c: Likewise.
9814 * xselect.c: Likewise.
9815
0497dc44
PE
98162012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9817
9818 * fileio.c (time_error_value): Check the right error number.
9819 Problem reported by Troels Nielsen in
9820 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9821
356e7178
PE
98222012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9823
4e71fd89
PE
9824 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9825 This should be fixed in a better way; see Eli Zaretskii in
9826 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9827 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9828
f0941253
PE
9829 * fileio.c (time_error_value): Rename from special_mtime.
9830 The old name's problems were noted by Eli Zaretskii in
9831 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
9832
065c9eb4
PE
9833 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
9834 This variable's comment says Emacs needs at least one GDB-visible
9835 symbol of type enum pvec_type, to work around GDB problems.
9836 The symbol's value doesn't matter.
9837
356e7178
PE
9838 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
9839 that causes compilation to fail on pre-C99 compilers.
9840
ed9265fc 98412012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
9842
9843 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
9844 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
9845
3884d954
DA
98462012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9847
d209e2fb 9848 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
9849 headers for buffer_defaults and buffer_local_symbols.
9850 Reported by Juanma Barranquero <lekktu@gmail.com>.
9851
ee28be33
SM
98522012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9853
9854 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
9855 * lisp.h (enum pvec_type): Use fewer bits.
9856 (PSEUDOVECTOR_SIZE_BITS): New constant.
9857 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
9858 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
9859 change in pvec_type.
9860 (PSEUDOVECTOR_TYPEP): New macro.
9861 (TYPED_PSEUDOVECTORP): Use it.
9862 * fns.c (internal_equal): Adapt code to extract pvectype.
9863 * emacs.c (gdb_pvec_type): Update type.
9864 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
9865 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
9866 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
9867 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
9868 (sweep_vectors): Use it. Use local var `total_bytes' instead of
9869 abusing vector->header.next.nbytes.
9870 (live_vector_p): Use PVEC_TYPE.
9871 (mark_object): Adapt code to extract pvectype. Use switch.
9872
c7f2cd7f
PE
98732012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9874
9875 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
9876 Tighten new eassert a bit.
9877
8ce70ed2
DA
98782012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9879
9880 Fix compilation with --enable-gcc-warnings and -O1
9881 optimization level.
9882 * doprnt.c (doprnt): Change type of tem to int, initialize
9883 to avoid compiler warning. Add eassert.
9884 * search.c (simple_search): Initialize match_byte to avoid
9885 compiler warning. Add eassert.
9886
dea7f1e5
PE
98872012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9888
24a212eb
PE
9889 Avoid weird behavior with large horizontal scrolls.
9890 Without this change, for example, large hscroll values would
9891 mess up Emacs's display on Fedora 15 x86, presumably due to
9892 overflows in int calculations in the display code.
9893 Also, if buffers had long lines, Emacs would freeze.
9894 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
9895 (set_window_hscroll): New function, containing the old guts of
9896 Fset_window_hscroll. Return the clipped value.
9897 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
9898 This avoids the need to check against PTRDIFF_MAX.
9899
dea7f1e5
PE
9900 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
9901
76046526
DA
99022012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9903
9904 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
9905
39adff0d
PE
99062012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9907
63807d47
PE
9908 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
9909 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
9910 since GCC 4.4.6 issues a bogus warning for them.
9911
39adff0d
PE
9912 Fix bugs in file timestamp newness comparisons.
9913 * fileio.c (Ffile_newer_than_file_p):
9914 * lread.c (Fload): Use full timestamp resolution of files,
9915 not just the 1-second resolution, so that files that are only
9916 slightly newer still count as newer.
9917 * fileio.c (Ffile_newer_than_file_p): Don't assume file
9918 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
9919
dbeed9a6
PE
99202012-07-03 Paul Eggert <eggert@cs.ucla.edu>
9921
9922 * fileio.c: Improve handling of file time marker. (Bug#11852)
9923 (special_mtime): New function.
9924 (Finsert_file_contents, Fverify_visited_file_modtime):
9925 Use it to set special mtime values consistently.
9926
636334d6
AS
99272012-07-03 Andreas Schwab <schwab@linux-m68k.org>
9928
9929 * fileio.c (Finsert_file_contents): Properly handle st_mtime
9930 marker for non-existing file. (Bug#11852)
9931
e2017fe2
GM
99322012-07-03 Glenn Morris <rgm@gnu.org>
9933
9934 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
9935 and did not make it into globals.h).
9936
404dbd37
TT
99372012-07-03 Tom Tromey <tromey@redhat.com>
9938
9939 * window.c (Fset_window_margins, Fset_window_fringes)
9940 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
9941 * textprop.c (Fprevious_property_change): No longer static.
9942 * syntax.c (Fsyntax_table_p): No longer static.
9943 * process.c (Fget_process, Fprocess_datagram_address): No longer
9944 static.
9945 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
9946 * keyboard.c (Fcommand_execute): No longer static.
9947 Remove EXFUN.
9948 * insdel.c (Fcombine_after_change_execute): No longer static.
9949 * image.c (Finit_image_library): No longer static.
9950 * fileio.c (Fmake_symbolic_link): No longer static.
9951 * eval.c (Ffetch_bytecode): No longer static.
9952 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
9953 * doc.c (Fdocumentation_property, Fsnarf_documentation):
9954 No longer static.
404dbd37
TT
9955 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
9956 static.
9957 * dired.c (Ffile_attributes): No longer static.
9958 * composite.c (Fcomposition_get_gstring): No longer static.
9959 * callproc.c (Fgetenv_internal): No longer static.
9960
9961 * ccl.h: Remove EXFUNs.
9962 * buffer.h: Remove EXFUNs.
9963 * dispextern.h: Remove EXFUNs.
9964 * intervals.h: Remove EXFUNs.
9965 * fontset.h: Remove EXFUN.
9966 * font.h: Remove EXFUNs.
9967 * dosfns.c (system_process_attributes): Remove EXFUN.
9968 * keymap.h: Remove EXFUNs.
9969 * lisp.h: Remove EXFUNs.
9970 * w32term.h: Remove EXFUNs.
9971 * window.h: Remove EXFUNs.
9972 * xsettings.h: Remove EXFUN.
9973 * xterm.h: Remove EXFUN.
9974
8e4fd1e1
GM
99752012-07-03 Glenn Morris <rgm@gnu.org>
9976
9977 * lisp.h (Frandom): Make it visible to C.
9978 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
9979 buffer for invisible buffers. (Bug#1229)
9980
ca95b3eb
DA
99812012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9982
9983 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
9984 values which aren't power of 2.
14ae4239 9985 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 9986 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
9987 accordingly.
9988
7555c33f
SM
99892012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
9990
9991 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
9992
9993 * alloc.c (mark_object): Revert part of last patch to use `switch'.
9994
d12e8f5a
DA
99952012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9996
9997 * alloc.c (allocate_vector_block): Remove redundant
9998 calls to mallopt if DOUG_LEA_MALLOC is defined.
9999 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10000 avoid calls to mallopt if zero_vector is returned.
10001
296094c3
DA
100022012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10003
10004 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10005 is enabled, avoid dereferencing NULL current_sblock if
10006 running undumped.
10007
36429c89
DA
100082012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10009
10010 Cleanup basic buffer management.
10011 * buffer.h (struct buffer): Change layout to use generic vector
10012 marking code. Fix some comments. Change type of 'clip_changed'
10013 to bitfield. Remove unused #ifndef old.
10014 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10015 (GET_OVERLAYS_AT): Fix indentation.
10016 (for_each_per_buffer_object_at): New macro.
10017 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10018 (Fbuffer_local_variables): Use it.
10019 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10020 * alloc.c (allocate_buffer): Adjust to match new layout of
10021 struct buffer. Fix comment.
10022 (mark_overlay): New function.
10023 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10024 Lisp area of struct buffer.
10025 (mark_object): Use it. Adjust marking of misc objects
10026 and related comments.
10027
3b3e4cac
PE
100282012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10029
10030 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10031 wrapper that is not needed because the wrapped code is a no-op (zero
10032 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10033 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10034
cf5c0175
DA
100352012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10036
10037 * alloc.c (mark_buffer): Simplify. Remove prototype.
10038 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 10039 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
10040 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10041 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 10042
ca26824c
GM
100432012-06-30 Glenn Morris <rgm@gnu.org>
10044
2e4c5312
GM
10045 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10046
ca26824c
GM
10047 * epaths.in (PATH_SITELOADSEARCH): New.
10048 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10049 This is rather than relying on --enable-locallisppath elements
10050 having "site-lisp" in their names. (Bug#10208#25, 11658)
10051
0d23c240
EZ
100522012-06-30 Eli Zaretskii <eliz@gnu.org>
10053
c9240d7a
EZ
10054 * w32proc.c (sys_select): Accept and ignore one more argument.
10055
10056 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10057
0d23c240 10058 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 10059 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
10060
10061 * sysdep.c: Don't include dos.h and dosfns.h.
10062
10063 * process.c (sys_select):
10064 * msdos.c (sys_select): Accept one more argument and ignore it.
10065
10066 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10067 adapt data types and code to that.
10068
10069 * dosfns.c:
10070 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10071 which clashes with the gnulib function of the same name.
10072
af5a5a98
AS
100732012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10074
c5e4379c
AS
10075 * font.c (font_style_to_value, font_style_symbolic)
10076 (font_prop_validate_style): Add type checks for values in
10077 font_style_table.
10078
af5a5a98
AS
10079 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10080 argument.
10081 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10082 uses.
10083
8d38f461
EZ
100842012-06-29 Eli Zaretskii <eliz@gnu.org>
10085
2e5a6631
EZ
10086 * xdisp.c (try_window_id): Undo last change.
10087
8d38f461
EZ
10088 * w32.c (getwd): Adjust commentary about startup_dir.
10089 (init_environment): Always call sys_access, even in non-MSVC
10090 builds. Don't chdir to the directory of the Emacs executable.
10091 This undoes code from 1997 which was justified by the need to
10092 "avoid conflicts when removing and renaming directories". But its
10093 downside was that every relative file name was being interpreted
10094 relative to the directory of the Emacs executable, which can never
10095 be TRT. In particular, it broke sys_access when called with
10096 relative file names.
10097 (sys_access): Map GetLastError to errno.
10098
2af3565e
DA
100992012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10100
10101 * window.h (struct window): Change type of 'fringes_outside_margins'
10102 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 10103 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
10104 Adjust comment.
10105 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10106 to ptrdiff_t.
10107
c8d3a25c 101082012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 10109
c8d3a25c
GM
10110 * gnutls.c (emacs_gnutls_handshake):
10111 Add QUIT to make the loop interruptible.
57570cd3 10112
c8d3a25c 101132012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 10114
c8d3a25c
GM
10115 * charset.c (init_charset): Make lack of etc/charsets fatal.
10116
3e984ee8
DA
101172012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10118
10119 * editfns.c (region_limit): Fix type mismatch.
10120
ef884f23
DA
101212012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10122
10123 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10124 undefined. Convert from xassert to eassert.
10125 * nsmenu.m: Convert from xassert to eassert.
10126 * nsterm.m: Likewise.
10127
7d7e0027
SM
101282012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10129
10130 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10131
aa754e6a
PE
101322012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10133
10134 Avoid integer overflow on scroll-left and scroll-right.
10135 * window.c (HSCROLL_MAX): New macro.
10136 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10137 overflow when requested scroll falls outside ptrdiff_t range.
10138
80b00b08
DA
101392012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10140
10141 * window.h (struct window): Change type of 'hscroll',
10142 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10143 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10144 Adjust users accordingly.
10145 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10146 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10147 from EMACS_INT to ptrdiff_t.
10148 (make_window): Omit redundant initialization.
10149
62b2bcf6
JB
101502012-06-28 Juanma Barranquero <lekktu@gmail.com>
10151
10152 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10153
45942c7d
DA
101542012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10155
10156 * window.h (struct window): Change type of 'use_time' and
10157 'sequence_number' from Lisp_Object to int.
10158 * frame.c (make_frame): Adjust users accordingly.
10159 * print.c (print_object): Likewise.
10160 * window.c (select_window, Fwindow_use_time, make_parent_window)
10161 (make_window): Likewise.
10162
e509cfa6
DA
101632012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10164
10165 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10166 enabled with --enable-checking=[all,glyphs] configure option.
10167 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10168 adjust comments accordingly.
10169 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10170 undefined, adjust comments accordingly.
10171 * image.c: Likewise.
10172 * scroll.c: Likewise.
10173 * w32fns.c: Likewise.
10174 * w32term.c: Likewise.
10175 * xdisp.c: Likewise.
10176 * xfaces.c: Likewise.
10177 * xfns.c: Likewise.
10178 * xterm.c: Likewise.
10179
a54e2c05
DA
101802012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10181
10182 Generalize run-time debugging checks.
10183 * dispextern.h (XASSERTS): Remove.
10184 * fontset.c (xassert): Remove.
10185 Convert from xassert to eassert.
10186 * alloc.c: Convert from xassert to eassert.
10187 * bidi.c: Likewise.
10188 * dispnew.c: Likewise.
10189 * fns.c: Likewise.
10190 * fringe.c: Likewise.
10191 * ftfont.c: Likewise.
10192 * gtkutil.c: Likewise.
10193 * image.c: Likewise.
10194 * keyboard.c: Likewise.
10195 * menu.c: Likewise.
10196 * process.c: Likewise.
10197 * scroll.c: Likewise.
10198 * sound.c: Likewise.
10199 * term.c: Likewise.
10200 * w32console.c: Likewise.
10201 * w32fns.c: Likewise.
10202 * w32term.c: Likewise.
10203 * window.c: Likewise.
10204 * xdisp.c: Likewise.
10205 * xfaces.c: Likewise.
10206 * xfns.c: Likewise.
10207 * xselect.c: Likewise.
10208 * xterm.c: Likewise.
10209
1ec4b7b2
SM
102102012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10211
10212 * fns.c (maybe_resize_hash_table): Output message when growing the
10213 purify-hashtable.
10214
2014308a
DA
102152012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10216
10217 * alloc.c (allocate_string_data): Remove dead code.
10218 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10219 avoid GCC warning about unused macro.
10220
246155eb
DA
102212012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10222
10223 * alloc.c (allocate_string): Omit intervals initialization.
10224 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10225 as in make_pure_string and make_pure_c_string.
10226
43184b7b
DA
102272012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10228
d209e2fb 10229 * alloc.c (allocate_string): Fix last change.
43184b7b 10230
3fe6dd74
DA
102312012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10232
d209e2fb 10233 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
10234 to memset, add explicit initialization where appropriate.
10235
1ba6038a
GM
102362012-06-27 Glenn Morris <rgm@gnu.org>
10237
10238 * lisp.mk (lisp): Remove paths.elc.
10239
c89926a5
CY
102402012-06-27 Chong Yidong <cyd@gnu.org>
10241
10242 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10243
ed6b3510
JW
102442012-06-26 John Wiegley <johnw@newartisans.com>
10245
1ec4b7b2 10246 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
10247 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10248
ed6b3510
JW
10249 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10250 when building with Clang.
10251
8edd4a2b
SM
102522012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10253
10254 * eval.c (Fapply): Allow calling it with a single argument.
10255
f6f62d1b
EZ
102562012-06-26 Eli Zaretskii <eliz@gnu.org>
10257
10258 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10259 _stricmp and _strnicmp.
10260 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10261
62efea5e
DA
102622012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10263
10264 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10265 allocated window.
10266 (allocate_process): Likewise for new process.
8edd4a2b 10267 (allocate_terminal): Change to use offsetof.
62efea5e
DA
10268 (allocate_frame): Likewise.
10269 * frame.c (make_frame): Omit redundant initialization.
10270 * window.c (make_parent_window): Use memset.
10271 (make_window): Omit redundant initialization.
10272 * process.c (make_process): Omit redundant initialization.
10273 * terminal.c (create_terminal): Likewise.
10274
42997f4d
DA
102752012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10276
10277 * term.c (delete_tty): Remove redundant call to memset.
10278
1130ecfc
DA
102792012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10280
10281 * alloc.c: Remove build_string.
10282 * lisp.h: Define build_string as static inline. This provides
10283 a better opportunity to optimize away calls to strlen when the
10284 function is called with compile-time constant argument.
10285 * image.c (imagemagick_error): Convert to build_string.
10286 * w32proc.c (sys_spawnve): Likewise.
10287 * xterm.c (x_term_init): Likewise.
10288
cf38a720
PE
102892012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10290
99027bdd
PE
10291 Use sprintf return value instead of invoking strlen on result.
10292 In the old days this wasn't portable, since some sprintf
10293 implementations returned char *. But they died out years ago and
10294 Emacs already assumes sprintf returns int.
10295 Similarly for float_to_string.
10296 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10297 * ccl.c (ccl_driver):
10298 * character.c (string_escape_byte8):
10299 * data.c (Fnumber_to_string):
10300 * doprnt.c (doprnt):
10301 * print.c (print_object):
10302 * xdisp.c (message_dolog):
10303 * xfns.c (syms_of_xfns):
10304 Use sprintf or float_to_string result to avoid need to call strlen.
10305 * data.c (Fnumber_to_string):
10306 Use make_unibyte_string, since the string must be ASCII.
10307 * lisp.h, print.c (float_to_string): Now returns int length.
10308 * term.c (produce_glyphless_glyph):
10309 Use sprintf result rather than recomputing it.
10310
cf38a720
PE
10311 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10312 * Makefile.in (ALL_CFLAGS):
10313 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10314 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10315
3511c784
DA
103162012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10317
0a08eb21 10318 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
10319 strcasecmp if available.
10320 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10321
fb7da12e
AS
103222012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10323
10324 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10325 Avoid comma operator.
10326 * menu.c (push_submenu_start, push_submenu_end)
10327 (push_left_right_boundary, push_menu_pane): Likewise.
10328 * msdos.c (dos_rawgetc): Likewise.
10329
afa2ffd8
DA
103302012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10331
10332 * xfns.c (xic_create_fontsetname): Remove redundant calls
10333 to memset.
10334
b3b4476b
PE
103352012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10336
4495ff38
PE
10337 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10338 sprintf already null-terminates its output.
10339
b3b4476b
PE
10340 * xfns.c (x_window): Remove redundant cast.
10341
b00876c9
DA
103422012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10343
10344 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10345 `const char *' to `char *' to avoid compiler warning.
10346
d188e26b
PE
103472012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10348
885d1d74
PE
10349 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10350 instead of truncating it to 63 (admittedly a generous limit).
10351
d188e26b
PE
10352 * process.c: Fix spelling and caps in comments.
10353
e2f560b1
DN
103542012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10355
e86db54b 10356 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
10357 * sysdep.c (setpgrp): Remove definition, not used in this file.
10358
7583a3a1
JB
103592012-06-24 Juanma Barranquero <lekktu@gmail.com>
10360
10361 * makefile.w32-in: Update dependencies.
10362
696056c2
EZ
103632012-06-24 Eli Zaretskii <eliz@gnu.org>
10364
10365 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10366 (SYSTIME_H): Add nt/inc/sys/time.h.
10367
10368 * systime.h [WINDOWSNT]: Include sys/time.h.
10369
10370 * s/ms-w32.h (struct timespec): Definition moved from
10371 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10372
845ca893
PE
103732012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10374
10375 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10376 * buffer.h (buffer_slot_type_mismatch):
10377 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10378 * eval.c (unwind_to_catch):
10379 * image.c (my_png_error, my_error_exit):
10380 * keyboard.c (quit_throw_to_read_char, user_error)
10381 (Fexit_recursive_edit, Fabort_recursive_edit):
10382 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10383 (wrong_type_argument, buffer_overflow, __executable_start)
10384 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10385 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10386 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10387 (fatal):
10388 (child_setup) [!DOS_NT]:
10389 * lread.c (end_of_file_error, invalid_syntax):
10390 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10391 * puresize.h (pure_write_error):
10392 * search.c (matcher_overflow):
10393 * sound.c (sound_perror, alsa_sound_perror):
10394 * sysdep.c, syssignal.h (croak):
10395 * term.c (maybe_fatal, vfatal):
10396 * textprop.c (text_read_only):
10397 * undo.c (user_error):
10398 * unexmacosx.c (unexec_error):
10399 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10400 Use _Noreturn rather than NO_RETURN.
10401 No need for separate decl merely because of _Noreturn.
10402 * sound.c (sound_warning, parse_sound):
10403 Remove unnecessary forward decls.
10404
f1dd8073
PE
104052012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10406
10407 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10408 * lisp.h (WAIT_READING_MAX): New macro.
10409 * dispnew.c (Fsleep_for, sit_for):
10410 * keyboard.c (kbd_buffer_get_event):
10411 * process.c (Faccept_process_output):
10412 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10413 This improves on the previous patch, which introduced a bug
10414 when time_t is unsigned and as wide as intmax_t.
10415 See <http://bugs.gnu.org/9000#51>.
10416
b82c1755
EZ
104172012-06-23 Eli Zaretskii <eliz@gnu.org>
10418
10419 * dispnew.c (sit_for, Fsleep_for):
10420 * keyboard.c (kbd_buffer_get_event):
10421 * process.c (Faccept_process_output): Avoid compiler warnings when
10422 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10423
ca300656
JB
104242012-06-23 Juanma Barranquero <lekktu@gmail.com>
10425
049ec95b
JB
10426 * makefile.w32-in: Update dependencies.
10427
ca300656
JB
10428 * w32.c (ltime): Add return type and declare static.
10429 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10430
db7b8d06
PE
104312012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10432
10433 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10434 Privately reported by Herbert J. Skuhra.
10435 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10436 All uses changed.
10437 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10438 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10439
0bd8297f
EZ
104402012-06-23 Eli Zaretskii <eliz@gnu.org>
10441
96512555
EZ
10442 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10443 last argument of make_unibyte_string.
10444
0bd8297f
EZ
10445 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10446 language ID in the event parameters.
10447
10448 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10449 event.code, not the obscure "character set ID".
10450
63def6b6
CY
104512012-06-23 Chong Yidong <cyd@gnu.org>
10452
10453 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10454
e8a02204
EZ
104552012-06-23 Eli Zaretskii <eliz@gnu.org>
10456
388cdec0
EZ
10457 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10458 * w32.c (fdutimens): New function.
10459
10460 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10461
10462 * s/ms-w32.h (pselect): Redirect to sys_select.
10463
10464 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10465
e8a02204
EZ
10466 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10467 in the logic of incrementing and decrementing the value of
10468 use_relocatable_buffers.
10469
d054f3fb
PE
104702012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10471
10472 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10473 Privately reported by Herbert J. Skuhra.
10474 [__FreeBSD__]: Remove "*/" typo after "#include".
10475 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10476 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10477 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10478 Don't assume EMACS_TIME and struct timeval are the same type.
10479
d35af63c
PE
104802012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10481
10482 Support higher-resolution time stamps (Bug#9000).
10483 The time stamps are only nanosecond-resolution at the C level,
10484 since that's the best that any real-world system supports now.
10485 But they are picosecond-resolution at the Lisp level, as that's
10486 easy, and leaves room for future OS improvements.
10487
10488 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10489 (LIBES): Use it.
10490
10491 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10492 Don't get current time unless it's needed.
10493
10494 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10495 now provides it if it's absent.
10496 (start_atimer): Port to higher-res time stamps.
10497 Check for time stamp overflow. Don't get current time more
10498 often than is needed.
10499
10500 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10501 Include systime.h, not time.h.
10502 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10503
10504 * dired.c: Include stat-time.h.
10505 (Ffile-attributes): File times now have higher resolution.
10506
10507 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10508 (struct image): Timestamp now has higher resolution.
10509
10510 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10511 has at least microseconds now. All uses removed.
10512 (update_frame, update_single_window, update_window, update_frame_1)
10513 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 10514 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
10515
10516 * editfns.c (time_overflow): Now extern.
10517 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10518 (float-time, Fformat_time_string, Fcurrent_time_string)
10519 (Fcurrent_time_zone): Accept and generate higher-resolution
10520 time stamps.
10521 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10522 (decode_time_components, lisp_seconds_argument): New functions.
10523 (make_time): Now static.
10524 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10525 Report an error if the time is invalid, rather than having the caller
10526 do that.
10527
10528 * fileio.c: Include <stat-time.h>
10529 (Fcopy_file): Copy higher-resolution time stamps.
10530 Prefer to set the time stamp via a file descriptor if that works.
10531 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10532 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10533 (Fvisited_file_modtime, Fset_visited_file_modtime):
10534 Support higher-resolution time stamps.
10535
10536 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10537
10538 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10539
10540 * image.c (prepare_image_for_display, clear_image_cache)
10541 (lookup_image): Port to higer-resolution time stamps.
10542
10543 * keyboard.c (start_polling, bind_polling_period):
10544 Check for time stamp overflow.
10545 (read_char, kbd_buffer_get_event, timer_start_idle)
10546 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10547 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10548 Port to higher-resolution time stamps. Do not assume time_t is signed.
10549 (decode_timer): New function. Timers are now vectors of length 9,
10550 not 8, to accommodate the picosecond component.
10551 (timer_check_2): Use it.
10552
10553 * nsterm.m (select_timeout, timeval_subtract): Remove.
10554 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10555 as they're a bit more accurate and handle overflow better.
10556 (ns_select): Change prototype to be compatible with pselect.
10557 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10558 * nsterm.h (ns_select): Adjust prototype.
10559
10560 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10561 us-resolution time stamps.
10562 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10563
10564 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10565
10566 * lisp.h (time_overflow): New decl.
10567 (wait_reading_process_output): First arg is now intmax_t, not int,
10568 to accommodate larger waits.
10569
10570 * process.h (struct Lisp_Process.read_output_delay):
10571 Now counts nanoseconds, not microseconds.
10572 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10573 EMACS_HAS_USECS.
10574 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10575 (wait_reading_process_output):
10576 Port to ns-resolution time stamps.
10577 (Faccept_process_output, wait_reading_process_output):
10578 Check for time stamp overflow. Do not assume time_t is signed.
10579 (select_wrapper): Remove; we now use pselect.
10580 (Fprocess_attributes): Now generates ns-resolution time stamps.
10581
10582 * sysdep.c: Include utimens.h. Don't include utime.h
10583 or worry about struct utimbuf; gnulib does that for us now.
10584 (gettimeofday): Remove; gnulib provides a substitute.
10585 (make_timeval): New function.
10586 (set_file_times): Now sets ns-resolution time stamps.
10587 New arg FD; all uses changed.
10588 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10589 (system_process_attributes):
10590 Now returns ns-resolution time stamp. All uses changed.
10591 Check for time stamp overflow.
10592
10593 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10594 provides a substitute now.
10595
10596 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10597 since it guarantees struct timespec.
10598 (EMACS_TIME): Now struct timespec, so that we can support
10599 ns-resolution time stamps.
10600 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10601 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10602 (EMACS_USECS): Remove.
10603 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10604 so multiply the arg by 1000 before storing it.
10605 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10606 New macros.
10607 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10608 Port to ns-resolution time stamps.
10609 (EMACS_TIME_NEG_P): Remove; replaced by....
10610 (EMACS_TIME_SIGN): New macro.
10611 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10612 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10613 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10614 (make_timeval, make_lisp_time, decode_time_components): New decls.
10615 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10616 that it mishandled time_t overflow. You can't compare by subtracting!
10617 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10618 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10619
10620 * term.c: Include <sys/time.h>.
10621 (timeval_to_Time): New function, for proper overflow wraparound.
10622 (term_mouse_position, term_mouse_click): Use it.
10623
10624 * undo.c (record_first_change): Support higher-resolution time stamps
10625 in the undo buffer.
10626 (Fprimitive_undo): Use them when restoring time stamps.
10627
10628 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10629 (w32_get_internal_run_time):
10630 Port to higher-resolution Emacs time stamps.
10631 (ltime): Now accepts single 64-bit integer, as that's more convenient
10632 for callers.
10633
10634 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10635
10636 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10637 for compatibility with pselect. Support ns-resolution time stamps.
10638
10639 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10640
10641 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10642 Check for time stamp overflow, and support ns-resolution time stamps.
10643
10644 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10645 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10646 (timeval_subtract): Remove; no longer needed.
10647 (XTflash, XTring_bell, x_wait_for_event):
10648 Port to ns-resolution time stamps. Don't assume time_t is signed.
10649
b6a92dfe
CY
106502012-06-22 Chong Yidong <cyd@gnu.org>
10651
10652 * xdisp.c (x_consider_frame_title): Revert last change.
10653
d251c37c
EZ
106542012-06-22 Eli Zaretskii <eliz@gnu.org>
10655
10656 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10657 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10658 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10659 staticidx goes up to 1597 out of 1600 = 0x640.)
10660
f10deafb
PE
106612012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10662
10663 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10664 Otherwise, the umask might be mistakenly 0 while handling input signals.
10665
ec6de1e2
SM
106662012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10667
10668 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10669
28be1ada
DA
106702012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10671
10672 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10673 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10674 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10675 access to `contents' member of Lisp_Vector objects with AREF and ASET
10676 where appropriate.
10677
c6bf3022
CY
106782012-06-19 Chong Yidong <cyd@gnu.org>
10679
10680 * frame.c (delete_frame): When selecting a frame on a different
10681 text terminal, do not alter the terminal's top-frame.
10682
10683 * xdisp.c (format_mode_line_unwind_data): Record the target
10684 frame's selected window and its terminal's top-frame.
10685 (unwind_format_mode_line): Restore them.
10686 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10687 Callers changed.
10688 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
10689 since tty frames can be explicitly named.
10690 (prepare_menu_bars): Likewise.
10691
10692 * term.c (Ftty_top_frame): New function.
10693
defd4196
PE
106942012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10695
10696 Port byte-code-meter to modern targets.
10697 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
10698 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 10699 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
10700 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
10701 (METER_1, METER_2): Simplify.
10702
1053a871
SM
107032012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10704
10705 * data.c (Fdefalias): Return `symbol' (bug#11686).
10706
b7e8d081
MR
107072012-06-18 Martin Rudalics <rudalics@gmx.at>
10708
10709 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
10710 gets killed during executing of this function (Bug#11665).
10711 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
10712 (Vkill_buffer_query_functions): In doc-string say that functions
10713 run by this hook should not change the current buffer.
10714
7ea2b339
PE
107152012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10716
10717 Fix recently-introduced process.c problems found by static checking.
10718 * process.c (write_queue_push, write_queue_pop, send_process):
10719 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
10720 (write_queue_pop): Fix pointer signedness problem.
10721 (send_process): Remove unused local.
10722
96a313a1
CY
107232012-06-17 Chong Yidong <cyd@gnu.org>
10724
10725 * xdisp.c (redisplay_internal): No need to redisplay terminal
10726 frames that are not on top.
10727
20ca2e94
TN
107282012-06-17 Troels Nielsen <bn.troels@gmail.com>
10729
10730 * process.c (make_process): Initialize write_queue.
10731 (write_queue_push, write_queue_pop): New functions.
10732 (send_process): Use them to maintain correct ordering of process
10733 writes (Bug#10815).
10734
9a900ca9
PE
107352012-06-17 Paul Eggert <eggert@cs.ucla.edu>
10736
310fbfa8
PE
10737 * lisp.h (eassert): Assume C89 or later.
10738 This removes the need for CHECK.
10739 (CHECK): Remove. Its comments about always evaluating its
10740 argument were confusing, as 'eassert' typically does not evaluate
10741 its argument.
10742
27bb1ca4
PE
10743 * coding.c (produce_chars): Use ptrdiff_t, not int.
10744
9a900ca9
PE
10745 * xterm.c (x_draw_underwave): Check for integer overflow.
10746 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
10747
41b7f8bc 107482012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
10749
10750 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
10751 referenced (Bug#11583).
10752
9b0e3eba
AA
107532012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
10754
10755 Implement wave-style variant of underlining.
10756 * dispextern.h (face_underline_type): New enum.
10757 (face): Add field for underline type.
10758 * nsterm.m (ns_draw_underwave): New function.
10759 (ns_draw_text_decoration): Use it.
10760 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
10761 New functions.
10762 (x_draw_glyph_string): Use them.
10763 * xfaces.c (Qline, Qwave): New Lisp objects.
10764 (check_lface_attrs, merge_face_ref)
1053a871
SM
10765 (Finternal_set_lisp_face_attribute, realize_x_face):
10766 Handle wave-style underline face attributes.
9b0e3eba
AA
10767 * xterm.c (x_draw_underwave): New function.
10768 (x_draw_glyph_string): Use it.
10769
0fb52f11
JB
107702012-06-16 Juanma Barranquero <lekktu@gmail.com>
10771
10772 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10773 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10774 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10775 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10776 ($(BLD)/w32select.$(O)): Update dependencies.
10777
e5560ff7
AS
107782012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10779
10780 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10781 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10782 * character.c (_fetch_multibyte_char_p): Remove.
10783 * alloc.c: Include "character.h" before "buffer.h".
10784 * bidi.c: Likewise.
10785 * buffer.c: Likewise.
10786 * bytecode.c: Likewise.
10787 * callint.c: Likewise.
10788 * callproc.c: Likewise.
10789 * casefiddle.c: Likewise.
10790 * casetab.c: Likewise.
10791 * category.c: Likewise.
10792 * cmds.c: Likewise.
10793 * coding.c: Likewise.
10794 * composite.c: Likewise.
10795 * dired.c: Likewise.
10796 * dispnew.c: Likewise.
10797 * doc.c: Likewise.
10798 * dosfns.c: Likewise.
10799 * editfns.c: Likewise.
10800 * emacs.c: Likewise.
10801 * fileio.c: Likewise.
10802 * filelock.c: Likewise.
10803 * font.c: Likewise.
10804 * fontset.c: Likewise.
10805 * fringe.c: Likewise.
10806 * indent.c: Likewise.
10807 * insdel.c: Likewise.
10808 * intervals.c: Likewise.
10809 * keyboard.c: Likewise.
10810 * keymap.c: Likewise.
10811 * lread.c: Likewise.
10812 * macros.c: Likewise.
10813 * marker.c: Likewise.
10814 * minibuf.c: Likewise.
10815 * nsfns.m: Likewise.
10816 * nsmenu.m: Likewise.
10817 * print.c: Likewise.
10818 * process.c: Likewise.
10819 * regex.c: Likewise.
10820 * region-cache.c: Likewise.
10821 * search.c: Likewise.
10822 * syntax.c: Likewise.
10823 * term.c: Likewise.
10824 * textprop.c: Likewise.
10825 * undo.c: Likewise.
10826 * unexsol.c: Likewise.
10827 * w16select.c: Likewise.
10828 * w32fns.c: Likewise.
10829 * w32menu.c: Likewise.
10830 * window.c: Likewise.
10831 * xdisp.c: Likewise.
10832 * xfns.c: Likewise.
10833 * xmenu.c: Likewise.
10834 * xml.c: Likewise.
10835 * xselect.c: Likewise.
10836
2f07e6af
EZ
108372012-06-16 Eli Zaretskii <eliz@gnu.org>
10838
1053a871
SM
10839 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
10840 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 10841 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
10842 row.
10843 (handle_face_prop): Use chunk-relative overlay string index when
10844 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
10845 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
10846 the rightmost. (Bug#11720)
2f07e6af 10847
29b83cec
AS
108482012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10849
10850 * category.h (CHAR_HAS_CATEGORY): Define as inline.
10851 (CATEGORY_MEMBER): Enforce 1/0 value.
10852 * category.c (_temp_category_set): Remove.
10853
4c5501e9
EZ
108542012-06-16 Eli Zaretskii <eliz@gnu.org>
10855
10856 * window.c (Fdelete_other_windows_internal)
10857 (Fdelete_window_internal): Don't access frame's mouse highlight
10858 info of the initial frame. (Bug#11677)
10859
2b570124
PE
108602012-06-14 Paul Eggert <eggert@cs.ucla.edu>
10861
e93864f9
PE
10862 * .gdbinit (xgetint): Fix recently-introduced paren typo.
10863 Assume USE_2_TAGS_FOR_INTS.
10864 (xreload): Adjust $tagmask width to match recent lisp.h change.
10865
2b570124
PE
10866 Simplify lisp.h in minor ways that should not affect code.
10867 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
10868 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
10869 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
10870 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
10871 (INTTYPEBITS): New macro, for clarity.
10872 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
10873 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
10874 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
10875 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
10876 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
10877
81755f69
JB
108782012-06-13 Juanma Barranquero <lekktu@gmail.com>
10879
10880 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
10881
16192a57
GM
108822012-06-13 Glenn Morris <rgm@gnu.org>
10883
10884 * s/bsd-common.h (BSD4_3):
10885 * s/usg5-4-common.h (USG5_4): No longer define; unused.
10886
646b5f55
AS
108872012-06-13 Andreas Schwab <schwab@linux-m68k.org>
10888
10889 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
10890 instead of union.
10891 (XLI, XIL): Define.
1053a871
SM
10892 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
10893 Use them.
10894 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 10895 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 10896 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
10897 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
10898 * frame.c (delete_frame): Remove outdated comment.
10899 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
10900 USE_LISP_UNION_TYPE.
10901 (Fw32_unregister_hot_key): Likewise.
10902 (Fw32_toggle_lock_key): Likewise.
10903 * w32menu.c (add_menu_item): Likewise.
10904 (w32_menu_display_help): Use XIL instead of checking
10905 USE_LISP_UNION_TYPE.
10906 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
10907 (init_heap): Likewise.
10908 * w32term.c (w32_read_socket): Update comment.
10909
1d3823c9
GM
109102012-06-13 Glenn Morris <rgm@gnu.org>
10911
c62ff706
GM
10912 * s/usg5-4-common.h, src/s/unixware.h:
10913 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
10914
1d3823c9
GM
10915 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
10916
bfe3e0a2
PE
109172012-06-13 Paul Eggert <eggert@cs.ucla.edu>
10918
10919 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
10920 * alloc.c (make_number) [!defined make_number]:
10921 Remove, as lisp.h always defines this now.
10922 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
10923 (roundup_size): Verify that it is a power of 2.
10924 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
10925 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
10926 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
10927 -DUSE_LSB_TAG=0, to override the automatically-selected default.
10928 USE_LSB_TAG now is always defined to be either 0 or 1.
10929 All uses changed.
10930 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
10931 code works fine either way, and efficiency is not a concern here,
10932 as the union type is for debugging, not for production.
10933 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
10934 Use an inline function on all platforms when using the union type,
10935 since this is simpler and 'static inline' can be used portably
10936 within Emacs now.
10937 (LISP_INITIALLY_ZERO): New macro.
10938 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
10939 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
10940
45fa9c0f
GM
109412012-06-12 Glenn Morris <rgm@gnu.org>
10942
b4492cba
GM
10943 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
10944
10945 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 10946
45fa9c0f
GM
10947 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
10948 Move BROKEN_SIGIO to configure.
10949
10950 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
10951 Move NO_TERMIO to configure.
10952
0e25d334
CY
109532012-06-12 Chong Yidong <cyd@gnu.org>
10954
10955 * image.c (imagemagick_load_image): Use MagickFlattenImage if
10956 MagickMergeImageLayers is undefined. Use pixel pusher loop if
10957 MagickExportImagePixels is undefined.
10958
43682bb6
PE
109592012-06-12 Paul Eggert <eggert@cs.ucla.edu>
10960
10961 * image.c (imagemagick_load_image): Remove unused label.
10962
a9be7d2b
GM
109632012-06-11 Glenn Morris <rgm@gnu.org>
10964
10965 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10966 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
10967 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
10968 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
10969
3017f87f
SM
109702012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
10971
10972 * alloc.c (make_byte_code): New function.
10973 (Fmake_byte_code): Use it. Don't purify here.
10974 * lread.c (read1): Use it as well to avoid extra allocation.
10975
1b9b4cf4
CY
109762012-06-11 Chong Yidong <cyd@gnu.org>
10977
10978 * image.c (imagemagick_load_image): Implement transparency.
10979
95988fcf
AS
109802012-06-10 Andreas Schwab <schwab@linux-m68k.org>
10981
10982 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
10983 account for preceding backslashes. (Bug#11663)
10984
cd4eb164
CY
109852012-06-09 Chong Yidong <cyd@gnu.org>
10986
10987 * term.c: Support italics in capable terminals (Bug#9652).
10988 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
10989 (turn_on_face): Output using TS_enter_italic_mode if available.
10990 Don't handle unused blinking and alt-charset cases.
10991 (turn_off_face): Handle italic case; discard unused tty_blinking_p
10992 and tty_alt_charset_p cases.
10993 (tty_capable_p, init_tty): Support italics.
10994
10995 * termchar.h (struct tty_display_info): Add field for italics.
10996 Remove unused blink field.
10997
10998 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
10999 Handle slant.
11000
11001 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11002 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11003 tty_alt_charset_p. Add tty_italic_p.
11004
ff88beb8
MA
110052012-06-09 Michael Albinus <michael.albinus@gmx.de>
11006
11007 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11008 dbus_type_is_basic if available.
11009 (xd_extract_signed, xd_extract_unsigned): Rename from
11010 extract_signed and extract_unsigned, respectively. Adapt callers.
11011
44286096
CY
110122012-06-09 Chong Yidong <cyd@gnu.org>
11013
1682701f
CY
11014 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11015
44286096
CY
11016 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11017 case (Bug#9752).
11018
d86feb17
PE
110192012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11020
11021 * xdisp.c (vmessage): Treat frame message as multibyte.
11022 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11023 would generate the diagnostic "Making \302\247 buffer-local while
11024 let-bound!".
11025
d5c20fe8
EZ
110262012-06-08 Eli Zaretskii <eliz@gnu.org>
11027
11028 * dispnew.c (showing_window_margins_p): Undo last change, which
11029 was done due to an inadvertent commit.
11030 (adjust_frame_glyphs_for_frame_redisplay): Do call
11031 showing_window_margins_p.
11032
513749ee
SM
110332012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11034
11035 * eval.c (Fmake_var_non_special): New primitive.
11036 (syms_of_eval): Defsubr it.
11037 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11038
d4a8f5c1
JB
110392012-06-08 Juanma Barranquero <lekktu@gmail.com>
11040
11041 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11042 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11043
8bbbc977
EZ
110442012-06-08 Eli Zaretskii <eliz@gnu.org>
11045
11046 * alloc.c (allocate_vectorlike): Fix last change.
11047
f3372c87
DA
110482012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11049
11050 Block-based vector allocation of small vectors.
11051 * lisp.h (struct vectorlike_header): New field `nbytes',
11052 adjust comment accordingly.
11053 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 11054 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
11055 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11056 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11057 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11058 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11059 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11060 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11061 (roundup_size): New constant.
11062 (struct vector_block): New data type.
11063 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 11064 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
11065 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11066 (sweep_vectors): New functions.
11067 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 11068 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
11069 or equal to VBLOCK_BYTES_MAX.
11070 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11071 (init_alloc_once): Add call to init_vectors.
11072
4f18a4ed
SM
110732012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11074
11075 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11076
86f158bc
PE
110772012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11078
11079 * doprnt.c (doprnt): Truncate multibyte char correctly.
11080 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11081 would mishandle a string argument "Xc" if X was a multibyte
11082 character of length 2: it would truncate after X's first byte
11083 rather than including all of X.
11084
c5cfcbe0
CY
110852012-06-06 Chong Yidong <cyd@gnu.org>
11086
11087 * buffer.c (word_wrap): Doc fix.
11088
c05cf390
PE
110892012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11090
11091 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11092
0c3461de
GM
110932012-06-03 Glenn Morris <rgm@gnu.org>
11094
11095 * xdisp.c (tool-bar-style): Doc fix.
11096
c71232db
UM
110972012-06-03 Ulrich Müller <ulm@gentoo.org>
11098
11099 * Makefile.in (PAXCTL): Define.
11100 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11101 binary via PaX flags if the paxctl utility is available.
11102 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11103 Restore PaX flags to their default. (Bug#11398)
11104
383f7350
CY
111052012-06-03 Chong Yidong <cyd@gnu.org>
11106
11107 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11108 buffer (Bug#11226).
11109
5f2c76c6
CY
111102012-06-03 Chong Yidong <cyd@gnu.org>
11111
11112 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11113 (note_mode_line_or_margin_highlight): If there is no help echo,
11114 use mode-line-default-help-echo. Handle the case where the mouse
11115 position is past the end of the mode line string.
11116
11117 * buffer.c (buffer_local_value_1): New function, split from
11118 Fbuffer_local_value; can return Qunbound.
11119 (Fbuffer_local_value): Use it.
11120 (Vmode_line_format): Docstring tweaks.
11121
773d47f6
PE
111222012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11123
11124 * sysdep.c (system_process_attributes): Improve comment.
11125
f2d6a3df
SM
111262012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11127
11128 * keyboard.c: Export real-this-command to Elisp.
11129 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11130 and DEFVAR it. Update all users.
11131
63810350
PE
111322012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11133
7bd5c1f4
PE
11134 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11135
63810350
PE
11136 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11137 Convert pctcpu and pctmem to Lisp float properly.
11138 Let the compiler fold better, as 100.0/0x8000 is exact.
11139
a2821611
AS
111402012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11141
11142 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11143 cons_block.
11144
5fceba1d
PE
111452012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11146
11147 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11148
c98ff5dd
DA
111492012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11150
11151 For a 'struct window', replace some Lisp_Object fields to
11152 bitfields where appropriate, remove unused fields.
11153 * window.h (struct window): Remove unused 'last_mark_x' and
11154 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 11155 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
11156 Change type of 'force_start', 'optional_new_start',
11157 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 11158 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 11159
ca34e0be
PE
111602012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11161
11162 Pacify gcc -Wdouble-precision when using Xaw.
11163 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11164 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11165 Use 'float' consistently, rather than 'float' in most places
11166 and 'double' in a couple of places.
11167
efc00ab1 111682012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
11169
11170 * xdisp.c (handle_stop): Detect whether we have overlay strings
11171 loaded by testing it->current.overlay_string_index to be
11172 non-negative, instead of checking whether n_overlay_strings is
11173 positive. (Bug#11587)
11174
efc00ab1 111752012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
11176
11177 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11178
11179 * doc.c (Fsubstitute_command_keys): Doc fix.
11180
efc00ab1 111812012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
11182
11183 * search.c (search_buffer): Remove calls to
11184 r_alloc_inhibit_buffer_relocation, as it is now called by
11185 maybe_unify_char, which was the cause of relocation of buffer text
11186 in bug#11519.
11187
efc00ab1 111882012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
11189
11190 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11191 for the duration of call to load_charset, to avoid problems with
11192 callers of maybe_unify_char that access buffer text through C
11193 pointers.
11194
11195 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11196 decrement the inhibition flag, instead of just setting or
11197 resetting it.
11198
ba93a187
PE
111992012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11200
11201 Remove obsolete '#define static' cruft.
11202 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11203 This #undef was "temporary" in 2000; it is no longer needed
11204 now that '#define static' has gone away.
11205 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11206 (gray_bitmap_bits): Remove; no longer needed.
11207 All uses replaced with definiens.
11208 * xterm.c: Include "bitmaps/gray.xbm".
11209
9e4bf381
PE
112102012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11211
11212 Clean up __executable_start, monstartup when --enable-profiling.
11213 The following changes affect the code only when profiling.
11214 * dispnew.c (__executable_start): Rename from safe_bcopy.
11215 Define only on platforms that need it.
11216 * emacs.c: Include <sys/gmon.h> when profiling.
11217 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11218 (__executable_start): Remove decl, since lisp.h does it now.
11219 (safe_bcopy): Remove decl; no longer has that name.
11220 (main): Coalesce #if into single bit of code, for simplicity.
11221 Cast pointers to uintptr_t, since standard libraries want integers
11222 and not pointers.
11223 * lisp.h (__executable_start): New decl.
11224
32d72c2f
GM
112252012-05-31 Glenn Morris <rgm@gnu.org>
11226
11227 * image.c (Fimagemagick_types): Doc fix.
11228
baac5bc7
JM
112292012-05-30 Jim Meyering <meyering@redhat.com>
11230
11231 * callproc.c (Fcall_process_region): Include directory component
11232 in mkstemp error message (Bug#11586).
11233
72cb32cf
PE
112342012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11235
11236 * alloc.c, lisp.h (make_pure_vector): Now static.
11237
61b108cc
SM
112382012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11239
11240 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11241 Move to byte-run.el.
11242 (Fautoload): Do the hash-doc more carefully.
11243 * data.c (Fdefalias): Purify definition, except for keymaps.
11244 (Qdefun): Move from eval.c.
11245 * lisp.h (Qdefun): Remove.
11246 * lread.c (read1): Tiny simplification.
11247
471fe23d
TN
112482012-05-29 Troels Nielsen <bn.troels@gmail.com>
11249
934f3f58 11250 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
11251 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11252 Bug#9642, but explicitly check that the buffer the overlay would
11253 be moved to is live and rearrange lines to make sure that errors
11254 will not put the overlay in an inconsistent state.
11255 (Fdelete_overlay): Cosmetics.
11256
85d0efd1
EZ
112572012-05-28 Eli Zaretskii <eliz@gnu.org>
11258
11259 * w32term.c (my_bring_window_to_top): New function.
11260 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
11261 could be different from the original one.
11262 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
11263 (Bug#11513)
11264
11265 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11266 by calling BringWindowToTop.
11267
11268 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11269 (WM_EMACS_END): Increase by one.
11270
da92a98c
PE
112712012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11272
11273 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11274 This avoids undefined behavior that might cause the eassert
11275 to not catch an out-of-range value.
11276
74d1f848
JB
112772012-05-28 Juanma Barranquero <lekktu@gmail.com>
11278
11279 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11280 Update dependencies.
11281
9e1a06fc
EZ
112822012-05-27 Eli Zaretskii <eliz@gnu.org>
11283
11284 * bidi.c (bidi_mirror_char): Fix last change.
11285
f3dd7312
AS
112862012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11287
11288 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11289 when referring to sectname field in printf format.
11290
81899c91
PE
112912012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11292
57b81a9f
PE
11293 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11294 Only r_alloc_inhibit_buffer_relocation needed to be added;
11295 the others were already declared.
11296
81899c91
PE
11297 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11298 before checking whether it's out of range. Put the check inside
11299 eassert. See
11300 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11301
33017faf 113022012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
11303
11304 * callproc.c (Fcall_process): Restore a line that was accidentally
11305 commented out in the 2011-02-13 change (bug#11547).
11306
33017faf 113072012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
11308
11309 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11310 defined on ralloc.c.
11311
11312 * buffer.c [REL_ALLOC]: Remove prototypes of
11313 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11314 they are now on lisp.h.
11315
11316 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11317
11318 * search.c (search_buffer): Use it to inhibit relocation of buffer
11319 text while re_search_2 is doing its job, because re_search_2 is
11320 passed C pointers to buffer text. (Bug#11519)
11321
23415acf
EZ
11322 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11323 Update value to 24.
11324
44e27368
EZ
11325 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11326 state after an additional call to move_it_in_display_line_to, keep
11327 the values of it->max_ascent and it->max_descent found for the
11328 entire line.
11329 (pos_visible_p): Revert the comparison against bottom_y to what it
11330 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11331 (Bug#11464)
11332
c1892f11
PE
113332012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11334
11335 Fix coding-related core dumps with gcc -ftrapv.
11336 The code was computing A - B, where A and B are pointers, and B is
11337 random garbage. This can lead to core dumps on platforms that
11338 have special pointer registers, and it also leads to core dumps on
11339 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11340 A - B only when B is initialized properly.
11341 * coding.c (coding_set_source, coding_set_destination): Return void.
11342 (coding_change_source, coding_change_destinations): New functions,
11343 with the old behaviors of coding_set_source and coding_set_destination.
11344 All callers that need an offset changed to use these new functions.
11345
eb7afdad
GM
113462012-05-26 Glenn Morris <rgm@gnu.org>
11347
11348 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11349
f12fdf02
EZ
113502012-05-26 Eli Zaretskii <eliz@gnu.org>
11351
53a63be6 11352 Extend mouse support on W32 text-mode console.
61b108cc
SM
11353 * xdisp.c (draw_row_with_mouse_face):
11354 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 11355
eb3f6f01 11356 * w32console.c: Include window.h.
61b108cc
SM
11357 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11358 New functions.
eb3f6f01
EZ
11359 (initialize_w32_display): Initialize mouse-highlight data.
11360
53a63be6
EZ
11361 * w32inevt.c: Include termchar.h and window.h.
11362 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11363 moves, call note_mouse_highlight. If help_echo changed, call
11364 gen_help_event to produce help-echo message in the echo area.
11365 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11366 highlight info.
11367
4cfd81f6
PE
113682012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11369
11370 * lread.c (read1): Simplify slightly to avoid an overflow warning
11371 with GCC 4.7.0 on x86-64.
11372
4446092a
EZ
113732012-05-26 Eli Zaretskii <eliz@gnu.org>
11374
11375 * bidi.c (bidi_mirror_char): Revert last change: an int is
11376 definitely wide enough here.
11377
42b2a986 113782012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 11379
42b2a986 11380 Fix integer width and related bugs (Bug#9874).
eb106a49 11381 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
11382 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11383 (string_bytes, check_sblock, allocate_string_data):
11384 (compact_small_strings, Fmake_bool_vector, make_string)
11385 (make_unibyte_string, make_multibyte_string)
11386 (make_string_from_bytes, make_specified_string)
11387 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11388 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11389 (mark_vectorlike):
11390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11391 (allocate_pseudovector):
11392 Use int, not EMACS_INT, where int is wide enough.
11393 (inhibit_garbage_collection, Fgarbage_collect):
11394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11395 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11396 int might not be wide enough.
11397 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11398 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11399 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11400 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11401 (bidi_level_of_next_char, bidi_move_to_visually_next):
11402 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11403 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11404 (Fkill_buffer, Fset_buffer_major_mode)
11405 (advance_to_char_boundary, Fbuffer_swap_text)
11406 (Fset_buffer_multibyte, overlays_at, overlays_in)
11407 (overlay_touches_p, struct sortvec, record_overlay_string)
11408 (overlay_strings, recenter_overlay_lists)
11409 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11410 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11411 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11412 (Foverlay_recenter, last_overlay_modification_hooks_used)
11413 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11414 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
11415 (validate_region): Omit unnecessary test for b <= e,
11416 since that's guaranteed by the previous test.
d311d28c
PE
11417 (adjust_overlays_for_delete): Avoid pos + length overflow.
11418 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11419 (report_overlay_modification):
11420 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11421 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11422 Omit pointer cast, which isn't needed anyway, and doesn't work
11423 after the EMACS_INT -> ptrdiff_t change.
02481186 11424 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
11425 * buffer.h: Adjust decls to match defn changes elsewhere.
11426 (struct buffer_text, struct buffer):
11427 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11428 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
11429 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11430 not int, to avoid needless 32-bit limit on 64-bit hosts.
11431 (exec_byte_code): Use tighter memory-full test, one that checks
11432 for alloca overflow. Don't compute the address of the object just
11433 before an array, as that's not portable. Use EMACS_INT, not
11434 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
11435 * callint.c (Fcall_interactively):
11436 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11437 * callproc.c (call_process_kill, Fcall_process):
11438 Don't assume pid_t fits into an Emacs fixnum.
11439 (call_process_cleanup, Fcall_process, child_setup):
11440 Don't assume pid_t fits into int.
11441 (call_process_cleanup, Fcall_process, delete_temp_file)
11442 (Fcall_process_region):
11443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11444 (Fcall_process): Simplify handling of volatile integers.
11445 Use int, not EMACS_INT, where int will do.
11446 * casefiddle.c (casify_object, casify_region, operate_on_word)
11447 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11448 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11449 (casify_object): Avoid integer overflow when overallocating buffer.
11450 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 11451 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
11452 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11453 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11454 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11455 integers are now checked earlier. All uses replaced with XINT.
11456 (ccl_driver):
11457 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11458 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
11459 (ccl_driver, Fregister_code_conversion_map):
11460 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
11461 (resolve_symbol_ccl_program): Check that vector header is in range.
11462 Always copy the vector, so that we can check its contents reliably
11463 now rather than having to recheck each instruction as it's being
11464 executed. Check that vector words fit in 'int'.
11465 (ccl_get_compiled_code, Fregister_ccl_program)
11466 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11467 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11468 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11469 contents are in range.
11470 (Fccl_execute_on_string): Check that status is in range.
11471 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11472 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11473 Accept and return EMACS_INT, not int, because callers can pass values
11474 out of 'int' range.
11475 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11476 (multibyte_chars_in_text, parse_str_as_multibyte)
11477 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11478 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11479 (string_escape_byte8, Fget_byte):
11480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 11481 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
11482 avoid mishandling large integers.
11483 * character.h: Adjust decls to match defn changes elsewhere.
11484 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11485 (Ffind_charset_region):
11486 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11487 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11488 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 11489 Don't assume fixnum fits in int.
d311d28c
PE
11490 (load_charset_map_from_vector, Fmap_charset_chars):
11491 Remove now-unnecessary CHECK_NATNUMs.
11492 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
11493 Don't rely on undefined behavior with signed left shift overflow.
11494 Don't assume unsigned int fits into fixnum, or that fixnum fits
11495 into unsigned int. Don't require max_code to be a valid fixnum;
11496 that's not true for gb10830 4-byte on a 32-bit host. Allow
11497 invalid_code to be a cons, for the same reason. Require code_offset
11498 to be a character. Avoid int overflow if max_char is close
11499 to INT_MAX.
11500 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11501 this is intended anyway and avoids some undefined behavior.
11502 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11503 INDEX_TO_CODE_POINT, as that's what it expects.
11504 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
11505 * charset.h (DECODE_CHAR): Return int, not unsigned;
11506 this is what was intended anyway, and it avoids undefined behavior.
11507 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11508 integer-overflow issues.
11509 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11510 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11511 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
11512 * chartab.c (Fmake_char_table, Fset_char_table_range)
11513 (uniprop_get_decoder, uniprop_get_encoder):
11514 Don't assume fixnum fits in int.
11515 * cmds.c (move_point): New function, that does the gist of
11516 Fforward_char and Fbackward_char, but does so while checking
11517 for integer overflow more accurately.
c96e5d6a 11518 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
11519 (Fforward_line, Fend_of_line, internal_self_insert)
11520 (internal_self_insert):
11521 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11522 Fix a FIXME, by checking for integer overflow when calculating
11523 target_clm and actual_clm.
11524 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 11525 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
11526 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11527 (coding_alloc_by_making_gap, alloc_destination)
11528 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11529 (encode_coding_utf_16, detect_coding_emacs_mule)
11530 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11531 (detect_coding_iso_2022, decode_coding_iso_2022)
11532 (encode_invocation_designation, encode_designation_at_bol)
11533 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11534 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11535 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11536 (encode_coding_ccl, encode_coding_raw_text)
11537 (detect_coding_charset, decode_coding_charset)
11538 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11539 (produce_composition, produce_charset, produce_annotation)
11540 (decode_coding, handle_composition_annotation)
11541 (handle_charset_annotation, consume_chars, decode_coding_gap)
11542 (decode_coding_object, encode_coding_object, detect_coding_system)
11543 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11544 (code_convert_region, code_convert_string)
8f50130c
PE
11545 (Fdefine_coding_system_internal)
11546 (coding_set_source, coding_set_destination):
d311d28c
PE
11547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11548 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11549 (Fdefine_coding_system_internal):
11550 Don't assume fixnums fit in int.
11551 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 11552 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
11553 (Funencodable_char_position, Fcheck_coding_systems_region)
11554 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 11555 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 11556 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 11557 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 11558 Don't access memory outside of the args array.
d311d28c 11559 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
11560 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11561 result of ENCODE_CHAR.
d311d28c
PE
11562 * coding.h: Adjust decls to match defn changes elsewhere.
11563 (struct coding_system):
11564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11565 * composite.c (get_composition_id, find_composition)
11566 (run_composition_function, update_compositions)
11567 (compose_text, composition_gstring_put_cache)
11568 (composition_gstring_p, composition_gstring_width)
11569 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11570 (composition_compute_stop_pos, composition_reseat_it)
11571 (composition_update_it, struct position_record)
11572 (find_automatic_composition, composition_adjust_point)
11573 (Fcomposition_get_gstring, Ffind_composition_internal):
11574 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11575 (update_compositions):
11576 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11577 * composite.h: Adjust decls to match defn changes elsewhere.
11578 (struct composition):
11579 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11580 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11581 Do not attempt to compute the address of the object just before a
11582 buffer; this is not portable.
11583 (Faref, Faset):
11584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11585 (Faset): Use int, not EMACS_INT, where int is wide enough.
11586 (Fstring_to_number): Don't assume fixnums fit in int.
11587 (Frem): Don't assume arg is nonnegative.
11588 * dbusbind.c (xd_append_arg): Check for integers out of range.
11589 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 11590 (extract_signed, extract_unsigned): New functions.
243e0530
PE
11591 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11592 (xd_get_connection_references): Return ptrdiff_t, not int.
11593 All uses changed.
11594 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11595 (xd_read_message_1):
11596 Use int, not unsigned, where the dbus API uses int.
11597 (Fdbus_message_internal): Don't overflow mtype.
11598 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
11599 * dired.c (directory_files_internal, file_name_completion, scmp)
11600 (file_name_completion_stat):
11601 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11602 (file_name_completion): Don't overflow matchcount.
11603 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11604 * dispextern.h: Adjust decls to match defn changes elsewhere.
11605 (struct text_pos, struct glyph, struct bidi_saved_info)
11606 (struct bidi_string_data, struct bidi_it, struct composition_it)
11607 (struct it):
11608 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11609 (struct display_pos, struct composition_it, struct it):
11610 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11611 * dispnew.c (increment_matrix_positions)
11612 (increment_row_positions, mode_line_string)
11613 (marginal_area_string):
11614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 11615 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
11616 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11617 (duration_to_sec_usec): New function, to check for overflow better.
11618 (Fsleep_for, sit_for): Use it.
11619 * doc.c (get_doc_string, store_function_docstring):
11620 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11621 (get_doc_string, Fsnarf_documentation):
11622 Use int, not EMACS_INT, where int is wide enough.
11623 (get_doc_string):
11624 Use SAFE_ALLOCA, not alloca.
11625 Check for overflow when converting EMACS_INT to off_t.
11626 * doprnt.c (doprnt):
11627 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11628 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11629 Don't assume uid_t fits into fixnum.
11630 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11631 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11632 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11633 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11634 (general_insert_function)
11635 (Finsert_char, make_buffer_string, make_buffer_string_both)
11636 (update_buffer_properties, Fbuffer_substring)
11637 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11638 (Fsubst_char_in_region, check_translation)
11639 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11640 (transpose_markers, Ftranspose_regions):
11641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11642 (clip_to_bounds): Move to lisp.h as an inline function).
11643 (Fconstrain_to_field): Don't assume integers are nonnegative.
11644 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11645 (Fsubst_char_in_region, Fsave_restriction):
11646 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11647 (Femacs_pid): Don't assume pid_t fits into fixnum.
11648 (lo_time): Use int, not EMACS_INT, when int suffices.
11649 (lisp_time_argument): Check for usec out of range.
11650 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
11651 (Fuser_login_name, Fuser_full_name): Signal an error
11652 if a uid argument is out of range, rather than relying on
11653 undefined behavior.
c8d5c857
PE
11654 (Fformat_time_string): Remove now-unnecessary check.
11655 lisp_time_argument checks for out-of-range usec now.
243e0530 11656 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
11657 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11658 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11659 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11660 (init_cmdargs, Fdump_emacs):
11661 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11662 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11663 the bottom (typically) 32 bits of the fixnum.
11664 * eval.c (specpdl_size, call_debugger):
11665 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11666 (when_entered_debugger, Fbacktrace_debug):
11667 Don't assume fixnum can fit in int.
11668 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11669 the object just before a buffer; this is not portable.
11670 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11671 (grow_specpdl, unbind_to):
11672 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11673 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11674 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 11675 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
11676 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11677 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11678 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11679 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11680 (a_write, e_write):
11681 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11682 (Fcopy_file, non_regular_nbytes, read_non_regular)
11683 (Finsert_file_contents):
11684 Use int, not EMACS_INT, where int is wide enough.
11685 (READ_BUF_SIZE): Verify that it fits in int.
11686 (Finsert_file_contents): Check that counts are in proper range,
11687 rather than assuming fixnums fit into ptrdiff_t etc.
11688 Don't assume fixnums fit into int.
125b3835 11689 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
11690 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
11691 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
11692 (string_char_to_byte, string_byte_to_char)
11693 (string_make_multibyte, string_to_multibyte)
11694 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
11695 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
11696 (substring_both, Fdelete, internal_equal, Ffillarray)
11697 (Fclear_string, mapcar1)
11698 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
11699 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
11700 (larger_vector, make_hash_table, maybe_resize_hash_table)
11701 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
11702 (Fmaphash, secure_hash):
11703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11704 (concat): Check for string index and length overflow.
11705 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
11706 (Frequire):
11707 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11708 (larger_vector): New API (vec, incr_min, size_max) replaces old
11709 one (vec, new_size, init). This catches size overflow.
11710 INIT was removed because it was always Qnil.
11711 All callers changed.
11712 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
11713 the upper bound on a hash table index size.
11714 (make_hash_table, maybe_resize_hash_table): Use it.
11715 (secure_hash): Computer start_byte and end_byte only after
11716 they're known to be in ptrdiff_t range.
11717 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
11718 (Ffont_get_glyphs, Ffont_at):
11719 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11720 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
11721 (Flist_fonts, Fopen_font):
11722 Don't assume fixnum can fit in int.
11723 (check_gstring): Don't assume index can fit in int.
11724 (font_match_p): Check that fixnum is a character, not a nonnegative
11725 fixnum, since the later code needs to stuff it into an int.
11726 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
11727 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
11728 conversion overflow issues.
11729 (Fopen_font): Check for integer out of range.
11730 (Ffont_get_glyphs): Don't assume index can fit in int.
11731 * font.h: Adjust decls to match defn changes elsewhere.
11732 * fontset.c (reorder_font_vector): Redo score calculation to avoid
11733 integer overflow.
11734 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
11735 printmax_t, where ptrdiff_t is wide enough.
11736 (Finternal_char_font):
11737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11738 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
11739 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
11740 (Fset_frame_position, x_set_frame_parameters)
11741 (x_set_line_spacing, x_set_border_width)
11742 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
11743 Check that fixnums are in proper range for system types.
11744 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
11745 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11746 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
11747 Use SAFE_ALLOCA_LISP, not alloca.
11748 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
11749 intptr_t is wide enough.
11750 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
11751 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
11752 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
11753 Check for fixnum out of range.
11754 * ftfont.c (ftfont_list): Don't assume index fits in int.
11755 Check that fixnums are in proper range for system types.
11756 (ftfont_shape_by_flt):
11757 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
11758 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11760 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
11761 Check that fixnums are in proper range for system types.
11762 * gnutls.h: Adjust decls to match defn changes elsewhere.
11763 * gtkutil.c (xg_dialog_run):
11764 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11765 (update_frame_tool_bar):
11766 Check that fixnums are in proper range for system types.
11767 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 11768 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
11769 * indent.c (last_known_column, last_known_column_point):
11770 (current_column_bol_cache):
11771 (skip_invisible, current_column, check_display_width):
11772 (check_display_width, scan_for_column, current_column_1)
11773 (Findent_to, Fcurrent_indentation, position_indentation)
11774 (indented_beyond_p, Fmove_to_column, compute_motion):
11775 (Fcompute_motion, Fvertical_motion):
11776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11777 (last_known_column_modified): Use EMACS_INT, not int.
11778 (check_display_width):
11779 (Fcompute_motion):
11780 Check that fixnums and floats are in proper range for system types.
11781 (compute_motion): Don't assume index or fixnum fits in int.
11782 (compute_motion, Fcompute_motion):
11783 Use int, not EMACS_INT, when it is wide enough.
11784 (vmotion): Omit local var start_hpos that is always 0; that way
11785 we don't need to worry about overflow in expressions involving it.
11786 * indent.h: Adjust decls to match defn changes elsewhere.
11787 (struct position):
11788 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11789 Use int, not EMACS_INT, where int is wide enough.
11790 Remove unused members ovstring_chars_done and tab_offset;
11791 all uses removed.
11792 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11793 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11794 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11795 (make_gap, copy_text, insert, insert_and_inherit)
11796 (insert_before_markers, insert_before_markers_and_inherit)
11797 (insert_1, count_combining_before, count_combining_after)
11798 (insert_1_both, insert_from_string)
11799 (insert_from_string_before_markers, insert_from_string_1)
11800 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11801 (adjust_after_replace, adjust_after_insert, replace_range)
11802 (replace_range_2, del_range, del_range_1, del_range_byte)
11803 (del_range_both, del_range_2, modify_region)
11804 (prepare_to_modify_buffer, signal_before_change)
11805 (signal_after_change, Fcombine_after_change_execute):
11806 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11807 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11808 (balance_an_interval, split_interval_right, split_interval_left)
11809 (find_interval, next_interval, update_interval)
11810 (adjust_intervals_for_insertion, delete_node, delete_interval)
11811 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11812 (static_offset_intervals, offset_intervals)
11813 (merge_interval_right, merge_interval_left, make_new_interval)
11814 (graft_intervals_into_buffer, temp_set_point_both)
11815 (temp_set_point, set_point, adjust_for_invis_intang)
11816 (set_point_both, move_if_not_intangible, get_property_and_range)
11817 (get_local_map, copy_intervals, copy_intervals_to_string)
11818 (compare_string_intervals, set_intervals_multibyte_1):
11819 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11820 * intervals.h: Adjust decls to match defn changes elsewhere.
11821 (struct interval):
11822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11823 * keyboard.c (this_command_key_count, this_single_command_key_start)
11824 (before_command_key_count, before_command_echo_length, echo_now)
11825 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11826 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11827 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11828 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11830 (last_non_minibuf_size, last_point_position, echo_truncate)
11831 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
11832 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
11833 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
11834 (stuff_buffered_input):
11835 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11836 (last_auto_save, command_loop_1, read_char):
11837 Use EMACS_INT, not int, to avoid integer overflow.
11838 (record_char): Avoid overflow in total_keys computation.
11839 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
11840 * keyboard.h: Adjust decls to match defn changes elsewhere.
11841 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
11842 (Fkey_description, Fdescribe_vector, Flookup_key):
11843 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11844 (click_position): New function, to check that positions are in range.
11845 (Fcurrent_active_maps):
11846 (describe_command):
11847 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11848 (Faccessible_keymaps, Fkey_description):
11849 (preferred_sequence_p):
11850 Don't assume fixnum can fit into int.
11851 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
11852 Check for integer overflow in size calculations.
11853 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
11854 avoid mishandling large integers.
11855 * lisp.h: Adjust decls to match defn changes elsewhere.
11856 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
11857 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
11858 (struct Lisp_Marker):
11859 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11860 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
11861 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
11862 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
11863 All callers changed.
11864 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
11865 Assume the arg has valid form, since it always does.
11866 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
11867 unsigned integer system type.
11868 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
11869 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
11870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11871 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
11872 (duration_to_sec_usec): New decl.
11873 * lread.c (read_from_string_index, read_from_string_index_byte)
11874 (read_from_string_limit, readchar, unreadchar, openp)
11875 (read_internal_start, read1, oblookup):
11876 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11877 (Fload, readevalloop, Feval_buffer, Feval_region):
11878 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11879 (openp): Check for out-of-range argument to 'access'.
11880 (read1): Use int, not EMACS_INT, where int is wide enough.
11881 Don't assume fixnum fits into int.
6efdadfd 11882 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
11883 (read_filtered_event): Use duration_to_sec_usec
11884 to do proper overflow checking on durations.
d311d28c
PE
11885 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
11886 in size calculation.
11887 (Fexecute_kbd_macro):
11888 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11889 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
11890 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
11891 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
11892 (set_marker_both, set_marker_restricted_both, marker_position)
11893 (marker_byte_position, Fbuffer_has_markers_at):
11894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11895 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 11896 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
11897 It now merely ensures that the menu is large enough, without
11898 necessarily growing it, as this avoids some integer overflow issues.
11899 All callers changed.
11900 (keymap_panes, parse_single_submenu, Fx_popup_menu):
11901 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11902 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
11903 Use SAFE_ALLOCA_LISP, not alloca.
11904 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
11905 to EMACS_INT. Check that fixnums are in proper range for system types.
11906 * minibuf.c (minibuf_prompt_width, string_to_object)
11907 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
11908 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
11909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11910 (get_minibuffer, read_minibuf_unwind):
11911 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11912 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
11913 this simplifies overflow checking. All callers changed.
11914 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
11915 (Ftest_completion):
11916 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11917 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
11918 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
11919 Check that fixnums are in proper range for system types.
11920 (Fx_create_frame, Fx_show_tip):
11921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11922 * nsfont.m (ns_findfonts, nsfont_list_family):
11923 Don't assume fixnum fits in long.
11924 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
11925 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11926 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
11927 wide enough.
17fdb222 11928 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
11929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11930 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
11931 (PRINTDECLARE, PRINTPREPARE):
11932 (strout, print_string):
11933 (print, print_preprocess, print_check_string_charset_prop)
11934 (print_object):
11935 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11936 (PRINTDECLARE):
11937 (temp_output_buffer_setup, Fprin1_to_string, print_object):
11938 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11939 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 11940 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 11941 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
11942 (print_error_message): Use SAFE_ALLOCA, not alloca.
11943 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
11944 (print_depth, new_backquote_output, print_number_index):
11945 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
11946 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
11947 (Fset_process_window_size, Fformat_network_address)
11948 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 11949 (sigchld_handler):
d311d28c 11950 Check that fixnums are in proper range for system types.
d44287d4 11951 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
11952 Check for process-ids out of pid_t range rather than relying on
11953 undefined behavior.
e4d81efc 11954 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
11955 (Fformat_network_address, read_process_output, send_process)
11956 (Fprocess_send_region, status_notify):
11957 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11958 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
11959 (wait_reading_process_output, read_process_output, exec_sentinel):
11960 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11961 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
11962 (Faccept_process_output): Use duration_to_sec_usec to do proper
11963 overflow checking on durations.
dde14581
PE
11964 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
11965 Don't assume pid_t fits in int.
02481186
PE
11966 * process.h (struct Lisp_Process): Members tick and update_tick
11967 are now of type EMACS_INT, not int.
b62b53e8
PE
11968 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
11969 configured --with-wide-int.
d311d28c
PE
11970 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
11971 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
11972 * search.c (looking_at_1, string_match_1):
11973 (fast_string_match, fast_c_string_match_ignore_case)
11974 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
11975 (scan_newline, find_before_next_newline, search_command)
11976 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
11977 (set_search_regs, wordify):
11978 (Freplace_match):
11979 (Fmatch_data):
11980 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11981 (string_match_1, search_buffer, set_search_regs):
11982 (Fmatch_data):
11983 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11984 (wordify): Check for overflow in size calculation.
11985 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
11986 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
11987 Check that fixnums are in proper range for system types.
11988 * sound.c (struct sound_device)
11989 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
11990 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11991 (Fplay_sound_internal):
11992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 11993 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
11994 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
11995 (Fparse_partial_sexp):
11996 Don't assume fixnums can fit in int.
11997 (struct lisp_parse_state, find_start_pos, find_start_value)
11998 (find_start_value_byte, find_start_begv)
11999 (update_syntax_table, char_quoted, dec_bytepos)
12000 (find_defun_start, prev_char_comend_first, back_comment):
12001 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12002 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12003 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12004 (Finternal_describe_syntax_value): Check that match_lisp is a
12005 character, not an integer, since the code stuffs it into int.
12006 (scan_words, scan_sexps_forward):
12007 Check that fixnums are in proper range for system types.
12008 (Fforward_word):
12009 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12010 (scan_sexps_forward):
12011 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12012 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12013 * syntax.h: Adjust decls to match defn changes elsewhere.
12014 (struct gl_state_s):
12015 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
12016 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12017 MOST_POSITIVE_FIXNUM.
d311d28c
PE
12018 * sysdep.c (wait_for_termination_1, wait_for_termination)
12019 (interruptible_wait_for_termination, mkdir):
12020 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12021 (emacs_read, emacs_write):
12022 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
12023 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12024 and double all fit in int.
d311d28c
PE
12025 * term.c (set_tty_color_mode):
12026 Check that fixnums are in proper range for system types.
12027 * termhooks.h (struct input_event):
12028 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12029 * textprop.c (validate_interval_range, interval_of)
12030 (Fadd_text_properties, set_text_properties_1)
12031 (Fremove_text_properties, Fremove_list_of_text_properties)
12032 (Ftext_property_any, Ftext_property_not_all)
12033 (copy_text_properties, text_property_list, extend_property_ranges)
12034 (verify_interval_modification):
12035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12036 (Fnext_single_char_property_change)
12037 (Fprevious_single_char_property_change):
12038 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
12039 (copy_text_properties):
12040 Check for integer overflow in index calculation.
d311d28c
PE
12041 * undo.c (last_boundary_position, record_point, record_insert)
12042 (record_delete, record_marker_adjustment, record_change)
12043 (record_property_change):
12044 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12045 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12046 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12047 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12048 (Fx_hide_tip, Fx_file_dialog):
12049 * w32menu.c (set_frame_menubar):
12050 Use ptrdiff_t, not int, for consistency with rest of code.
12051 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12052 (select_window, Fdelete_other_windows_internal)
12053 (window_scroll_pixel_based, window_scroll_line_based)
12054 (Frecenter, Fset_window_configuration):
12055 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12056 (Fset_window_hscroll, run_window_configuration_change_hook)
12057 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 12058 (Fscroll_other_window, Frecenter):
d311d28c
PE
12059 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12060 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12061 Don't assume fixnum fits in int.
12062 (Fset_window_scroll_bars):
12063 Check that fixnums are in proper range for system types.
12064 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12065 (string_pos, c_string_pos, number_of_chars, init_iterator)
12066 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12067 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12068 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
12069 (face_before_or_after_it_pos, handle_invisible_prop)
12070 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
12071 (display_prop_intangible_p, string_buffer_position_lim)
12072 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12073 (get_overlay_strings_1, get_overlay_strings)
12074 (iterate_out_of_display_property, forward_to_next_line_start)
12075 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12076 (get_next_display_element, set_iterator_to_next)
12077 (get_visually_first_element, compute_stop_pos_backwards)
12078 (handle_stop_backwards, next_element_from_buffer)
12079 (move_it_in_display_line_to, move_it_in_display_line)
12080 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12081 (add_to_log, message_dolog, message_log_check_duplicate)
12082 (message2, message2_nolog, message3, message3_nolog
12083 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12084 (current_message_1, truncate_echo_area, truncate_message_1)
12085 (set_message, set_message_1, store_mode_line_noprop)
12086 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12087 (text_outside_line_unchanged_p, check_point_in_composition)
12088 (reconsider_clip_changes)
12089 (redisplay_internal, set_cursor_from_row, try_scrolling)
12090 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12091 (redisplay_window, find_last_unchanged_at_beg_row)
12092 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12093 (trailing_whitespace_p, find_row_edges, display_line)
12094 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12095 (display_mode_element, store_mode_line_string)
12096 (pint2str, pint2hrstr, decode_mode_spec)
12097 (display_count_lines, display_string, draw_glyphs)
12098 (x_produce_glyphs, x_insert_glyphs)
12099 (rows_from_pos_range, mouse_face_from_buffer_pos)
12100 (fast_find_string_pos, mouse_face_from_string_pos)
12101 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12103 (safe_call, init_from_display_pos, handle_fontified_prop)
12104 (handle_single_display_spec, load_overlay_strings)
12105 (with_echo_area_buffer, setup_echo_area_for_printing)
12106 (display_echo_area, echo_area_display)
12107 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12108 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
12109 (redisplay_window, dump_glyph_row, display_mode_line)
12110 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 12111 (handle_display_spec, display_prop_string_p):
d311d28c
PE
12112 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12113 (handle_single_display_spec, build_desired_tool_bar_string)
12114 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12115 (get_specified_cursor_type):
12116 Check that fixnums are in proper range for system types.
12117 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12118 (Flookup_image_map):
12119 Don't assume fixnums fit in int.
12120 (compare_overlay_entries):
12121 Avoid mishandling comparisons due to subtraction overflow.
12122 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12123 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12124 (handle_tool_bar_click):
12125 Use int, not unsigned, since we prefer signed and the signedness
12126 doesn't matter here.
12127 (get_next_display_element, next_element_from_display_vector):
12128 Use int, not EMACS_INT, when int is wide enough.
12129 (start_hourglass): Use duration_to_sec_usec to do proper
12130 overflow checking on durations.
12131 * xfaces.c (Fbitmap_spec_p):
12132 Check that fixnums are in proper range for system types.
12133 (compare_fonts_by_sort_order):
12134 Avoid mishandling comparisons due to subtraction overflow.
12135 (Fx_family_fonts, realize_basic_faces):
12136 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12137 (Fx_family_fonts):
12138 Don't assume fixnum fits in int.
12139 Use SAFE_ALLOCA_LISP, not alloca.
12140 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12141 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12142 (face_at_buffer_position, face_for_overlay_string)
12143 (face_at_string_position):
12144 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12145 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12146 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12147 (Fx_show_tip):
12148 Check that fixnums are in proper range for system types.
12149 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12150 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12151 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12152 (Fx_change_window_property): Don't assume fixnums fit in int.
12153 * xfont.c (xfont_chars_supported):
12154 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12155 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12156 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12157 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12158 * xml.c (parse_region):
12159 * xrdb.c (magic_file_p):
12160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12161 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12162 (x_get_local_selection, x_reply_selection_request)
12163 (x_handle_selection_request, wait_for_property_change):
12164 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12165 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12166 short is wide enough.
12167 (x_send_client_event): Don't assume fixnum fits in int.
12168 * xterm.c (x_x_to_emacs_modifiers):
12169 Don't assume EMACS_INT overflows nicely into int.
12170 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12171 may come from Lisp.
12172 (handle_one_xevent): NATNUMP can eval its arg twice.
12173 (x_connection_closed):
12174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12175 * xterm.h: Adjust decls to match defn changes elsewhere.
12176 (struct scroll_bar): Use struct vectorlike_header
12177 rather than rolling our own approximation.
12178 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12179
c6574eb5
GM
121802012-05-25 Glenn Morris <rgm@gnu.org>
12181
12182 * lisp.mk (lisp): Update for more files being compiled now.
12183
e8d32c7e
SM
121842012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12185
48def666
SM
12186 * lread.c: Remove `read_pure' which makes no difference.
12187 (read_pure): Remove var.
12188 (unreadpure): Remove function.
12189 (readevalloop): Don't call read_list with -1 flag.
12190 (read1, read_vector): Don't test read_pure any more.
12191 (read_list): Simplify.
12192
e8d32c7e
SM
12193 * fileio.c, character.h: Minor style tweaks.
12194
4b2addb7
DA
121952012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12196
12197 * window.h (clip_changed): Remove useless declaration.
12198
584461b2
JB
121992012-05-22 Juanma Barranquero <lekktu@gmail.com>
12200
12201 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12202 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12203
34374650
PE
122042012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12205
12206 Remove src/m/*.
12207 This directory predates autoconf and is no longer needed nowadays.
12208 Move its few remaining bits of functionality to where they're needed.
12209 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12210 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12211 * m/template.h: Remove.
12212 * Makefile.in (M_FILE): Remove. All uses removed.
12213 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12214 * lisp.h (USE_LSB_TAG):
12215 * mem-limits.h (EXCEEDS_LISP_PTR):
12216 Use VAL_MAX, not VALBITS, in #if.
12217 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12218 (EMACS_UINT): Define unconditionally now.
12219 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12220 (BITS_PER_EMACS_INT): New constants, replacing
12221 what used to be in config.h, but not useful in #if.
12222 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12223 define them any more.
12224 (VAL_MAX): New macro.
12225 (VALMASK): Use it.
12226 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12227 BITS_PER_EMACS_INT, in #if.
12228 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12229 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12230 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12231 * s/ms-w32.h (DATA_START):
12232 Move here from removed file m/intel386.h.
12233 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12234 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12235
261cb4bb
PE
122362012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12237
12238 Assume C89 or later.
12239 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12240 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12241 (xrealloc):
12242 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12243 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12244 * textprop.c, tparam.c (NULL): Remove.
12245 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12246 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12247 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12248 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12249 * xterm.c (input_signal_count): Assume volatile works.
12250
ff23cd9f
KB
122512012-05-21 Ken Brown <kbrown@cornell.edu>
12252
12253 * xgselect.c (xg_select): Fix first argument in call to 'select'
12254 (bug#11508).
12255
1b170bc6
KB
122562012-05-20 Ken Brown <kbrown@cornell.edu>
12257
12258 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 12259 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 12260
b2f4d39f
KB
122612012-05-19 Ken Brown <kbrown@cornell.edu>
12262
12263 * xfns.c (x_in_use): Remove `static' qualifier.
12264 * xterm.h (x_in_use): Declare.
12265 * xgselect.c: Include xterm.h.
12266 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12267 and `display_arg' (bug#9754).
12268
003fdae2
PE
122692012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12270
9232a6d9
PE
12271 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12272
003fdae2
PE
12273 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12274 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12275
784b56e2
EZ
122762012-05-18 Eli Zaretskii <eliz@gnu.org>
12277
12278 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12279
12280 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 12281 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
12282
12283 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12284 reference to image_cache->refcount.
12285 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12286
a0a79cde
JL
122872012-05-17 Juri Linkov <juri@jurta.org>
12288
12289 * search.c (Fword_search_regexp, Fword_search_backward)
12290 (Fword_search_forward, Fword_search_backward_lax)
12291 (Fword_search_forward_lax): Move functions to isearch.el
12292 (bug#10145, bug#11381).
12293
b0572523
PE
122942012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12295
12296 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12297
9660f5fc
SM
122982012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12299
12300 * lread.c (init_obarray): Declare Qt and Qnil as special.
12301
4374de83
GM
123022012-05-14 Glenn Morris <rgm@gnu.org>
12303
12304 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 12305 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 12306
dc44c39a
PE
123072012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12308
078c97cb
PE
12309 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12310
dc44c39a
PE
12311 * unexaix.c: Port to more-recent AIX compilers.
12312 (report_error, report_error_1, make_hdr, copy_sym)
12313 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12314 Make arguments const char *, not char *, to avoid violations of C
12315 standard and to fix some AIX warnings reported by Gilles Pion.
12316
e18afed7 123172012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
12318
12319 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12320 already have overlays loaded.
12321 (handle_single_display_spec): Before returning without displaying
12322 fringe bitmap, synchronize the bidi iterator with the main display
12323 iterator, by calling iterate_out_of_display_property.
12324 (iterate_out_of_display_property): Detect buffer iteration by
12325 testing that it->string is a Lisp string.
12326 (get_next_display_element): When the current object is exhausted,
12327 and there's something on it->stack, call set_iterator_to_next to
12328 proceed with what's on the stack, instead of returning zero.
12329 (set_iterator_to_next): If called at the end of a Lisp string,
12330 proceed to consider_string_end without incrementing string
12331 position. Don't increment display vector index past the end of
12332 the display vector. (Bug#11417)
c8fb9dc6
EZ
12333 (pos_visible_p): Don't report a position visible when move_it_to
12334 stopped at the last line of window, which happens to be scanned
12335 backwards by the bidi iteration. (Bug#11464)
ac268e67 12336
e18afed7 123372012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
12338
12339 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12340 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
12341 are on a TTY, and thus unable to display on the fringes.
12342 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
12343 so we need to signal to the caller that this is a "replacing"
12344 display spec. This fixes display when the spec is invalid or we
12345 are on a TTY.
12346
e18afed7 123472012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
12348
12349 * unexaix.c (make_hdr): Fix typo in prototype.
12350 This bug broke the build on AIX. Problem reported by Gilles Pion.
12351
9d0a235a
MA
123522012-05-14 Michael Albinus <michael.albinus@gmx.de>
12353
12354 * keyboard.c (kbd_buffer_get_event): Read special events also in
12355 batch mode. (Bug#11415)
12356
9e6b06ed
GM
123572012-05-12 Glenn Morris <rgm@gnu.org>
12358
12359 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12360
c1a1d7a3
EZ
123612012-05-12 Eli Zaretskii <eliz@gnu.org>
12362
12363 * lisp.mk (lisp): Add newcomment.elc.
12364
3fe7cdc8
GM
123652012-05-12 Glenn Morris <rgm@gnu.org>
12366
12367 * Makefile.in (MKDIR_P): New, set by configure.
12368 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12369
53f7d2c0
PE
123702012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12371
12372 Remove unused function hourglass_started.
12373 * dispextern.h (hourglass_started):
12374 * w32fns.c (hourglass_started):
12375 * xdisp.c (hourglass_started): Remove.
12376
75aafb17
JB
123772012-05-10 Juanma Barranquero <lekktu@gmail.com>
12378
12379 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12380 Update dependencies.
12381
12959e8e
PE
123822012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12383
97107e2e
PE
12384 * xgselect.c (xg_select): Put maxfds+1 into a var.
12385 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12386
12959e8e
PE
12387 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12388
836d29b3
DA
123892012-05-10 Dave Abrahams <dave@boostpro.com>
12390
12391 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12392 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12393
5cb67954
MA
123942012-05-09 Michael Albinus <michael.albinus@gmx.de>
12395
12396 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 12397 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
12398 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12399 Initialize xd_registered_buses.
12400
3478ec45
PE
124012012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12402
b263a6b0
PE
12403 Untag more efficiently if USE_LSB_TAG.
12404 This is based on a proposal by YAMAMOTO Mitsuharu in
12405 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12406 For an admittedly artificial (nth 8000 longlist) benchmark on
12407 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12408 Emacs's overall text size by 1%.
12409 * lisp.h (XUNTAG): New macro.
12410 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12411 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12412 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12413 * eval.c (Fautoload):
12414 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12415 * frame.h (XFRAME): Use XUNTAG.
12416
3478ec45
PE
12417 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12418 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12419 Remove unportable assumptions about print widths of types like
12420 dbus_uint32_t.
12421 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12422 intptr_t when converting between pointer and integer, to avoid GCC
12423 warnings about wrong width.
12424
666b903b 124252012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
12426
12427 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12428 stack for each reader_thread, instead of defaulting to 8MB
12429 determined by the linker. This avoids failures in creating
12430 subprocesses on Windows 7, see the discussion in this thread:
12431 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12432
b120cc17
JC
124332012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12434
12435 Fix up display of the *Minibuf-0* buffer in the mini window.
12436 * keyboard.c (read_char): Don't clear the echo area if there's no
12437 message to clear.
12438 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 12439 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 12440
9a4b36f8
MA
124412012-05-07 Michael Albinus <michael.albinus@gmx.de>
12442
12443 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12444 batch mode.
12445
e5f9458f
CY
124462012-05-06 Chong Yidong <cyd@gnu.org>
12447
12448 * lisp.mk (lisp): Update.
12449
eceeb5fc 124502012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
12451
12452 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12453
71873e2b
SM
124542012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12455
12456 * data.c (PUT_ERROR): New macro.
12457 (syms_of_data): Use it. Add new error type `user-error'.
12458 * undo.c (user_error): New function.
12459 (Fprimitive_undo): Use it.
12460 * print.c (print_error_message): Adjust print style for `user-error'.
12461 * keyboard.c (user_error): New function.
12462 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12463
ab0fa4e4
PE
124642012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12465
12466 Do not limit current-time-string to years 1000..9999.
12467 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12468 (Fcurrent_time_string): Support any year that is supported by the
12469 underlying localtime representation. Don't use asctime, as it
12470 has undefined behavior for years outside the range -999..9999.
12471
7ed806a7
PE
124722012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12473
12474 Fix race conditions involving setenv, gmtime, localtime, asctime.
12475 Without this fix, interrupts could mess up code that uses these
12476 nonreentrant functions, since setting TZ invalidates existing
12477 tm_zone or tzname values, and since most of these functions return
12478 pointers to static storage.
12479 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12480 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12481 Grow the critical sections to include not just invoking
12482 localtime/gmtime, but also accessing these functions' results
12483 including their tm_zone values if any, and any related TZ setting.
12484 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
12485 so that the struct tm is saved in the critical section.
12486 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
12487 motivated by the fact that memory allocation needs to be outside
12488 the critical section.
12489
0c16dfed
DA
124902012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12491
12492 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12493 with RESET_INTERVAL.
12494
12495 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12496 Remove duplicated buffer name initialization.
12497
3f83ace8
JM
124982012-05-02 Jim Meyering <jim@meyering.net>
12499
12500 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12501
c7b8541e
JM
12502 * xfns.c (x_window): Use xstrdup (Bug#11375).
12503
90207a15 125042012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
12505
12506 * xdisp.c (pos_visible_p): If already at a newline from the
12507 display string before the 'while' loop, don't walk back the glyphs
12508 from it3.glyph_row. Solves assertion violation when the display
12509 string begins with a newline (egg.el). (Bug#11367)
12510
b593d6a9
AH
125112012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12512
12513 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12514 Move to simple.el.
12515
4737362e
GM
125162012-05-01 Glenn Morris <rgm@gnu.org>
12517
99cf43f9
GM
12518 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12519 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12520 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12521 All were removed before 23.1.
12522
9311dcff
GM
12523 * dispnew.c: Remove HAVE_LIBNCURSES test;
12524 it is always true on relevant platforms.
12525
4d5c6349
GM
12526 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12527 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12528
4737362e
GM
12529 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12530
74dd3a6b
AS
125312012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12532
12533 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12534 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12535 Remove.
12536
13c379ee
PE
125372012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12538
12539 Do not avoid creating empty evaporating overlays (Bug#9642).
12540 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12541 That is, do not delete an evaporating overlay if it becomes
12542 empty after its bounds are adjusted to fit within its buffer.
12543 This fix caused other problems, and I'm reverting it until we get
12544 to the bottom of them.
12545
a8e7d6d7 125462012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
12547
12548 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12549
a8e7d6d7 125502012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
12551
12552 * xdisp.c (pos_visible_p): If the window start position is beyond
12553 ZV, start the display from buffer beginning. Prevents assertion
12554 violation in init_iterator when the minibuffer window is scrolled
12555 via the scroll bar.
12556
12557 * window.c (window_scroll_pixel_based): Likewise.
12558
a8e7d6d7 125592012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
12560
12561 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12562
a8e7d6d7 125632012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
12564
12565 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12566 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12567
a8e7d6d7 125682012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 12569
b593d6a9
AH
12570 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12571 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 12572
1c6900d9
EZ
125732012-04-26 Eli Zaretskii <eliz@gnu.org>
12574
4c3fa1d9
EZ
12575 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12576 display element, check also the underlying string or buffer
12577 character. (Bug#11341)
12578
1c6900d9
EZ
12579 * w32menu.c: Include w32heap.h.
12580 (add_menu_item): If the call to AppendMenuW (via
12581 unicode_append_menu) fails, disable Unicode menus only if we are
12582 running on Windows 9X/Me.
12583
42bf8205
AS
125842012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12585
12586 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12587 (xgetint): Add missing shift for LSB tags.
12588
b1bac16e
MR
125892012-04-24 Martin Rudalics <rudalics@gmx.at>
12590
12591 * keyboard.c (read_char): Don't wipe echo area for select window
12592 events: These might get delayed via `mouse-autoselect-window'
12593 (Bug#11304).
12594
d69621cc
JB
125952012-04-24 Juanma Barranquero <lekktu@gmail.com>
12596
12597 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12598 manipulation of :loaded-from data.
12599
02fd101b
JB
126002012-04-23 Juanma Barranquero <lekktu@gmail.com>
12601
12602 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12603 now a cons (bug#11311).
12604
888bec30
PE
126052012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12606
89a438bd
PE
12607 Do not create empty overlays with the evaporate property (Bug#9642).
12608 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12609 if it becomes empty after its bounds are adjusted to fit within
12610 its buffer. Without this fix, in a nonempty buffer (let ((o
12611 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12612 yields an empty overlay that has the evaporate property, which is
12613 not supposed to happen.
12614
1068fe4d
PE
12615 Fix minor GTK3 problems found by static checking.
12616 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12617 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12618 (struct _EmacsFixedClass, emacs_fixed_get_type):
12619 Move decls here from emacsgtkfixed.h, since they needn't be public.
12620 (emacs_fixed_get_type): Now static.
12621 (emacs_fixed_class_init): Omit unused local.
12622 (emacs_fixed_child_type): Remove; unused.
12623 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12624 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12625 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12626 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12627 (EMACS_FIXED_GET_CLASS): Remove; unused.
12628 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12629
888bec30
PE
12630 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12631 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12632
de85e130
PE
126332012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12634
d0baac98 12635 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 12636 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
12637 (__malloc_size_t, __malloc_ptrdiff_t):
12638 Remove. All uses removed, replaced by the definiens if needed,
12639 since we can assume C89 or better now.
12640 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12641 (protect_malloc_state, align, get_contiguous_space)
12642 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12643 (malloc_atfork_handler_child, malloc_enable_thread)
12644 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12645 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12646 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12647 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12648 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12649 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12650 Define using prototypes, not old style.
12651 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12652 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12653 (align): Don't assume that signed integer overflow wraps around.
12654 Omit unused local var.
12655 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12656 (_free_internal_nolock, memalign, mallochook, reallochook):
12657 Omit no-longer-needed casts.
12658 (valloc): Use getpagesize, not __getpagesize.
12659 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12660 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12661
de85e130
PE
12662 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12663
dcbf5805
MA
126642012-04-22 Michael Albinus <michael.albinus@gmx.de>
12665
12666 Move functions from C to Lisp. Make non-blocking method calls
12667 the default. Implement further D-Bus standard interfaces.
12668
12669 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12670 (QCdbus_request_name_allow_replacement)
12671 (QCdbus_request_name_replace_existing)
12672 (QCdbus_request_name_do_not_queue)
12673 (QCdbus_request_name_reply_primary_owner)
12674 (QCdbus_request_name_reply_in_queue)
12675 (QCdbus_request_name_reply_exists)
12676 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12677 (QCdbus_registered_serial, QCdbus_registered_method)
12678 (QCdbus_registered_signal): New Lisp objects.
12679 (XD_DEBUG_MESSAGE): Use sizeof.
12680 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12681 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12682 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12683 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12684 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12685 (xd_signature, xd_append_arg): Allow float for integer types.
12686 (xd_get_connection_references): New function.
b593d6a9
AH
12687 (xd_get_connection_address): Rename from xd_initialize.
12688 Return cached address.
dcbf5805
MA
12689 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
12690 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
12691 level.
12692 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 12693 Return number of refcounts.
dcbf5805
MA
12694 (Fdbus_get_unique_name): Make stronger parameter check.
12695 (Fdbus_message_internal): New defun.
12696 (Fdbus_call_method, Fdbus_call_method_asynchronously)
12697 (Fdbus_method_return_internal, Fdbus_method_error_internal)
12698 (Fdbus_send_signal, Fdbus_register_service)
12699 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
12700 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
12701 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
12702 (Vdbus_compiled_version, Vdbus_runtime_version)
12703 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
12704 (Vdbus_message_type_method_return, Vdbus_message_type_error)
12705 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
12706 (Vdbus_registered_buses, Vdbus_registered_objects_table):
12707 Adapt docstring.
dcbf5805 12708
52828e02
PE
127092012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12710
da05bc4c
PE
12711 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
12712 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
12713 Do not assume ptrdiff_t is the same width as 'int'.
12714
52828e02
PE
12715 * alloc.c: Handle unusual debugging option combinations.
12716 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
12717 since the two debugging options are incompatible.
12718 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
12719 is defined.
12720 (mem_init, mem_insert, mem_insert_fixup):
12721 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
12722 (NEED_MEM_INSERT): Remove; no longer needed.
12723
f01769f9
LL
127242012-04-22 Leo Liu <sdl.web@gmail.com>
12725
12726 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
12727
5790543d
PE
127282012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12729
12730 * sysdep.c [__FreeBSD__]: Minor cleanups.
12731 (list_system_processes, system_process_attributes) [__FreeBSD__]:
12732 Use Emacs indenting style more consistently. Avoid some casts.
12733 Use 'double' consistently rather than mixing 'float' and 'double'.
12734
b91b7e4d
EW
127352012-04-21 Eduard Wiebe <usenet@pusto.de>
12736
b593d6a9
AH
12737 * sysdep.c (list_system_processes, system_process_attributes):
12738 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 12739
6114eb15
AS
127402012-04-21 Andreas Schwab <schwab@linux-m68k.org>
12741
12742 * lisp.mk (lisp): Update.
12743
2f38dff7
PE
127442012-04-20 Paul Eggert <eggert@cs.ucla.edu>
12745
12746 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
12747 It is never used otherwise.
12748
4ae29f89
SM
127492012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
12750
12751 * print.c (print_preprocess): Only check print_depth if print-circle
12752 is nil.
12753 (print_object): Check for cycles even when print-circle is nil and
12754 print-gensym is t, but only check print_depth if print-circle is nil.
12755
f30d612a
CY
127562012-04-20 Chong Yidong <cyd@gnu.org>
12757
12758 * process.c (wait_reading_process_output): If EIO occurs on a pty,
12759 set the status to "failed" and ensure that sentinel is run.
12760
c07a4c0b 127612012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
12762
12763 * process.c (Fset_process_inherit_coding_system_flag)
12764 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 12765 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 12766
c07a4c0b 127672012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
12768
12769 * xdisp.c (string_buffer_position_lim): Limit starting position to
12770 BEGV.
12771 (set_cursor_from_row): If called for a mode-line or header-line
12772 row, return zero immediately.
12773 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
12774 farther than the first row after the header line, if any.
12775 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
12776 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12777
c07a4c0b 127782012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12779
4ae29f89
SM
12780 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12781 (bug#11238).
ad3a2b41 12782
c07a4c0b 127832012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 127842012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
12785
12786 configure: new option --enable-gcc-warnings (Bug#11207)
12787 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12788 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12789 (ALL_CFLAGS): Use new macros rather than old.
12790 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12791 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12792 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12793 -Wunused-result, -Wunused-variable. This should go away once
12794 the Emacs and Gnulib regex code is merged.
12795 (xmalloc, xrealloc): Now static.
12796
aba027e8
PE
127972012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12798
12799 * dired.c (Fsystem_groups): Remove unused local.
12800
e5a36063
GM
128012012-04-17 Glenn Morris <rgm@gnu.org>
12802
12803 * dired.c (Fsystem_users): Doc fix.
12804
316411f0
DA
128052012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12806
12807 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12808 (syms_of_dired): Add them.
12809
9426aba4
PE
128102012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12811
b62a57be
PE
12812 Fix minor alloc.c problems found by static checking.
12813 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12814 New extern decls, to avoid calling undeclared functions.
12815 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12816 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12817 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12818 (NEED_MEM_INSERT): New macro.
12819 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 12820 Remove one incorrect comment and fix another.
b62a57be 12821
3539f31f
PE
12822 Fix minor ralloc.c problems found by static checking.
12823 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12824 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12825 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12826 (r_alloc_sbrk): Now static.
12827
a041960a
PE
12828 Improve ralloc.c interface checking.
12829 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12830 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
12831 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
12832 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
12833 [REL_ALLOC]: ... to here, to check interface.
12834 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
12835 Remove decls. This fixes an "It stinks!".
12836
9426aba4
PE
12837 * alloc.c (which_symbols): Fix alignment issue / type clash.
12838
d55c12ed
AS
128392012-04-15 Andreas Schwab <schwab@linux-m68k.org>
12840
12841 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
12842 (struct Lisp_Misc_Any): Likewise.
12843 (struct Lisp_Free): Likewise.
12844 * alloc.c (union aligned_Lisp_Symbol): Define.
12845 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
12846 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
12847 (union aligned_Lisp_Misc): Define.
12848 (MARKER_BLOCK_SIZE, struct marker_block): Use union
12849 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 12850 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 12851
b948ce8b
PE
128522012-04-14 Paul Eggert <eggert@cs.ucla.edu>
12853
12854 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
12855 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
12856 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
12857 * s/netbsd.h, s/sol2-6.h:
12858 Remove definition of GC_MARK_STACK, since the default now works.
12859 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
12860 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
12861 no longer the default.
12862 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
12863
35dc09a1 128642012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12865
35dc09a1
GM
12866 * lread.c (lisp_file_lexically_bound_p):
12867 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 12868
35dc09a1
GM
128692012-04-14 Eli Zaretskii <eliz@gnu.org>
12870
12871 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
12872 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
12873
128742012-04-14 Jan Djärv <jan.h.d@swipnet.se>
12875
12876 * nsterm.m (constrainFrameRect): Always constrain when there is only
12877 one screen (Bug#10962).
12878
bcd86815
KB
128792012-04-13 Ken Brown <kbrown@cornell.edu>
12880
12881 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
12882
c25df26e
RT
128832012-04-13 Reuben Thomas <rrt@sc3d.org>
12884
12885 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
12886
0fc59f1e
DC
128872012-04-11 Daniel Colascione <dancol@dancol.org>
12888
12889 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
12890 against is gone. It's better to use vfork now so that when Cygwin
12891 gains a new, working vfork, we use it automatically (bug#10398).
12892
de8c03dc
SM
128932012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12894
12895 * window.c (save_window_save): Obey window-point-insertion-type.
12896
2f097256
GM
128972012-04-11 Glenn Morris <rgm@gnu.org>
12898
12899 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
12900
453b951e
SM
129012012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12902
12903 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
12904
75f1671a 129052012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
12906
12907 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
12908 (force_quit_count): New var.
12909 (handle_interrupt): Use it.
12910
2a8ce227
JB
129112012-04-10 Juanma Barranquero <lekktu@gmail.com>
12912
12913 * w32.c (w32_delayed_load): Record the full path of the library
12914 being loaded (bug#10424).
12915
935396c0
GM
129162012-04-09 Glenn Morris <rgm@gnu.org>
12917
05920a43
GM
12918 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
12919 not just in the obarray, before snarfing them. (Bug#11036)
12920
935396c0
GM
12921 * Makefile.in ($(leimdir)/leim-list.el):
12922 Pass EMACS rather than BUILT_EMACS.
12923
a18ecafa
TZ
129242012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
12925
12926 * process.c (make_process):
12927 * process.h: Add integer `gnutls_handshakes_tried' member to
12928 process struct.
12929
6bbef4e5
JC
12930 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
12931 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
12932
12933 * gnutls.c (gnutls_log_function2i): Convenience log function.
12934 (emacs_gnutls_read): Use new log functions,
12935 `gnutls_handshakes_tried' process member, and
12936 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
12937 attempts per process (connection).
12938
b4d3bc10
CY
129392012-04-09 Chong Yidong <cyd@gnu.org>
12940
12941 * eval.c (Fuser_variable_p, user_variable_p_eh)
12942 (lisp_indirect_variable): Functions deleted.
12943 (Fdefvar): Caller changed.
12944
12945 * callint.c (Finteractive, Fcall_interactively):
12946 * minibuf.c (Fread_variable): Callers changed.
12947
70f4d973
EZ
129482012-04-09 Eli Zaretskii <eliz@gnu.org>
12949
12950 * xdisp.c (set_cursor_from_row): If the display string appears in
12951 the buffer at position that is closer to point than the position
12952 after the display string, display the cursor on the first glyph of
12953 the display string. Fixes cursor display when a 'display' text
12954 property immediately follows invisible text. (Bug#11094)
12955
cb3c2e3e
PE
129562012-04-09 Paul Eggert <eggert@cs.ucla.edu>
12957
12958 composite.c: use 'double' consistently
12959 * composite.c (get_composition_id): Use 'double' consistently
12960 instead of converting 'float' to 'double' and vice versa; this is
12961 easier to understand and avoids a GCC warning.
12962
fd06db5d
GM
129632012-04-09 Glenn Morris <rgm@gnu.org>
12964
50fe702a
GM
12965 * Makefile.in: Generate leim-list with bootstrap-emacs, in
12966 preparation for dumping it with emacs. (Bug#4789)
12967 (leimdir): New variable.
12968 ($(leimdir)/leim-list.el): New rule.
12969 (emacs$(EXEEXT)): Depend on leim-list.el.
12970
fd06db5d
GM
12971 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
12972 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
12973 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
12974
55c131ee
AS
129752012-04-08 Andreas Schwab <schwab@linux-m68k.org>
12976
12977 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
12978 proper alignment.
12979
9209588f
JB
129802012-04-07 Juanma Barranquero <lekktu@gmail.com>
12981
12982 * xml.c (init_libxml2_functions) [WINDOWSNT]:
12983 Remove unused local variable.
12984
e3fb2efb
PE
129852012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12986
12987 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
12988 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
12989 (mark_memory): Mark Lisp_Objects only if pointers might hide in
12990 objects, as mark_maybe_pointer will catch them otherwise.
12991 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
12992 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
12993
b5385551
PE
129942012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12995
12996 Fix typo that broke non-Windows builds.
12997 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
12998
9078ead6
EZ
129992012-04-07 Eli Zaretskii <eliz@gnu.org>
13000
13001 Support building on MS-Windows with libxml2.
13002
13003 * makefile.w32-in (OBJ2): Add xml.$(O).
13004 (GLOBAL_SOURCES): Add xml.c.
13005 ($(BLD)/xml.$(O)): New dependency list.
13006
13007 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13008 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13009 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13010 [!WINDOWSNT]: New macros.
13011 (init_libxml2_functions, libxml2_loaded_p): New functions.
13012 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13013 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13014 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13015 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13016 linked in).
6bbef4e5
JC
13017 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13018 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
13019 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13020
13021 * emacs.c: Don't include libxml/parser.h.
13022 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13023 xmlCleanupParser directly.
13024
13025 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13026
3811fdf3
EZ
130272012-04-07 Eli Zaretskii <eliz@gnu.org>
13028
13029 * indent.c (Fvertical_motion): If there is a display string at
13030 point, use it.vpos to compute how many lines to backtrack after
13031 move_it_to point. (Bug#11133)
13032
2f8e16b2
EZ
130332012-04-06 Eli Zaretskii <eliz@gnu.org>
13034
13035 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13036 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13037 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13038 macros related to unification of CJK characters. For the details,
13039 see the discussion following the message here:
13040 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13041
3d439cd1
CY
130422012-04-04 Chong Yidong <cyd@gnu.org>
13043
13044 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13045
8bc53d00
EZ
130462012-04-01 Eli Zaretskii <eliz@gnu.org>
13047
13048 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13049 instead of alloca. (Bug#11138)
13050
3b0512a3
AS
130512012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13052
13053 * w32menu.c (is_simple_dialog): Properly check lisp types.
13054 (Bug#11141)
13055
8427ddd2
EZ
130562012-03-31 Eli Zaretskii <eliz@gnu.org>
13057
979022ef
EZ
13058 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13059 position we get to after a call to move_it_to fails the
13060 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13061 only if we wind up in a string from display property. (Bug#11063)
13062
a6b1c7cc
EZ
13063 * window.c (Fdelete_other_windows_internal): Invalidate the row
13064 and column information about mouse highlight, so that redisplay
13065 restores it after reallocating the glyph matrices. (Bug#7464)
13066
8427ddd2
EZ
13067 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13068 string comes from a `display' text property, use the buffer
13069 position of that property as if we actually saw that position in
13070 the row's glyphs.
697ba24b
EZ
13071 (move_it_by_lines): Remove the assertion that
13072 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13073 violated when there's a before-string at the beginning of a line.
13074 (Bug#11063)
8427ddd2 13075
65a0a738
EZ
130762012-03-30 Eli Zaretskii <eliz@gnu.org>
13077
13078 * xdisp.c (append_space_for_newline): If the default face was
13079 remapped, use the remapped face for the appended newline.
13080 (extend_face_to_end_of_line): Use the remapped default face for
13081 extending the face to the end of the line.
13082 (display_line): Call extend_face_to_end_of_line when the default
13083 face was remapped. (Bug#11068)
13084
581355cc
EZ
130852012-03-29 Eli Zaretskii <eliz@gnu.org>
13086
13087 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13088
e8fc049f
SM
130892012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13090
13091 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13092
4fb9a543
GM
130932012-03-27 Glenn Morris <rgm@gnu.org>
13094
13095 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13096 Doc fixes.
13097
679910f1
KH
130982012-03-26 Kenichi Handa <handa@m17n.org>
13099
13100 * dispextern.h (struct glyph): Fix previous change. Change the
13101 bit length of glyphless.ch to 25 (Bug#11082).
13102
90d49b7f
CY
131032012-03-26 Chong Yidong <cyd@gnu.org>
13104
13105 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13106 (command_loop_1): Use it; inhibit selection update for
13107 handle-select-window too (Bug#8996).
13108
f514f6f0
FP
131092012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13110
e8fc049f 13111 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 13112
bf43fa51
KH
131132012-03-25 Kenichi Handa <handa@m17n.org>
13114
13115 * dispextern.h (struct glyph): Change the bit length of
13116 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13117
8a0c01dd
EZ
131182012-03-24 Eli Zaretskii <eliz@gnu.org>
13119
13120 * s/ms-w32.h (tzname): Include time.h before redirecting to
13121 _tzname. Fixes the MSVC build. (Bug#9960)
13122
7d1c3a76
AS
131232012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13124
8ed79523
AS
13125 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13126 characters.
13127
7d1c3a76
AS
13128 * xterm.c (XTread_socket): Only modify handling_signal if
13129 !SYNC_INPUT. (Bug#11080)
13130
e99a9b8b
EZ
131312012-03-23 Eli Zaretskii <eliz@gnu.org>
13132
13133 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13134 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13135 when fetching a multibyte character consumes more bytes than
13136 CHAR_BYTES returns, due to unification of CJK characters in
13137 string_char. (Bug#11073)
13138
5063c0e1
TN
131392012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13140
13141 * process.c (wait_reading_process_output): Handle pty disconnect
13142 by refraining from sending oneself a SIGCHLD (bug#10933).
13143
9f851fbd
CY
131442012-03-22 Chong Yidong <cyd@gnu.org>
13145
13146 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13147
5063c0e1 13148 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
13149 Mark string as coming from a prefix property.
13150 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13151 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13152
fb5b8aca
CY
131532012-03-21 Chong Yidong <cyd@gnu.org>
13154
13155 * xfaces.c (Vface_remapping_alist): Doc fix.
13156
62356a1b
EZ
131572012-03-20 Eli Zaretskii <eliz@gnu.org>
13158
13159 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
13160 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13161 Doc fixes.
62356a1b 13162
025de85b
CY
131632012-03-20 Chong Yidong <cyd@gnu.org>
13164
13165 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13166 to reflect default non-nil value of redisplay-dont-pause.
13167
4827f94e
KH
131682012-03-19 Kenichi Handa <handa@m17n.org>
13169
13170 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13171 it fit in a valid range (Bug#11003).
13172
e50a24a2
EZ
131732012-03-18 Eli Zaretskii <eliz@gnu.org>
13174
13175 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13176 that is not from display property, accept the row as a "cursor
13177 row" if one of the string's character has a non-nil `cursor'
13178 property. Fixes cursor positioning when there are newlines in
13179 overlay strings, e.g. in icomplete.el. (Bug#11035)
13180
9af5ed87
PE
131812012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13182
13183 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13184
d1f55f16
CY
131852012-03-12 Chong Yidong <cyd@gnu.org>
13186
13187 * eval.c (inhibit_lisp_code): Rename from
13188 inhibit_window_configuration_change_hook; move from window.c.
13189
13190 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13191 * window.c (run_window_configuration_change_hook)
13192 (syms_of_window): Callers changed.
13193
66c5eebd
CY
131942012-03-11 Chong Yidong <cyd@gnu.org>
13195
413df973
CY
13196 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13197
66c5eebd
CY
13198 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13199
1de11f56
CY
132002012-03-10 Chong Yidong <cyd@gnu.org>
13201
13202 * frame.c (other_visible_frames): Don't assume the selected frame
13203 is visible (Bug#10955).
13204
cae07000
SM
132052012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13206
13207 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13208
89c94350
JD
132092012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13210
13211 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13212 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13213 zero (Bug#10954).
13214
999dd333
GM
132152012-03-03 Glenn Morris <rgm@gnu.org>
13216
01a6dcc8 13217 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 13218
de0100f2
EZ
132192012-03-02 Eli Zaretskii <eliz@gnu.org>
13220
13221 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13222 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
13223 (redisplay_window, next_element_from_string): Fix typos in
13224 comments.
3e441275
EZ
13225 (redisplay_window): Pass to move_it_vertically the margin in
13226 pixels, not in screen lines.
de0100f2 13227
96a72ee9
GM
132282012-03-02 Glenn Morris <rgm@gnu.org>
13229
13230 * buffer.c (buffer-list-update-hook): Doc fix.
13231
312508d7
EZ
132322012-02-29 Eli Zaretskii <eliz@gnu.org>
13233
13234 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13235 push_it before setting up the iterator for the first overlay
13236 string, even if we have an empty string loaded.
13237 (next_overlay_string): If there's an empty string on the iterator
13238 stack, pop the stack. (Bug#10903)
13239
27f3c637
PE
132402012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13241
13242 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13243 Suggested by Stefan Monnier in
13244 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13245 * alloc.c (widen_to_Lisp_Object): New static function.
13246 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13247 and widening them to Lisp_Objects. This would work even if
13248 USE_LSB_TAG is defined and wide integers are used, which might
13249 happen in a future version of Emacs.
13250
3c9dfce6
CY
132512012-02-25 Chong Yidong <cyd@gnu.org>
13252
fa74b241
CY
13253 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13254 Doc fix.
13255
3c9dfce6
CY
13256 * xselect.c (Fx_selection_exists_p): Doc fix.
13257 (x_clipboard_manager_save_all): Print an informative message
13258 before saving to clipboard manager.
13259
9486df08
CY
132602012-02-24 Chong Yidong <cyd@gnu.org>
13261
13262 * keyboard.c (process_special_events): Handle all X selection
13263 requests in kbd_buffer, not just the next one (Bug#8869).
13264
f01d3321
CY
132652012-02-23 Chong Yidong <cyd@gnu.org>
13266
13267 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13268 call when setting menu-bar-lines and tool-bar-lines parameters.
13269 (unwind_create_frame_1): New helper function.
13270
13271 * window.c (inhibit_window_configuration_change_hook): New var.
13272 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 13273 (syms_of_window): Initialize it.
f01d3321 13274
86b847b6
CY
132752012-02-22 Chong Yidong <cyd@gnu.org>
13276
13277 * xterm.c (x_draw_image_relief): Add missing type check for
13278 Vtool_bar_button_margin (Bug#10743).
13279
a59225b1
CY
132802012-02-21 Chong Yidong <cyd@gnu.org>
13281
13282 * fileio.c (Vfile_name_handler_alist): Doc fix.
13283
13284 * buffer.c (Fget_file_buffer): Protect against invalid file
13285 handler return value.
13286
310f5bd4
PE
132872012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13288
cb3a28cc
PE
13289 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13290 when computing $valmask.
13291
310f5bd4
PE
13292 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13293 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13294 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13295 It's useless in that case, and it can cause problems on hosts
13296 that allocate halves of EMACS_INT values separately.
13297 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13298 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13299 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13300 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13301 it avoids undefined behavior on hosts where shifting right by more
13302 than the word width has undefined behavior.
13303
2375c96a
CY
133042012-02-19 Chong Yidong <cyd@gnu.org>
13305
13306 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13307 (Funhandled_file_name_directory, Ffile_name_as_directory)
13308 (Fdirectory_file_name, Fexpand_file_name)
13309 (Fsubstitute_in_file_name): Protect against invalid file handler
13310 return values (Bug#10845).
13311
3eb49e71
EZ
133122012-02-18 Eli Zaretskii <eliz@gnu.org>
13313
13314 * .gdbinit (pitx): Fix incorrect references to fields of the
13315 iterator stack.
13316
7b926f3f
CY
133172012-02-17 Chong Yidong <cyd@gnu.org>
13318
13319 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13320
11273115
PE
133212012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13322
13323 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13324 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13325
c3a70e2b
CY
133262012-02-15 Chong Yidong <cyd@gnu.org>
13327
13328 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13329 marked as special. Also, starting docstrings with * is obsolete.
13330
0ca43699
AS
133312012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13332
13333 * gnutls.c (emacs_gnutls_write): Fix last change.
13334
2e8f3c56
LI
133352012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13336
13337 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13338 send_process.
13339
af70074f
SM
133402012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13341
13342 * keymap.c (Fsingle_key_description): Handle char ranges.
13343
95986d52
CY
133442012-02-12 Chong Yidong <cyd@gnu.org>
13345
afd83bd1
CY
13346 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13347 as that creates a dangerous corner case.
13348
95986d52
CY
13349 * window.c (Fdelete_window_internal): Invalidate the mouse
13350 highlight (Bug#9904).
13351
bd7da63e
GM
133522012-02-12 Glenn Morris <rgm@gnu.org>
13353
13354 * xselect.c (Fx_own_selection_internal)
13355 (Fx_get_selection_internal, Fx_disown_selection_internal)
13356 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13357 * nsselect.m (Fx_own_selection_internal)
13358 (Fx_disown_selection_internal, Fx_selection_exists_p)
13359 (Fx_selection_owner_p, Fx_get_selection_internal):
13360 Sync docs and argument specs with the xselect.c versions.
13361
77abcbc2
LI
133622012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13363
13364 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13365
90b671e2
EZ
133662012-02-11 Eli Zaretskii <eliz@gnu.org>
13367
1c0ca0b7
EZ
13368 * w32select.c (Fx_selection_exists_p): Sync doc string and
13369 argument list with xselect.c. (Bug#10783)
13370
13371 * w16select.c (Fx_selection_exists_p): Sync doc string and
13372 argument list with xselect.c. (Bug#10783)
90b671e2 13373
49241268
GM
133742012-02-10 Glenn Morris <rgm@gnu.org>
13375
13376 * fns.c (Fsecure_hash): Doc fix.
13377
f998bbe7 133782012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
13379
13380 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13381
0992bd9c
CY
133822012-02-07 Chong Yidong <cyd@gnu.org>
13383
13384 * buffer.c (Fbuffer_local_variables)
13385 (buffer_lisp_local_variables): Handle unbound vars correctly;
13386 don't let Qunbound leak into Lisp.
13387
af008560
GM
133882012-02-07 Glenn Morris <rgm@gnu.org>
13389
dd605cc4
GM
13390 * image.c (Fimagemagick_types): Doc fix.
13391
af008560
GM
13392 * image.c (imagemagick-render-type): Change it from a lisp object
13393 to an integer. Move the doc here from the lisp manual.
13394 Treat all values not equal to 0 the same.
13395
1449fa1d
CY
133962012-02-06 Chong Yidong <cyd@gnu.org>
13397
13398 * doc.c (store_function_docstring): Avoid applying docstring of
13399 alias to base function (Bug#2603).
13400
3723ec07
AS
134012012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13402
13403 * .gdbinit (pp1, pv1): Remove redundant defines.
13404 (pr): Use pp.
13405
79c1cc1e
CY
134062012-02-04 Chong Yidong <cyd@gnu.org>
13407
13408 * nsterm.m: Declare a global (Bug#10694).
13409
d7f29f8e
EZ
134102012-02-04 Eli Zaretskii <eliz@gnu.org>
13411
cae07000
SM
13412 * w32.c (get_emacs_configuration_options):
13413 Include --enable-checking, if specified, in the return value.
d7f29f8e 13414
3b95a6f9
MR
134152012-02-04 Martin Rudalics <rudalics@gmx.at>
13416
13417 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13418 after rounding frame sizes. (Bug#9723)
13419
d6fa96a6
EZ
134202012-02-04 Eli Zaretskii <eliz@gnu.org>
13421
13422 * keyboard.c (adjust_point_for_property): Don't position point
13423 before BEGV. (Bug#10696)
13424
df0b2940
PE
134252012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13426
13427 Handle overflow when computing char display width (Bug#9496).
13428 * character.c (char_width): Return EMACS_INT, not int.
13429 (char_width, c_string_width): Check for overflow when
13430 computing the width; this is possible now that individual
13431 characters can have unbounded width. Problem introduced
13432 by merge from Emacs 23 on 2012-01-19.
13433
6bee44d6
MA
134342012-02-02 Michael Albinus <michael.albinus@gmx.de>
13435
13436 * dbusbind.c (Fdbus_register_method): Mention the return value
13437 :ignore in the docstring.
13438
44f92739
GM
134392012-02-02 Glenn Morris <rgm@gnu.org>
13440
1b9f60cc
GM
13441 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13442
44f92739
GM
13443 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13444 Unconditionally set to t. (Bug#10673)
13445 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13446 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13447 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13448
c5d3843c
KH
134492012-02-02 Kenichi Handa <handa@m17n.org>
13450
13451 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13452 0, do not call append_composite_glyph.
13453
159462d4 134542012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
13455
13456 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13457 NULL (Bug#6988).
13458 (x_produce_glyphs): If the component of a composition is a null
13459 string, set it->pixel_width to 1 to avoid zero-width glyph.
13460
78cef877
EZ
134612012-02-01 Eli Zaretskii <eliz@gnu.org>
13462
13463 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13464 first 2 arguments are identical. This makes inserting large
13465 output from a subprocess an order of magnitude faster on
13466 MS-Windows, where all sbrk'ed memory is always contiguous.
13467
97897668
GM
134682012-01-31 Glenn Morris <rgm@gnu.org>
13469
13470 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 13471 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
13472 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13473
31fd3586
GM
134742012-01-29 Glenn Morris <rgm@gnu.org>
13475
13476 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13477
0e24a8b2
CY
134782012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13479
13480 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13481
cc0adcb0
CY
134822012-01-28 Chong Yidong <cyd@gnu.org>
13483
13484 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13485
acc28cb9
CY
134862012-01-26 Chong Yidong <cyd@gnu.org>
13487
9c69cfb7
CY
13488 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13489
acc28cb9
CY
13490 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13491 repeat counts (Bug#10507).
13492
48da7392
GM
134932012-01-26 Glenn Morris <rgm@gnu.org>
13494
13495 * lread.c (syms_of_lread): Doc fix.
13496
14af5f7f
CY
134972012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13498
13499 * coding.c (encode_designation_at_bol): Change return value to
13500 EMACS_INT.
13501
0b21c100
CY
135022012-01-25 Chong Yidong <cyd@gnu.org>
13503
13504 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13505
3c2907f7
CY
135062012-01-21 Chong Yidong <cyd@gnu.org>
13507
13508 * floatfns.c (Fcopysign): Make the second argument non-optional,
13509 since nil is not allowed anyway.
13510
959ad23f
AS
135112012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13512
13513 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13514 (send_process): Likewise.
13515
34a02f46
MR
135162012-01-19 Martin Rudalics <rudalics@gmx.at>
13517
13518 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
13519 (Vwindow_persistent_parameters): Do not use Qstate.
13520 Rewrite doc-strings.
34a02f46 13521
1259009a 135222012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
13523
13524 * character.c (char_width): New function.
70d4fdf6
GM
13525 (Fchar_width, c_string_width, lisp_string_width):
13526 Use char_width (Bug#9496).
25ed9e61 13527
6a6ee00d
MR
135282012-01-16 Martin Rudalics <rudalics@gmx.at>
13529
13530 * window.c (Vwindow_persistent_parameters): New variable.
13531 (Fset_window_configuration, save_window_save): Handle persistent
13532 window parameters.
13533
c85efaf7
EZ
135342012-01-14 Eli Zaretskii <eliz@gnu.org>
13535
13536 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13537 thrashing the stack of the thread. (Bug#9087)
13538
5944709e
PE
135392012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13540
13541 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13542
e71f5d99
EZ
135432012-01-11 Eli Zaretskii <eliz@gnu.org>
13544
13545 * xdisp.c (rows_from_pos_range): Handle the case where the
13546 highlight ends on a newline. (Bug#10464)
13547 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13548 he end column for display of highlight that ends on a newline
13549 before a R2L line.
13550
ce316182
GM
135512012-01-11 Glenn Morris <rgm@gnu.org>
13552
13553 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13554 from load-path also when installation-directory is nil. (Bug#10208)
13555
5b43da69
GM
135562012-01-10 Glenn Morris <rgm@gnu.org>
13557
74cc8ff9
GM
13558 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13559
7d8d6e4e
GM
13560 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13561 Update template values to be closer to their typical values these days.
5b43da69 13562
a0db8d43
EZ
135632012-01-09 Eli Zaretskii <eliz@gnu.org>
13564
13565 * xdisp.c (rows_from_pos_range): Accept additional argument
13566 DISP_STRING, and accept any glyph in a row whose object is that
13567 string as eligible for mouse highlight. Fixes mouse highlight of
13568 display strings from overlays. (Bug#10464)
13569
9a0115ab 135702012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 13571
b9110d6a 13572 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
13573 * fileio.c (auto_saving_dir_umask): New static var.
13574 (Fmake_directory_internal): Use it.
13575 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13576 creating the directory. The old code temporarily assigns
13577 too-generous permissions to the directory.
13578 (do_auto_save_eh): Clear it.
b9110d6a 13579 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
13580 that the var is always cleared.
13581
6c1bd3f3
EZ
135822012-01-07 Eli Zaretskii <eliz@gnu.org>
13583
13584 * search.c (scan_buffer): Pass character positions to
13585 know_region_cache, not byte positions. (Bug#6540)
13586
069d2b50
L
135872012-01-07 LynX <_LynX@bk.ru> (tiny change)
13588
13589 * w32.c (sys_rename): Report EXDEV when rename of a directory
13590 fails because the target is on another logical disk. (Bug#10284)
13591
75bf0d33
DB
135922012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13593
13594 * xterm.c (x_embed_request_focus): New function.
13595
13596 * xterm.h: Add prototype.
13597
13598 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13599
1c6e5a32
GM
136002012-01-05 Glenn Morris <rgm@gnu.org>
13601
13602 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13603
651e947e
EZ
136042012-01-01 Eli Zaretskii <eliz@gnu.org>
13605
13606 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13607 Load gnutls_transport_set_lowat only if GnuTLS version is below
13608 2.11.1.
13609 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13610 GnuTLS versions below 2.11.1.
13611
3778cdd8
AL
136122011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13613
13614 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13615 to the doc string advising against its use for altering the way
13616 windows are scrolled.
13617
0e5317f7
KH
136182011-12-28 Kenichi Handa <handa@m17n.org>
13619
13620 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13621 coding-system ASCII compatible only when it does not produce BOM
13622 on encoding (Bug#10383).
13623
93d5ca1f
JD
136242011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13625
13626 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13627 can scroll.
13628 (create_and_show_popup_menu): Always use menu_position_func for
13629 Gtk3 (Bug#10361).
13630
ca22b785
AS
136312011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13632
13633 * callint.c (Fcall_interactively): Don't truncate prompt string.
13634
d048e1e6
EZ
136352011-12-23 Eli Zaretskii <eliz@gnu.org>
13636
13637 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13638 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 13639 resumed from there (after widening). (Bug#10360)
d048e1e6 13640
5ccaba1f
JD
136412011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13642
13643 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13644
204ee57f
JD
136452011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13646
b81d40f0
JB
13647 * nsterm.m (x_free_frame_resources):
13648 Release f->output_data.ns->miniimage.
204ee57f
JD
13649 (ns_index_color): Fix indentation. Do not retain
13650 color_table->colors[i].
13651
13652 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13653 before returning.
13654
13655 * nsfns.m (x_set_background_color): Assign return value from
13656 ns_index_color to face-background instead of NSColor*.
13657 (ns_implicitly_set_icon_type): Fix indentation.
13658 Change assignment in for loop to comparison.
13659
13660 * emacs.c (ns_pool): New variable.
13661 (main): Assign ns_pool.
13662 (Fkill_emacs): Call ns_release_autorelease_pool.
13663
13664 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13665 autorelease fdesc, release fdAttrs and tdict.
13666 (ns_get_covering_families): Release charset.
13667 (ns_findfonts): Release NSFontDescriptor created with new.
13668 (ns_uni_to_glyphs): Fix indentation.
13669 (setString): Release attrStr before assigning new value.
13670
c803b2b7
JD
136712011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13672
678f4426
JD
13673 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13674 and NS_IMPL_COCOA.
13675 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13676 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13677
cd394be1 136782011-12-18 David Reitter <reitter@cmu.edu>
678f4426 13679
5fecd5fc
JD
13680 * nsterm.m (ns_term_init): Subscribe for notifications
13681 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13682 to method trackingNotification in EmacsMenu.
13683
13684 * nsmenu.m (trackingMenu): New variable.
3771cb17 13685 (trackingNotification): New method (from Aquamacs).
5fecd5fc 13686 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 13687 from Aquamacs (Bug#7030).
678f4426
JD
13688
136892011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 13690
c803b2b7
JD
13691 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
13692 (symbol_to_nsstring): Fix indentation.
13693 (ns_symbol_to_pb): New function.
cae07000
SM
13694 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
13695 (Fns_rotate_cut_buffers_internal): Remove.
13696 (Fns_store_selection_internal): Rename from
c803b2b7
JD
13697 Fns_store_cut_buffer_internal.
13698 (ns_get_foreign_selection, Fx_own_selection_internal)
13699 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
13700 (Fns_get_selection_internal, Fns_store_selection_internal):
13701 Use ns_symbol_to_pb and check if return value is nil.
13702 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
13703 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
13704 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
13705 renamed to Sns_store_selection_internal.
13706 (ns_handle_selection_request): Move code to Fx_own_selection_internal
13707 and remove this function.
13708 (ns_handle_selection_clear): Remove, never used.
13709 (Fx_own_selection_internal): Move code from ns_handle_selection_request
13710 here.
13711
e1b01a3a
KB
137122011-12-17 Ken Brown <kbrown@cornell.edu>
13713
13714 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
13715 GID is unknown (Bug#10257).
13716
2adb6e85
PE
137172011-12-17 Paul Eggert <eggert@cs.ucla.edu>
13718
13719 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
13720 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
13721 which caused a build failure on GNU/Linux IA-64. This problem was
13722 introduced by my 2011-10-07 patch.
13723
d1d7b339
JL
137242011-12-15 Juri Linkov <juri@jurta.org>
13725
13726 * image.c (imagemagick_error): New function. (Bug#10112)
13727 (imagemagick_load_image): Comment out `MagickSetResolution' call.
13728 Use `imagemagick_error' where ImageMagick functions return
13729 `MagickFalse'.
13730 (Fimagemagick_types): Add `Fnreverse' to return the list in the
13731 proper order.
13732
100d5755
KH
137332011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13734
13735 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
13736 fill background (Bug#8992).
13737
454592a6
MR
137382011-12-13 Martin Rudalics <rudalics@gmx.at>
13739
13740 * window.c (Vwindow_combination_resize)
13741 (Vwindow_combination_limit): Use t instead of non-nil in
13742 doc-strings.
61d4b438
MR
13743 (Vrecenter_redisplay): Add first sentence of doc-string on
13744 separate line.
53524d93 13745 (Frecenter): Fix doc-string typo.
454592a6 13746
3633e3aa
KH
137472011-12-11 Kenichi Handa <handa@m17n.org>
13748
13749 * coding.c (Funencodable_char_position): Pay attention to the
13750 buffer text relocation (Bug#9389).
13751
7b9d523a 137522011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 13753
7b9d523a
JD
13754 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
13755 gtk_init (Bug#10100).
13756
b73189c6
EZ
137572011-12-10 Eli Zaretskii <eliz@gnu.org>
13758
13759 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
13760 IT->string is nil. (Bug#10263)
13761
f7dfe5d6
JD
137622011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13763
83faebb4
JD
13764 * nsterm.h (x_free_frame_resources): Declare.
13765
f7dfe5d6
JD
13766 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
13767 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
13768
13769 * nsterm.h (ns_get_defaults_value): Declare.
13770
13771 * nsterm.m (ns_default): Call ns_get_defaults_value.
13772
7cd4e72c
EZ
137732011-12-09 Eli Zaretskii <eliz@gnu.org>
13774
13775 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13776 (Bug#10170)
13777
b34d7317
YM
137782011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13779
13780 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13781 that where the value of an _OBJC_* symbol points to is in the .bss
13782 section (Bug#10240).
13783
76470ad1
KH
137842011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13785
13786 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 13787 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 13788
745fff94
KH
137892011-12-08 Kenichi Handa <handa@m17n.org>
13790
13791 * ftfont.c (get_adstyle_property): Fix previous change
13792 (Bug#10233).
13793
6e44397c
JB
137942011-12-07 Juanma Barranquero <lekktu@gmail.com>
13795
13796 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13797 dirs from the default value of EMACSLOADPATH (bug#10208).
13798
7efa6272
GM
137992011-12-07 Glenn Morris <rgm@gnu.org>
13800
13801 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13802 installation and source directories as well. (Bug#10208)
13803
f6fc4d87
CY
138042011-12-06 Chong Yidong <cyd@gnu.org>
13805
13806 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13807
2bf26180
GM
138082011-12-06 Glenn Morris <rgm@gnu.org>
13809
13810 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13811 as an error, not just -1. (Bug#10217)
13812
3a6ad4f0
CY
138132011-12-05 Chong Yidong <cyd@gnu.org>
13814
13815 * keyboard.c (process_special_events): New function.
13816 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13817
75a3b399
PE
138182011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13819
13820 * coding.c (encode_designation_at_bol): Don't use uninitialized
13821 local variable (Bug#9318).
13822
c3c9e25e
KH
138232011-12-05 Kenichi Handa <handa@m17n.org>
13824
13825 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13826 return Qnil (Bug#8046, Bug#10193).
13827
5eb05ea3
KH
138282011-12-05 Kenichi Handa <handa@m17n.org>
13829
13830 * coding.c (encode_designation_at_bol): New args charbuf_end and
13831 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
13832 (coding_set_source): Return how many bytes coding->source was
13833 relocated.
13834 (coding_set_destination): Return how many bytes
13835 coding->destination was relocated.
13836 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 13837 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
13838
138392011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13840
13841 * coding.c (CODING_CHAR_CHARSET_P): New macro.
13842 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
13843 macro (Bug#9318).
13844
138452011-12-05 Andreas Schwab <schwab@linux-m68k.org>
13846
13847 The following changes are to fix Bug#9318.
13848
a79703f5 13849 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
13850 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
13851 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 13852 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 13853
7dbda6df
JB
138542011-12-05 Juanma Barranquero <lekktu@gmail.com>
13855
13856 * lisp.h (process_quit_flag): Fix external declaration.
13857
6d5eb5b0
SM
138582011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
13859
13860 Don't macro-inline non-performance-critical code.
13861 * eval.c (process_quit_flag): New function.
13862 * lisp.h (QUIT): Use it.
13863
a0c3fad0
JD
138642011-12-04 Jan Djärv <jan.h.d@swipnet.se>
13865
13866 * nsfns.m (get_geometry_from_preferences): New function.
13867 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
13868
6c07aac2
AS
138692011-12-04 Andreas Schwab <schwab@linux-m68k.org>
13870
13871 * emacs.c (Qkill_emacs): Define.
13872 (syms_of_emacs): Initialize it.
13873 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
13874 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
13875 (quit_throw_to_read_char): Add parameter `from_signal'.
13876 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
13877 * lisp.h (QUIT): Call Fkill_emacs if requested.
13878
c052ead4
JD
138792011-12-03 Jan Djärv <jan.h.d@swipnet.se>
13880
13881 * widget.c (update_wm_hints): Return if wmshell is null.
13882 (widget_update_wm_size_hints): New function.
13883
13884 * widget.h (widget_update_wm_size_hints): Declare.
13885
13886 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
13887 widget_update_wm_size_hints (Bug#10104).
13888
9e49252b
EZ
138892011-12-03 Eli Zaretskii <eliz@gnu.org>
13890
13891 * xdisp.c (handle_invisible_prop): If the invisible text ends just
13892 before a newline, prepare the bidi iterator for consuming the
13893 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 13894 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 13895
02b16839
JL
138962011-12-02 Juri Linkov <juri@jurta.org>
13897
13898 * search.c (Fword_search_regexp): New Lisp function created from
13899 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
13900 (Fword_search_backward, Fword_search_forward)
13901 (Fword_search_backward_lax, Fword_search_forward_lax):
13902 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
13903 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
13904
0068070e
SM
139052011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
13906
13907 * fileio.c (Finsert_file_contents): Move after-change-function call
13908 to before the "handled:" label, since all "goto handled" appear in
13909 cases where the *-change-functions have already been properly called
13910 (bug#10117).
13911
3360a3fc
AS
139122011-12-01 Andreas Schwab <schwab@linux-m68k.org>
13913
13914 * keyboard.c (interrupt_signal): Don't call kill-emacs when
13915 waiting for input. (Bug#10169)
13916
73d6c093
EZ
139172011-11-30 Eli Zaretskii <eliz@gnu.org>
13918
13919 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
13920 verifies glyph row's hash code--we have just reallocated the
13921 glyphs, so their contents can be complete garbage. (Bug#10164)
13922
febe6bea
JB
139232011-11-30 Juanma Barranquero <lekktu@gmail.com>
13924
13925 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
13926
801a4313
EZ
139272011-11-30 Eli Zaretskii <eliz@gnu.org>
13928
13929 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
13930 attributes are tested _before_ calling verify_row_hash, to protect
13931 against GCC re-ordering of the tests. (Bug#10164)
13932
2b56b87e
JD
139332011-11-29 Jan Djärv <jan.h.d@swipnet.se>
13934
13935 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
13936
13937 * xterm.c (handle_one_xevent): Only set async_visible and friends
13938 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 13939 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
13940 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
13941
dbf31225
PE
139422011-11-28 Paul Eggert <eggert@cs.ucla.edu>
13943
13944 Remove GCPRO-related macros that exist only to avoid shadowing locals.
13945 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
13946 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
13947 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13948 All uses changed to use GCPRO1 etc.
13949 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
13950 Revert to old implementation (i.e., before 2011-03-11).
13951
1305621b
YM
139522011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13953
13954 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
13955 of scroll runs so as to avoid assigning disabled bogus rows and
13956 unnecessary graphics copy operations.
13957
8c9afb46
EZ
139582011-11-27 Eli Zaretskii <eliz@gnu.org>
13959
13960 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
13961 (snprintf) [_MSC_VER]: Redirect to _snprintf.
13962 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
13963 (malloc, free, realloc, calloc): Redirect to e_* only when
13964 compiling Emacs.
13965
13966 * lisp.h (GCTYPEBITS): Move before first use.
13967 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
13968 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
13969 this macro definition.
13970
13971 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
13972 _MSC_VER.
13973
54e9e3bf
JD
139742011-11-27 Jan Djärv <jan.h.d@swipnet.se>
13975
6d5eb5b0
SM
13976 * gtkutil.c (xg_create_frame_widgets):
13977 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
13978 present with Gtk+ 2.0.
13979
83aca1cb
PE
139802011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13981
13982 * fileio.c (Finsert_file_contents): Undo previous change; see
13983 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13984
5b76caa4
PE
139852011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13986
13987 Rename locals to avoid shadowing.
13988 * fileio.c (Finsert_file_contents):
13989 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
13990 * process.c (wait_reading_process_output):
13991 Rename inner 'proc' to 'p' to avoid shadowing.
13992 Indent for consistency with usual Emacs style.
13993
8c535114
EZ
139942011-11-25 Eli Zaretskii <eliz@gnu.org>
13995
13996 * xdisp.c (redisplay_window): If cursor row is not fully visible
13997 after recentering, and scroll-conservatively is set to a large
13998 number, scroll window by a few more lines to make the cursor fully
13999 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
14000 (start_display): Don't move to the next line if the display should
14001 start at a newline that is part of a display vector or an overlay
14002 string. (Bug#10119)
8c535114 14003
fa4fdb5c
JL
140042011-11-24 Juri Linkov <juri@jurta.org>
14005
14006 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14007 after the `MagickPingImage' call. (Bug#10112)
14008
90ec88df
CY
140092011-11-23 Chong Yidong <cyd@gnu.org>
14010
14011 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14012
56e2e794
MR
140132011-11-23 Martin Rudalics <rudalics@gmx.at>
14014
14015 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14016 making another buffer current. (Bug#10114)
14017
b6e64c41
GM
140182011-11-23 Glenn Morris <rgm@gnu.org>
14019
14020 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14021
6b21de18
CY
140222011-11-23 Chong Yidong <cyd@gnu.org>
14023
14024 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14025 using it (Bug#5984).
14026
b12cd789
EZ
140272011-11-22 Eli Zaretskii <eliz@gnu.org>
14028
14029 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14030 and header-lines, as they don't have one computed for them.
14031 (Bug#10098)
14032
14033 * .gdbinit (prow): Make displayed values more self-explaining.
14034 Add row's hash code.
14035
261b6fd4
LMI
140362011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14037
14038 * process.c (wait_reading_process_output): Fix asynchrounous
14039 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 14040 (wait_reading_process_output): Add comment and URL.
261b6fd4 14041
e7cfd277
JD
140422011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14043
14044 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14045
a9b9b7f5
CY
140462011-11-21 Chong Yidong <cyd@gnu.org>
14047
14048 * window.c (Fnext_window, Fprevious_window): Doc fix.
14049
b0d15b4f
SM
140502011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14051
14052 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14053
fe7a3057
JB
140542011-11-20 Juanma Barranquero <lekktu@gmail.com>
14055
14056 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14057
d2999b1a
MR
140582011-11-20 Martin Rudalics <rudalics@gmx.at>
14059
14060 * window.c (Fset_window_combination_limit): Rename argument
14061 STATUS to LIMIT.
14062 (Vwindow_combination_limit): Remove "status" from doc-string.
14063
d5ff9cd0
AS
140642011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14065
14066 * m/ibms390.h: Remove.
14067 * m/ibms390x.h: Don't include "ibms390.h".
14068
a5bb9bd3
SM
140692011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14070
14071 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14072 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14073
cd1181db
JB
140742011-11-20 Juanma Barranquero <lekktu@gmail.com>
14075
14076 * casetab.c (Fset_case_table):
14077 * charset.c (Fcharset_after): Fix typos.
14078
615a3b8d 140792011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 14080
17e845af
PE
14081 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14082 Otherwise, valgrind does not work on some platforms.
14083 Problem reported by Andreas Schwab in
6a0bf43d
PE
14084 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14085 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14086 is set, removing the need for VIRT_ADDRESS_VARIES.
14087 (PURE_P): Use a more-efficient implementation that needs just one
14088 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14089 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14090 to 4 (xorl, subq, cmpq, setbe).
14091 * alloc.c (pure): Always extern now, since that's the
14092 VIRT_ADDR_VARIES behavior.
14093 (PURE_POINTER_P): Use a single comparison, not two, for
14094 consistency with the new puresize.h.
14095 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14096 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14097 Remove VIRT_ADDR_VARIES no longer needed.
14098
f8fe6f96
EZ
140992011-11-19 Eli Zaretskii <eliz@gnu.org>
14100
14101 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14102 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14103 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14104 behave as if the cursor position were at the window margin.
14105
14106 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14107 and the cursor position is out of bounds, behave as if the cursor
14108 position were at the window margin. (Bug#10075)
14109
df05a53c
CY
141102011-11-18 Chong Yidong <cyd@gnu.org>
14111
14112 * window.c (Fwindow_combination_limit): Make first argument
14113 non-optional, since it is meaningless for live windows like the
14114 selected window.
61ccba97 14115
2071918e
DA
141162011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14117
14118 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14119
b50a28de
SM
141202011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14121
14122 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14123 (graft_intervals_into_buffer): Simplify.
14124
015137db
EZ
141252011-11-18 Eli Zaretskii <eliz@gnu.org>
14126
14127 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14128 hash values of the two rows.
14129 (copy_row_except_pointers): Preserve the used[] arrays and the
14130 hash values of the two rows. (Bug#10035)
68c95424 14131 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
14132
14133 * xdisp.c (row_hash): New function, body extracted from
14134 compute_line_metrics.
14135 (compute_line_metrics): Call row_hash, instead of computing the
14136 hash code inline.
14137
14138 * dispnew.c (verify_row_hash): Call row_hash for computing the
14139 hash code of a row, instead of duplicating code from xdisp.c.
14140
14141 * dispextern.h (row_hash): Add prototype.
14142
a2addb04
TH
141432011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14144
14145 * frame.c (delete_frame): Don't delete the terminal when the last
14146 X frame is closed if emacs is built with GTK toolkit.
14147
df85d315
JB
141482011-11-17 Juanma Barranquero <lekktu@gmail.com>
14149
14150 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14151
a0c2d0ae
MR
141522011-11-17 Martin Rudalics <rudalics@gmx.at>
14153
14154 * window.c (Vwindow_splits): Rename to
14155 Vwindow_combination_resize. Suggested by Juri Linkov.
14156 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14157 of Vwindow_splits.
14158
58179cce
JB
141592011-11-16 Juanma Barranquero <lekktu@gmail.com>
14160
7877f373
JB
14161 * nsfns.m (Fns_font_name):
14162 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 14163
b6f67890
MR
141642011-11-16 Martin Rudalics <rudalics@gmx.at>
14165
14166 * window.h (window): Rename slot "nest" to "combination_limit".
14167 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14168 (Fset_window_nest): Rename to Fset_window_combination_limit.
14169 (Vwindow_nest): Rename to Vwindow_combination_limit.
14170 (recombine_windows, make_parent_window, make_window)
14171 (Fsplit_window_internal, saved_window)
14172 (Fset_window_configuration, save_window_save): Rename all
14173 occurrences of window_nest to window_combination_limit.
14174
c7015153
JB
141752011-11-15 Juanma Barranquero <lekktu@gmail.com>
14176
14177 * image.c (imagemagick_load_image): Fix typo.
14178
322ad6ec
EZ
141792011-11-14 Eli Zaretskii <eliz@gnu.org>
14180
14181 * xdisp.c (display_line): Move the call to
14182 highlight_trailing_whitespace before the call to
14183 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
14184 faces of all the glyphs to compute ROW's hash value.
14185 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 14186
f067b8ec
JB
141872011-11-14 Juanma Barranquero <lekktu@gmail.com>
14188
14189 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14190 just return (bug#10044).
14191
1e5b2111
EZ
141922011-11-12 Eli Zaretskii <eliz@gnu.org>
14193
7ef3cbd5
EZ
14194 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14195 with user-defined heap size. Bump the default size of the temacs
14196 heap to 27MB, to avoid memory warning when running temacs.
14197 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14198
1e5b2111
EZ
14199 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14200 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
14201 (verify_row_hash) [XASSERTS]: New function.
14202 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14203 that the hash value of glyph rows is correct.
1e5b2111 14204
89d61221
MR
142052011-11-12 Martin Rudalics <rudalics@gmx.at>
14206
14207 * window.h (window): Remove splits slot.
14208 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14209 (Fdelete_other_windows_internal, make_parent_window)
14210 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14211 (Fset_window_configuration, save_window_save): Don't deal with
14212 split status of windows.
14213 (saved_window): Remove splits slot.
14214 (Vwindow_splits): Rewrite doc-string.
14215
97f18cc8
JD
142162011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14217
14218 * xfns.c (unwind_create_frame):
14219 * nsfns.m (unwind_create_frame):
14220 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14221 Vframe_list (Bug#9999).
14222
22a648b4
DA
142232011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14224
0b381c7e 14225 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 14226
659afede
KH
142272011-11-11 Kenichi Handa <handa@m17n.org>
14228
14229 * callproc.c (Fcall_process): Set the member dst_multibyte of
14230 process_coding.
14231
9ac0394b
KH
142322011-11-11 Johan Bockgård <bojohan@gnu.org>
14233
14234 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14235 avoid a crash (bug#9496).
14236
2fbdc249
CY
142372011-11-09 Chong Yidong <cyd@gnu.org>
14238
14239 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14240 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14241
ac6b1f81
PE
142422011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14243
14244 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14245
09db192c
PE
142462011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14247
14248 Avoid some portability problems by eschewing 'extern inline' functions.
14249 The trivial performance wins aren't worth the portability hassles; see
14250 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14251 et seq.
14252 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14253 (window_box_width, window_box_left, window_box_left_offset)
14254 (window_box_right, window_box_right_offset): Undo previous change,
14255 by removing the "extern"s.
14256 * intervals.c (adjust_intervals_for_insertion)
14257 (adjust_intervals_for_deletion): Undo previous change,
14258 making these static again.
14259 (offset_intervals, temp_set_point_both, temp_set_point)
14260 (copy_intervals_to_string): No longer inline.
14261 * xdisp.c (window_text_bottom_y, window_box_width)
14262 (window_box_height, window_box_left_offset)
14263 (window_box_right_offset, window_box_left, window_box_right)
14264 (window_box): No longer inline.
14265
105216ed
CY
142662011-11-08 Chong Yidong <cyd@gnu.org>
14267
14268 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
14269 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14270 Signal an error if not a live window.
105216ed
CY
14271 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14272 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14273
ae9e237f
JB
142742011-11-07 Juanma Barranquero <lekktu@gmail.com>
14275
14276 * lisp.h (syms_of_abbrev): Remove declaration.
14277 Reported by CHENG Gao <chenggao@royau.me>.
14278
c7aa8333
EZ
142792011-11-07 Eli Zaretskii <eliz@gnu.org>
14280
14281 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14282 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14283 of temacs in GUI mode.
14284
be7f5545
MR
142852011-11-07 Martin Rudalics <rudalics@gmx.at>
14286
14287 * window.h: Declare delete_all_child_windows instead of
14288 delete_all_subwindows.
14289 * window.c (Fwindow_nest, Fset_window_nest)
14290 (Fset_window_new_total, Fset_window_new_normal)
14291 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14292 (delete_all_subwindows): Rename to delete_all_child_windows.
14293 (Fdelete_other_windows_internal, Fset_window_configuration):
14294 Call delete_all_child_windows instead of delete_all_subwindows.
14295 * frame.c (delete_frame): Call delete_all_child_windows instead
14296 of delete_all_subwindows.
14297
ca78dc43
PE
142982011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14299
14300 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14301 This is also needed for porting to any host where GC_MARK_STACK is
14302 not GC_MAKE_GCPROS_NOOPS.
14303 (which_symbols): Use it.
14304
a0241d01
KH
143052011-11-07 Kenichi Handa <handa@m17n.org>
14306
14307 * coding.c (coding_set_destination): Check coding->src_pos only
14308 when coding->src_object is a buffer (bug#9910).
14309
14310 * process.c (send_process): Set the member src_multibyte of coding
14311 to 0 (bug#9911) when sending a unibyte text.
14312
14313 * callproc.c (Fcall_process): Set the member src_multibyte of
14314 process_coding to 0 (bug#9912).
14315
a64bfdfa 143162011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
14317
14318 * xmenu.c (cleanup_widget_value_tree): New function.
14319 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14320 calling free_menubar_widget_value_tree directly (Bug#9830).
14321
cb41b32a
PE
143222011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14323
14324 Fix some portability problems with 'inline'.
14325 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14326 (window_box_width, window_box_left, window_box_left_offset)
14327 (window_box_right, window_box_right_offset): Declare extern.
14328 Otherwise, these inline functions do not conform to C99 and
14329 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14330 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14331 * intervals.c (adjust_intervals_for_insertion)
14332 (adjust_intervals_for_deletion): Now extern, because otherwise the
14333 extern inline functions 'offset_intervals' couldn't refer to it.
14334 (static_offset_intervals): Remove.
14335 (offset_intervals): Rewrite using the old contents of
14336 static_offset_intervals. The old version didn't conform to C99
14337 because an extern inline function contained a reference to an
14338 identifier with static linkage.
14339
b7041366
AS
143402011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14341
14342 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14343 GC.
14344
88a37c4d
EZ
143452011-11-06 Eli Zaretskii <eliz@gnu.org>
14346
14347 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14348 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14349 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14350 return Qleft_to_right.
14351
49745b39
CY
143522011-11-06 Chong Yidong <cyd@gnu.org>
14353
14354 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14355 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14356 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14357 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14358 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14359 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14360 (Fwindow_vscroll): Doc fix.
14361 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14362 argument, since it makes no sense to pass a live window and for
14363 consistency with window-child.
14364
1f05cd82
CS
143652011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14366
14367 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14368 support MSVC.
14369
22610910
JR
143702011-11-05 Jason Rumney <jasonr@gnu.org>
14371
14372 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14373 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14374 fonts (Bug#6029).
14375 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14376 bitwise arithmetic preventing use of unicode-sip and non-truetype
14377 opentype fonts.
14378
a06776b2
EZ
143792011-11-05 Eli Zaretskii <eliz@gnu.org>
14380
3ad924ba
EZ
14381 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14382 "emacs"-only part.
14383
a06776b2
EZ
14384 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14385 initialization code to keep similarity to xfns.c after changes
14386 from 2011-11-05.
14387
c9e7db78
JD
143882011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14389
a97f8f3f
JD
14390 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14391 (unwind_create_frame): New function (Bug#9943).
14392 (Fx_create_frame): Restructure code to be more similar to the one in
14393 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14394 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14395 Move terminal->reference_count++ just before making the frame official
14396 (Bug#9943).
14397
14398 * nsterm.m (x_free_frame_resources): New function.
14399 (x_destroy_window): Move code to x_free_frame_resources.
14400
c9e7db78 14401 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
14402 (Fx_create_frame, x_create_tip_frame):
14403 Move terminal->reference_count++ just before making the frame
75f1671a 14404 official. Move initialization of image_cache_refcount and
c9e7db78
JD
14405 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14406
a6fc3b5c
EZ
144072011-11-05 Eli Zaretskii <eliz@gnu.org>
14408
14409 Support MSVC build with newer versions of Visual Studio.
14410 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14411 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14412 nt/gmake.defs.
14413
14414 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14415 which are not supported by MSVC.
14416 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14417 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14418 bitfields.
14419 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14420 types in bitfields.
14421 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14422
14423 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14424
58179cce 144252011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
14426
14427 Support MSVC build with newer versions of Visual Studio.
14428 * w32.c: Don't include w32api.h for MSVC.
14429 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14430
14431 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14432 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14433 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14434 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14435 e_* cousins.
14436 (alloca) [_MSC_VER]: Define to _alloca.
14437
14438 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14439
14440 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14441
a58c13ed
EZ
144422011-11-04 Eli Zaretskii <eliz@gnu.org>
14443
14444 * xdisp.c (note_mouse_highlight): If either of
14445 previous/next-single-property-change returns nil, treat that as
14446 the beginning or the end of the buffer. (Bug#9955)
14447
fe0b6370
JD
144482011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14449
a58c13ed 14450 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
14451 label is not null (Bug#9951).
14452 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14453 may be NULL.
14454
89bd5ee1
EZ
144552011-11-04 Eli Zaretskii <eliz@gnu.org>
14456
14457 * window.c (Fwindow_body_size): Mention in the doc string that the
14458 return value is in frame's canonical units. (Bug#9949)
14459
84c3edb9
EZ
144602011-11-03 Eli Zaretskii <eliz@gnu.org>
14461
4e2fb5c7
EZ
14462 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14463
84c3edb9 14464 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 14465 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 14466 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 14467
bc17a887
EZ
144682011-11-01 Eli Zaretskii <eliz@gnu.org>
14469
14470 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14471 Don't stop backward scan on the continuation glyph, even though
14472 its CHARPOS is positive.
6d5eb5b0
SM
14473 (mouse_face_from_buffer_pos, note_mouse_highlight):
14474 Rename cover_string to disp_string.
bc17a887 14475
4ee88440
MR
144762011-11-01 Martin Rudalics <rudalics@gmx.at>
14477
14478 * window.c (temp_output_buffer_show): Don't use
14479 Vtemp_buffer_show_specifiers.
14480 (Vtemp_buffer_show_specifiers): Remove unused variable.
14481
c2ff3c02
EZ
144822011-10-30 Eli Zaretskii <eliz@gnu.org>
14483
14484 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14485 past the beginning of the current glyph matrix.
14486
58179cce 144872011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
14488
14489 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14490 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14491 HAVE_GTK3 (Bug#9869).
b77a6a7f 14492
3b574623
JD
14493 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14494 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14495
b77a6a7f
JD
14496 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14497
14498 * xterm.c: Declare x_handle_net_wm_state to return int.
14499 (handle_one_xevent): Check if we are iconified but don't have
14500 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14501 (get_current_wm_state): Return non-zero if not hidden,
14502 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14503 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14504 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14505 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14506
196e41e4
PE
145072011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14508
14509 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14510 so that this new function doesn't get optimized away by a
14511 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14512
021f2e1a
AS
145132011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14514
14515 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14516
8b058d44
EZ
145172011-10-29 Eli Zaretskii <eliz@gnu.org>
14518
14519 Fix the `xbytecode' command.
14520 * .gdbinit (xprintbytestr): New command.
b50a28de 14521 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
14522 (xbytecode): Print the byte-code string as well.
14523
4452fb80
EZ
145242011-10-29 Kim Storm <storm@cua.dk>
14525
8b058d44
EZ
14526 * alloc.c (which_symbols): New function.
14527
21b72067
AS
145282011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14529
14530 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14531 line. (Bug#9903)
14532
83ed7b5c
GM
145332011-10-29 Glenn Morris <rgm@gnu.org>
14534
14535 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14536 Not clear what it was for, and it causes various bugs. (Bug#9839)
14537
5a7a728b
EZ
145382011-10-28 Eli Zaretskii <eliz@gnu.org>
14539
14540 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14541 possible random value that matches one of those tested as
14542 condition to clear the mouse face.
14543
d3d0842f
CY
145442011-10-28 Chong Yidong <cyd@gnu.org>
14545
14546 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14547
31b39d13
DN
145482011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14549
14550 * window.c (make_window): Initialize phys_cursor_on_p.
14551
9aba6043
SM
145522011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14553
14554 * lisp.h (struct Lisp_Symbol): Update comments.
14555
c20992f4
JB
145562011-10-28 Juanma Barranquero <lekktu@gmail.com>
14557
14558 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14559
db4f02f2
EZ
145602011-10-28 Eli Zaretskii <eliz@gnu.org>
14561
14562 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14563 <oslsachem@gmail.com> for helping to debug this.
14564
14565 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14566 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14567 (g_b_init_get_glyph_outline_w): New static variables.
14568 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14569 (GetGlyphOutlineW_Proc): New typedefs.
14570 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
14571 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14572 New functions.
14573 (w32font_open_internal, compute_metrics):
14574 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
14575 instead of calling the "wide" APIs directly.
14576
14577 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14578
14579 * w32.h (syms_of_w32font): Add prototype.
14580
87e68db4
JB
145812011-10-27 Juanma Barranquero <lekktu@gmail.com>
14582
14583 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14584 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14585 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14586 (Fmove_to_window_line): Doc fix.
14587
435c1d67
CY
145882011-10-27 Chong Yidong <cyd@gnu.org>
14589
14590 * process.c (make_process): Set gnutls_state to NULL.
14591
14592 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14593 non-NULL, regardless of GNUTLS_INITSTAGE.
14594 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14595 an error. Set process slots as soon as we allocate them.
14596
14597 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14598
9c6c6f49
CY
145992011-10-27 Chong Yidong <cyd@gnu.org>
14600
9aba6043
SM
14601 * gnutls.c (emacs_gnutls_deinit): New function.
14602 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
14603 (Fgnutls_deinit, Fgnutls_boot): Use it.
14604
14605 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14606 (deactivate_process): Call emacs_gnutls_deinit.
14607
657d08d3
JB
146082011-10-27 Juanma Barranquero <lekktu@gmail.com>
14609
14610 * image.c (x_create_x_image_and_pixmap):
14611 * w32.c (sys_rename, w32_delayed_load):
14612 * w32font.c (fill_in_logfont):
14613 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14614
5430d399
JB
146152011-10-26 Juanma Barranquero <lekktu@gmail.com>
14616
14617 * w32fns.c (w32_default_color_map): New function,
14618 extracted from Fw32_default_color_map.
a7ef684b 14619 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 14620
fe0055fa
PE
146212011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14622
14623 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14624
e6346438
SM
146252011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14626
14627 * keyboard.c (test_undefined): New function (bug#9751).
14628 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14629
e112cc37
ET
146302011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14631
14632 * sysdep.c (init_sys_modes): Fix the check for the controlling
14633 terminal (Bug#6649).
14634
7b5d6677
EZ
146352011-10-20 Eli Zaretskii <eliz@gnu.org>
14636
14637 * dispextern.h (struct bidi_it): New member next_en_type.
14638
14639 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14640 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14641 current character, check also for next_en_type being WEAK_EN.
14642 (bidi_resolve_weak): Don't enter the expensive loop if the current
14643 position is before next_en_pos. Record the bidi type of the first
14644 non-ET, non-BN character we find, in addition to its position.
14645 (bidi_level_of_next_char): Invalidate next_en_type when
14646 next_en_pos is over-stepped.
14647
7da0b018
PE
146482011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14649
14650 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14651 * editfns.c: Rewrite current-time-zone so that it invokes
14652 the equivalent of (format-time-string "%Z") to get the time zone name.
14653 This fixes a bug when the time zone name contains characters that
14654 need converting from the system time locale to Emacs internal format.
14655 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14656 that patch fixed format-time-string to do the conversion, but
14657 I forgot to fix current-time-zone.
14658 (format_time_string): New function, containing most of
14659 what Fformat_time_string used to contain.
14660 (Fformat_time_string): Rewrite in terms of format_time_string.
14661 This doesn't change this function's behavior.
14662 (current-time-zone): Rewrite to use format_time_string.
14663 This fixes the bug reported by Michael Schierl in
14664 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14665 Jason Rumney's 2007-06-07 change worked around this bug, but
14666 didn't fix it.
14667 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14668
8547b010
EZ
146692011-10-19 Eli Zaretskii <eliz@gnu.org>
14670
14671 * xdisp.c (start_display): If the character at POS is displayed
14672 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
14673 (try_window_reusing_current_matrix): If a line ends in a display
14674 vector or the next line starts in a display vector, continue
14675 redrawing the window even though the character position of
14676 start_row was reached.
8547b010
EZ
14677 (Bug#9771, part 2)
14678
4e948d15
CY
146792011-10-18 Chong Yidong <cyd@gnu.org>
14680
14681 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14682 with nobreak-char-display too.
14683
4787455f
EZ
146842011-10-18 Eli Zaretskii <eliz@gnu.org>
14685
14686 Fix part 3 of bug#9771.
14687 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
14688 (bidi_resolve_neutral): Don't enter the expensive loop looking for
14689 non-neutral characters if the current character is a paragraph
14690 separator (a.k.a. Newline). This avoids running the same
14691 expensive loop twice, once when we consume the preceding newline
14692 and the other time when the line actually needs to be displayed.
14693 Avoid the loop when we see neutrals on the base embedding level
14694 following a character whose directionality is the same as the
14695 paragraph's. This avoids running the expensive loop when a line
14696 ends in a long sequence of neutrals, like control characters.
14697 Add assertion against STRONG_AL type. Slightly rearrange code
14698 that determines the type of a neutral given the first non-neutral
14699 that follows it.
14700 (bidi_level_of_next_char): Set next_en_pos to zero when
14701 invalidating its info.
14702
2c91f553
EZ
147032011-10-17 Eli Zaretskii <eliz@gnu.org>
14704
14705 * xdisp.c (push_display_prop): Determine whether to record string
14706 or buffer position by IT->string, not by IT->method. Allow
14707 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
14708 (move_it_vertically_backward): Don't look for character position
14709 immediately after the newline when in a continuation line.
14710 (Bug#9771, part 1)
2c91f553 14711
c7b08b0d
MR
147122011-10-15 Martin Rudalics <rudalics@gmx.at>
14713
14714 * window.c (coordinates_in_window): Rewrite and delabelize
14715 vertical border check. (Bug#5357) (Bug#9618)
14716
6b02f655
SM
147172011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
14718
14719 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
14720 errors in XSetWindowBorder (bug#9310).
14721
81d40c92
DA
147222011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
14723
14724 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
14725 avoid crash when xmalloc overrun checking is enabled.
14726
d4172c3b
EZ
147272011-10-13 Eli Zaretskii <eliz@gnu.org>
14728
14729 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
14730 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
14731 cursor motion with <left> and <right> arrow keys.
14732
14733 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
14734 some callers set that themselves.
14735
b00eea75
EZ
147362011-10-12 Eli Zaretskii <eliz@gnu.org>
14737
14738 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
14739 display string and the previous row comes from the same string and
14740 is empty. (Bug#9739) (Bug#9738)
14741
8fe012c4
SM
147422011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
14743
14744 * doc.c (get_doc_string): Encode file name (bug#9735).
14745
0074aef2
EZ
147462011-10-12 Eli Zaretskii <eliz@gnu.org>
14747
79beb178
EZ
14748 * bidi.c (bidi_level_of_next_char):
14749 * xdisp.c (get_visually_first_element): Remove old incorrect
14750 comments regarding the Unicode Line Separator character.
14751
0074aef2
EZ
14752 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
14753
6e4b3fbe
DA
147542011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
14755
14756 * alloc.c (Fgc_status): Do not access beyond zombies array
14757 boundary if nzombies > MAX_ZOMBIES.
14758 * alloc.c (dump_zombies): Add missing format specifier.
14759
0324f3af
PE
147602011-10-12 Paul Eggert <eggert@cs.ucla.edu>
14761
b5525cac
PE
14762 * xdisp.c (set_cursor_from_row): Simplify conditionals,
14763 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
14764
0324f3af
PE
14765 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
14766 Some packages use them to denote characters with modifiers.
14767
e9b5f888
AS
147682011-10-11 Andreas Schwab <schwab@linux-m68k.org>
14769
14770 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
14771 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14772 matching a pp-number. Rename parameter var to var1.
14773
127827c0
SM
147742011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14775
14776 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14777
c8fd3bd0
GM
147782011-10-08 Glenn Morris <rgm@gnu.org>
14779
14780 * callint.c (Fcall_interactively): Give a more explicit error for the
14781 'c' case with a non-character input. (Bug#8479)
14782
352ec8ff
EZ
147832011-10-08 Eli Zaretskii <eliz@gnu.org>
14784
03669ccb
EZ
14785 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14786 lines.
7061c986
EZ
14787 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14788 lines that are hscrolled on the left.
03669ccb 14789
352ec8ff
EZ
14790 * dispnew.c (buffer_posn_from_coords): Account for a possible
14791 presence of header-line. (Bug#4426)
14792
a66cfb1c
SM
147932011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14794
6b02f655
SM
14795 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14796 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 14797
7c5ee88e
PE
147982011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14799
14800 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14801 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14802 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14803 this makes Emacs dump core during garbage collection on rare
14804 occasions. sizeof is obviously inferior to offsetof here, so
14805 stick with offsetof.
14806 (GC_POINTER_ALIGNMENT): New macro.
14807 (mark_memory): Omit 3rd (offset) arg; caller changed.
14808 Don't assume EMACS_INT alignment is the same as pointer alignment.
14809
df1bbe5b
SM
148102011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14811
14812 * keyboard.c (read_key_sequence_remapped): New var.
14813 (read_key_sequence): Compute remapping in the right buffer.
14814 (command_loop_1): Use read_key_sequence's remapping directly.
14815
51553db6
SM
148162011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14817
32c1fffd
SM
14818 * dired.c (file_name_completion): Don't expand file name.
14819 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14820 before checking file name handler.
14821
51553db6
SM
14822 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14823 they've been requested explicitly (bug#9591).
14824
b6bd1599 148252011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
14826
14827 * keymap.c (Fsingle_key_description): Use make_specified_string
14828 instead of build_string to build string from push_key_description.
14829 (Bug#5193)
14830
f701dc2a
PE
148312011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14832
4222c55d
PE
14833 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
14834 This fixes a Y2038 bug on 64-bit hosts.
14835 * buffer.c (reset_buffer):
14836 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
14837 (Fclear_buffer_auto_save_failure):
14838 Use 0, not -1, to represent an unset failure time, since time_t
14839 might not be signed.
14840
f701dc2a
PE
14841 Remove dependency on glibc malloc internals.
14842 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14843 Move back here from lisp.h, but with their new implementations.
14844 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14845 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
14846 * charset.c (charset_table_init): New static var.
14847 (syms_of_charset): Use it instead of xmalloc. This removes a
14848 dependency on glibc malloc internals. See Eli Zaretskii's comment in
14849 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
14850 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14851 Move back to alloc.c.
14852 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14853 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
14854
9ceebf39
JD
148552011-09-30 Jan Djärv <jan.h.d@swipnet.se>
14856
14857 * nsterm.m (windowDidResize): Call x_set_window_size only when
14858 ns_in_resize is true. Otherwise set pixelwidth/height and
14859 call change_frame_size (Bug#9628).
14860
cb993c58
PE
148612011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14862
3930c88b
PE
14863 Port --enable-checking=all to Fedora 14 x86-64.
14864 * charset.c (syms_of_charset): Also account for glibc malloc's
14865 internal overhead when calculating the initial malloc maximum.
14866
cb993c58
PE
14867 Port --enable-checking=all to Fedora 14 x86.
14868 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14869 Move to lisp.h.
14870 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
14871 (overrun_check_realloc, overrun_check_free):
14872 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
14873 That way, xmalloc returns a properly-aligned pointer even if
14874 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
14875 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
14876 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
14877 into account when calculating the initial malloc maximum.
14878 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14879 Move here from alloc.c, so that charset.c can use it too.
14880 Properly align; the old code wasn't right for common 32-bit hosts
14881 when configured with --enable-checking=all.
14882 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14883 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
14884
31bed486
EZ
148852011-09-29 Eli Zaretskii <eliz@gnu.org>
14886
04c70788 14887 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
14888 use EDOM.
14889
fbcaa2f3
EZ
148902011-09-28 Eli Zaretskii <eliz@gnu.org>
14891
14892 * xdisp.c (compute_display_string_end): If there's no display
14893 string at CHARPOS, return -1.
14894
14895 * bidi.c (bidi_fetch_char): When compute_display_string_end
14896 returns a negative value, treat the character as a normal
14897 character not covered by a display string. (Bug#9624)
14898
a239d4e9
JB
148992011-09-28 Juanma Barranquero <lekktu@gmail.com>
14900
14901 * lread.c (Fread_from_string): Fix typo in docstring.
14902
88652fd5
EZ
149032011-09-27 Eli Zaretskii <eliz@gnu.org>
14904
14905 * xdisp.c (handle_invisible_prop): If invisible text ends on a
14906 newline, reseat the iterator instead of bidi-iterating there one
14907 character at a time. (Bug#9610)
32c1fffd
SM
14908 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
14909 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 14910
ed497dd4
AS
149112011-09-27 Andreas Schwab <schwab@linux-m68k.org>
14912
14913 * lread.c (readevalloop): Use correct code for NBSP.
14914 (read1): Likewise. (Bug#9608)
14915
b2bf61aa
MA
149162011-09-25 Michael Albinus <michael.albinus@gmx.de>
14917
14918 * dbusbind.c (Fdbus_register_signal): When service is not
14919 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
14920
32bbb17c
GM
149212011-09-25 Glenn Morris <rgm@gnu.org>
14922
14923 * buffer.c (truncate-lines): Doc fix.
14924
94e0933e
CY
149252011-09-24 Chong Yidong <cyd@stupidchicken.com>
14926
14927 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
14928 (Fset_window_next_buffers): Doc fix.
14929
cddde921
GM
149302011-09-24 Glenn Morris <rgm@gnu.org>
14931
14932 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
14933
1260aef1
PE
149342011-09-24 Paul Eggert <eggert@cs.ucla.edu>
14935
25b4bfa0
PE
14936 Fix minor problems found by static checking.
14937 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
14938 * indent.c (Fvertical_motion): Fix == vs = typo.
14939
e3cbd34b
EZ
149402011-09-24 Eli Zaretskii <eliz@gnu.org>
14941
a66cfb1c
SM
14942 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
14943 Default value is now t. Doc fix.
6bf7006f 14944
e3cbd34b 14945 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 14946 logic when moving up, not only when moving down. Fix the
e3cbd34b 14947 confusing name and values of the it_overshoot_expected variable;
32c1fffd 14948 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
14949
14950 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
14951 CHARPOS is covered by a display string which includes newlines.
14952 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
14953 is covered by a display string with embedded newlines.
14954
a3de0cbd
MA
149552011-09-24 Michael Albinus <michael.albinus@gmx.de>
14956
14957 * dbusbind.c (Fdbus_register_signal): Add match rule to
14958 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
14959 (Fdbus_register_method, Vdbus_registered_objects_table):
14960 Fix docstring.
a3de0cbd 14961
b260039d
JM
149622011-09-24 Jim Meyering <meyering@redhat.com>
14963
32c1fffd 14964 do not ignore write error for any output size
b260039d
JM
14965 The previous change was incomplete.
14966 While it makes emacs --batch detect the vast majority of stdout
14967 write failures, errors were still ignored whenever the output size is
14968 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
14969 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
14970 && echo FAIL: ignored write error
14971 FAIL: ignored write error
14972 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
14973 && echo FAIL: ignored write error
14974 FAIL: ignored write error
14975 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
14976
8eca8a7c
AS
149772011-09-23 Andreas Schwab <schwab@linux-m68k.org>
14978
14979 * emacs.c (Fkill_emacs): In noninteractive mode exit
14980 non-successfully if a write error occurred on stdout. (Bug#9574)
14981
3341db62
EZ
149822011-09-21 Eli Zaretskii <eliz@gnu.org>
14983
14984 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
14985 the xassert test.
14986
14987 * dispextern.h (struct it): Update the comment documenting what
14988 can it->OBJECT be.
14989
8c203dbf
EZ
149902011-09-20 Eli Zaretskii <eliz@gnu.org>
14991
14992 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
14993 a display string, extend search for cursor position to end of row.
14994 (find_row_edges): If the row ends in a newline from a display
14995 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
14996 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
14997 (Fcurrent_bidi_paragraph_direction): Fix search for previous
14998 non-empty line. Fixes confusing cursor motion with arrow keys at
14999 the beginning of a line that starts with whitespace.
8c203dbf 15000
a4824228
LMI
150012011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15002
15003 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15004 (bug#9493).
15005
33ed493b
CY
150062011-09-18 Chong Yidong <cyd@stupidchicken.com>
15007
15008 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15009 boolean (Bug#9154).
15010
56cd55c8
EZ
150112011-09-18 Eli Zaretskii <eliz@gnu.org>
15012
15013 * xdisp.c (display_line): Record maximum and minimum buffer
15014 positions even if no glyphs were produced (e.g., by a zero-width
15015 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15016 buffer positions that will be removed from the glyph row because
15017 they don't fit.
c02dcedf
EZ
15018 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15019 column is beyond frame width: don't subtract 1 "pixel" when
15020 computing width of the stretch.
3e62b7e0
EZ
15021 (reseat_at_next_visible_line_start): Undo the change made on
15022 2011-09-17 that saved paragraph information and restored it after
15023 the call to `reseat'. (Bug#9545)
56cd55c8 15024
5ed99d36 150252011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
15026
15027 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15028 and turn window cursor on if cleared (Bug#9415).
15029
5ed99d36 150302011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
15031
15032 * search.c (boyer_moore): Take unibyte characters from pattern
15033 literally. (Bug#9458)
15034
9bade7b2
EZ
150352011-09-18 Eli Zaretskii <eliz@gnu.org>
15036
15037 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15038
e5e9d610
PE
150392011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15040
87e4427a
PE
15041 Fix minor problem found by static checking.
15042 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15043 initialized, to pacify gcc -Wuninitialized.
15044
e5e9d610
PE
15045 * fileio.c: Report proper errno when syscall falls.
15046 (Finsert_file_contents): Save and restore errno,
15047 so that report_file_error outputs the correct diagnostic.
15048 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15049
a1674f0b
EZ
150502011-09-18 Eli Zaretskii <eliz@gnu.org>
15051
15052 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15053
fbfb6dd4
EZ
150542011-09-17 Eli Zaretskii <eliz@gnu.org>
15055
15056 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15057 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15058
bb187662
EZ
150592011-09-17 Eli Zaretskii <eliz@gnu.org>
15060
1137e8b8 15061 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 15062 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
15063
15064 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15065 (bidi_find_paragraph_start): Search back for paragraph beginning
15066 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15067 (bidi_move_to_visually_next): Only trigger paragraph-related
15068 computations when the last character is a newline or at EOB, not
15069 just any NEUTRAL_B. (Bug#9470)
15070
bb187662
EZ
15071 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15072 truncated lines if point is covered by a display string. (Bug#9524)
15073
2e621251
PE
150742011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15075
15076 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15077 (cons_to_x_long): New function.
15078 (lisp_data_to_selection_data): Use it. Correct the test for
15079 short-versus-long data; it was negated. Break out of vector
15080 loop, for efficiency, when a long datum is discovered.
15081
91a15bc6
SM
150822011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15083
15084 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15085
b41c3a35
EZ
150862011-09-16 Eli Zaretskii <eliz@gnu.org>
15087
15088 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15089 GCC PR/17406) by declaring this function with external scope.
15090
7812ba2d
PE
150912011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15092
15093 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15094 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15095
cf7edc2a
AS
150962011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15097
15098 * editfns.c (Fformat): Correctly handle text properties on "%%".
15099
bd01620e
EZ
151002011-09-15 Eli Zaretskii <eliz@gnu.org>
15101
15102 * xterm.c (x_draw_composite_glyph_string_foreground):
15103 * w32term.c (x_draw_composite_glyph_string_foreground):
15104 * term.c (encode_terminal_code):
15105 * composite.c (composition_update_it, get_composition_id):
15106 * xdisp.c (get_next_display_element)
15107 (fill_composite_glyph_string): Add comments about special meaning
15108 of TAB characters in a composition.
15109
a02719a3
PE
151102011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15111
15112 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
15113 This occurs when processing a multibyte format.
15114 Problem reported by Wolfgang Jenker.
a02719a3 15115
72589a3c
JB
151162011-09-15 Johan Bockgård <bojohan@gnu.org>
15117
15118 * xdisp.c (try_cursor_movement): Only check for exact match if
15119 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15120
1c14176c
PE
151212011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15122
15123 Remove unused external symbols.
15124 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15125 * xdisp.c (calc_pixel_width_or_height): Now static.
15126 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15127 * indent.c (check_display_width):
15128 * w32term.c: Fix comment to match code.
15129 * xterm.c, xterm.h (x_catching_errors): Remove.
15130
d2eea5b5
PE
151312011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15132
15133 * xselect.c: Use signed conversions more consistently (Bug#9498).
15134 (selection_data_to_lisp_data): Assume incoming selection data are
15135 signed integers, not unsigned. This is to be consistent with
15136 outgoing selection data, which was modified to use signed integers
15137 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15138 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15139 expects long, not unsigned long.
15140
46888499
EZ
151412011-09-14 Eli Zaretskii <eliz@gnu.org>
15142
15143 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15144 computation of loop end. Reported by Johan Bockgård
15145 <bojohan@gnu.org>.
15146
ef8ef9fb
CY
151472011-09-13 Chong Yidong <cyd@stupidchicken.com>
15148
15149 * frame.c (Fother_visible_frames_p): Function deleted.
15150
fa819fed
EZ
151512011-09-12 Eli Zaretskii <eliz@gnu.org>
15152
15153 * indent.c (compute_motion): Process display vector front to back
15154 rather than the other way around. (Bug#2496)
15155
2ba8e008
SM
151562011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15157
15158 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15159
20f53c69
CY
151602011-09-11 Chong Yidong <cyd@stupidchicken.com>
15161
15162 * minibuf.c (Fread_from_minibuffer): Doc fix.
15163
d562d7a4
EZ
151642011-09-11 Eli Zaretskii <eliz@gnu.org>
15165
15166 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15167 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15168
1c4d7f3d
LMI
151692011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15170
15171 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15172 value for non-existent files.
15173
b885bf36
EZ
151742011-09-11 Eli Zaretskii <eliz@gnu.org>
15175
15176 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15177 set its "size" to -1. This will set the modtime_size field of
15178 the corresponding buffer to -1, which is what
15179 verify-visited-file-modtime expects for files that do not exist.
15180 (Bug#9139)
15181
6612f0bf
PE
151822011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15183
15184 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15185 here ...
15186 * lisp.h: ... from here. push_key_description is no longer
15187 defined in keyboard.c, so its declaration should not be in
15188 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15189 logically belongs with push_key_description.
15190
dfb3f755
PE
151912011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15192
15193 * buffer.h: Include <sys/types.h> instead of <time.h>.
15194 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15195 Problem reported by Herbert J. Skuhra.
15196
3134906c
LMI
151972011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15198
15199 * xml.c (parse_region): Make the parsing work for
15200 non-comment-starting XML files again (bug#9144).
15201
8d903f4e
AS
152022011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15203
15204 * image.c (gif_load): Fix calculation of bottom and right corner.
15205 (Bug#9468)
15206
80ad64f4
EZ
152072011-09-10 Eli Zaretskii <eliz@gnu.org>
15208
15209 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15210 redisplay in small windows.
15211
208a048d
EZ
152122011-09-09 Eli Zaretskii <eliz@gnu.org>
15213
15214 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15215
9b1c252e
MR
152162011-09-08 Martin Rudalics <rudalics@gmx.at>
15217
15218 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15219 Operate on live windows only.
15220
2949f33b
JB
152212011-09-08 Juanma Barranquero <lekktu@gmail.com>
15222
15223 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15224
e08dcafd
EZ
152252011-09-07 Eli Zaretskii <eliz@gnu.org>
15226
15227 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15228 only under bidi iteration.
15229
115b96bd
JD
152302011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15231
15232 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15233
c8199d0f
PE
152342011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15235
15236 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15237 Without this fix, the command to link temacs failed due to an
15238 undefined symbol __builtin_isnan. This is because
15239 /usr/include/iso/math_c99.h #defines isnan(x) to
15240 __builtin_isnan(x), but the bundled gcc, which identifies itself
15241 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15242 a __builtin_isnan.
15243 * floatfns.c (isnan): #undef, and then #define to a clone of
15244 what's in data.c.
15245 (Fisnan): Always define, since it's always available now.
15246 (syms_of_floatfns): Always define isnan at the Lisp level.
15247
e39b275c 152482011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
15249
15250 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15251
b2db44d9 152522011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 15253
f4af5137 15254 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
15255 The previous code assumed that file offsets (off_t values) fit in
15256 EMACS_INT variables, which is not true on typical 32-bit hosts.
15257 The code messed up by falsely reporting buffer overflow in cases
15258 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15259 when "big" contains more than 2**29 bytes, even though this
15260 inserts just one byte and does not overflow the buffer.
15261 (Finsert_file_contents): Store file offsets as off_t
15262 values, not as EMACS_INT values. Check for overflow when
15263 converting between EMACS_INT and off_t. When checking for
15264 buffer overflow or for overlap, take the offsets into account.
15265 Don't use EMACS_INT for small values where int suffices.
15266 When checking for overlap, fix a typo: ZV was used where
15267 ZV_BYTE was intended.
15268 (Fwrite_region): Don't assume off_t fits into 'long'.
15269 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15270
ecfc0a49
MA
152712011-09-05 Michael Albinus <michael.albinus@gmx.de>
15272
15273 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15274
6511acf2 152752011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 15276
0999621a 15277 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
15278
15279 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 15280 (esprintf, exprintf, evxprintf): New functions.
62f19c19 15281 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 15282 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
15283 (modify_event_symbol): Do not assume that the length of
15284 name_alist_or_stem is safe to alloca and fits in int.
15285 (Fexecute_extended_command): Likewise for function name and binding.
15286 (Frecursion_depth): Wrap around reliably on integer overflow.
15287 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15288 since some callers pass EMACS_INT values.
15289 (Fsingle_key_description): Don't crash if symbol name contains more
15290 than MAX_ALLOCA bytes.
15291 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15292 (get_minibuffer): Arg is now EMACS_INT, not int.
15293 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 15294 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
15295 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15296
2be7d702
PE
15297 * dbusbind.c (signature_cat): New function.
15298 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
15299 Do not overrun buffer; instead, report string overflow.
15300
9d1df220
PE
15301 * dispnew.c (add_window_display_history): Don't overrun buffer.
15302 Truncate instead; this is OK since it's just a log.
15303
33ef5c64
PE
15304 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15305 even if the time zone offset is outlandishly large.
15306 Don't mishandle offset == INT_MIN.
15307
66c6fdd5
PE
15308 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15309 when creating daemon; the previous buffer-overflow check was incorrect.
15310
d749b01b
PE
15311 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15312 which has the guts of the old verror function.
15313
b5cd1905
PE
15314 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15315 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15316
6e1a67fb
PE
15317 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15318 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 15319 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 15320 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
15321 length of string rather than counting it via multiple sprintfs;
15322 that's simpler and more reliable.
c21721cc
PE
15323 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15324 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15325 sprintf, in case result does not fit in int.
15326
c57b67fc
PE
15327 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15328 (fontset_from_font): Print it.
15329
8a401434
PE
15330 * frame.c (tty_frame_count): Now printmax_t, not int.
15331 (make_terminal_frame, set_term_frame_name): Print it.
15332 (x_report_frame_params): In X, window IDs are unsigned long,
15333 not signed long, so print them as unsigned.
15334 (validate_x_resource_name): Check for implausibly long names,
15335 and don't assume name length fits in 'int'.
15336 (x_get_resource_string): Don't blindly alloca invocation name;
15337 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15338 not fit in int.
15339
6e1a67fb
PE
15340 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15341 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
15342 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15343
0df02bf3
PE
15344 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15345 Use esprintf, not sprintf, in case result does not fit in int.
15346
48e30793
PE
15347 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15348 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15349 it as a large positive number.
15350 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15351 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15352
a66ff6d8
PE
15353 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15354 in case result does not fit in int.
15355
aca216ff
PE
15356 * print.c (float_to_string): Detect width overflow more reliably.
15357 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15358 buffer overrun. Don't assume list length fits in 'int'. Treat
15359 print length of 0 as 0, not as infinity; to be consistent with other
15360 uses of print length in this function. Don't overflow print length
15361 index. Don't assume hash table size fits in 'long', or that
15362 vectorlike size fits in 'unsigned long'.
15363
31c286f7
PE
15364 * process.c (make_process): Use printmax_t, not int, to format
15365 process-name gensyms.
15366
55e5faa1
PE
15367 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15368
80f2e268
PE
15369 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15370 to avoid potential buffer overrun.
15371
670741ab
PE
15372 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15373 if X resource line is longer than 512 bytes.
15374
b7163a50
PE
15375 * xfns.c (x_window): Make sprintf buffer a bit bigger
15376 to avoid potential buffer overrun.
15377
ae58ff1f
PE
15378 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15379
c43c8a6a
PE
15380 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15381
3f8236f4
PE
153822011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15383
53e9fe90 15384 Integer overflow fixes for scrolling, etc.
6511acf2
PE
15385 Without these, Emacs silently mishandles large integers sometimes.
15386 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
15387 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15388
6511acf2
PE
15389 * xdisp.c (try_window_id): Check Emacs fixnum range before
15390 converting to 'int'.
806add1d 15391
6511acf2 15392 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
15393 Check that an Emacs fixnum is in range before assigning it to 'int'.
15394 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15395 values converted from Emacs fixnums.
15396 (Frecenter): Don't wrap around a line count if it is out of 'int'
15397 range; instead, treat it as an extreme value.
15398 (Fset_window_configuration, compare_window_configurations):
15399 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15400
6511acf2
PE
15401 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15402 that can exceed INT_MAX. Check that EMACS_INT value is in range
15403 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
15404 (match_limit): Don't assume that a fixnum can fit in 'int'.
15405
6511acf2 15406 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
15407 exceed INT_MAX.
15408
6511acf2 15409 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
15410 (Fvertical_motion): Don't wrap around LINES values that don't fit
15411 in 'int'. Instead, treat them as extreme values. This is good
15412 enough for windows, which can't have more than INT_MAX lines anyway.
15413
fcb901a7
LMI
154142011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15415
0f2f6b6d
LMI
15416 * Require libxml/parser.h to avoid compilation warning.
15417
fcb901a7
LMI
15418 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15419
15420 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15421 since this reportedly can destroy thread storage.
15422
6e20a0d4
CY
154232011-08-30 Chong Yidong <cyd@stupidchicken.com>
15424
15425 * syntax.c (find_defun_start): Update all cache variables if
15426 exiting early (Bug#9401).
15427
148ae00e
EZ
154282011-08-30 Eli Zaretskii <eliz@gnu.org>
15429
f6cfbd8f
EZ
15430 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15431
148ae00e
EZ
15432 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15433 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15434 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15435
15436 * term.c (tty_append_glyph): New function.
15437 (produce_stretch_glyph): Static function and its prototype deleted.
15438
a66cfb1c
SM
15439 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15440 Add prototypes.
148ae00e 15441
c4a07a4c
PE
154422011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15443
15444 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15445 when checking :margin (Bug#9390).
15446 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 15447 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
15448 so that the name doesn't mislead. All uses changed.
15449
6bc8cd65
JB
154502011-08-28 Johan Bockgård <bojohan@gnu.org>
15451
15452 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15453 set_tty_hooks.
15454
dca4927e
EZ
154552011-08-27 Eli Zaretskii <eliz@gnu.org>
15456
15457 * xdisp.c (move_it_to): Don't bail out early when reaching
15458 position beyond to_charpos, if we are scanning backwards.
15459 (move_it_vertically_backward): When DY == 0, make sure we get to
15460 the first character in the line after the newline.
15461
f2cad773
PE
154622011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15463
15464 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15465 (ccl_driver): Do not generate an out-of-range pointer.
15466 (Fccl_execute_on_string): Remove unnecessary check for
15467 integer overflow, noted by Stefan Monnier in
15468 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15469 Remove a FIXME that didn't need fixing.
15470 Simplify the newly-introduced buffer reallocation code.
15471
0cae2cdb
JB
154722011-08-27 Juanma Barranquero <lekktu@gmail.com>
15473
15474 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15475
5fc295a4 154762011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 15477
70c60eb2 15478 Integer and memory overflow issues (Bug#9196).
726e0ab1 15479
d31850da
PE
15480 * doc.c (get_doc_string): Rework so that
15481 get_doc_string_buffer_size is the actual buffer size, rather than
15482 being 1 less than the actual buffer size; this makes xpalloc more
15483 convenient.
15484
a69fbedb
PE
15485 * image.c (x_allocate_bitmap_record, cache_image):
15486 * xselect.c (Fx_register_dnd_atom):
15487 Simplify previous changes by using xpalloc.
15488
fe5c5d37
PE
15489 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15490 since either will do and ptrdiff_t is convenient with xpalloc.
15491
0065d054
PE
15492 * charset.c (charset_table_size)
15493 (struct charset_sort_data.priority): Now ptrdiff_t.
15494 (charset_compare): Don't overflow if priorities differ greatly.
15495 (Fsort_charsets): Don't assume list length fits in int.
15496 Check for size-calculation overflow when allocating sort data.
15497 (syms_of_charset): Allocate an initial charset table that is
15498 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15499
15500 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15501
15502 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15503 The actual value is always <= INT_MAX, and leaving it unsigned made
15504 overflow checking harder.
15505
15506 * dispextern.h (struct glyph_matrix.rows_allocated)
15507 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15508 with xpalloc. The values are still always <= INT_MAX.
15509
15510 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15511
15512 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15513 (SAFE_NALLOCA): New macro.
15514
15515 * region-cache.c (struct boundary.pos, find_cache_boundary)
15516 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15517 (set_cache_region, invalidate_region_cache)
15518 (revalidate_region_cache, know_region_cache, region_cache_forward)
15519 (region_cache_backward, pp_cache):
15520 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15521 so that ptrdiff_t * can be passed to xpalloc.
15522 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15523 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15524 (pp_cache): Don't assume cache_len fits in int.
15525 * region-cache.h: Adjust extern decls to match.
15526
15527 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15528 EMACS_INT, since either will do, for xpalloc.
15529
15530 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15531 (xnmalloc, xnrealloc, xpalloc): New functions.
15532
726e0ab1
PE
15533 * bidi.c (bidi_shelve_header_size): New constant.
15534 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15535 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15536
51f30bc5 15537 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
15538 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15539 (overlay_strings):
15540 Don't update size of array until after memory allocation succeeds,
15541 because xmalloc/xrealloc may not return.
0065d054
PE
15542 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15543 now that we have proper integer overflow checking.
15544 (record_overlay_string, overlay_strings): Catch overflows when
15545 calculating size of overlay_str_buf.
726e0ab1 15546
0065d054
PE
15547 * callproc.c (Fcall_process): Check for size overflow when
15548 calculating size of args2.
15549 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15550 Normally we prefer signed values, but sticking with ptrdiff_t would
15551 require adding more-complicated checks.
726e0ab1
PE
15552
15553 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15554 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15555 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 15556 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
15557
15558 * character.c (Fstring): Check for size-calculation overflow.
15559
15560 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15561 unnecessary integer overflow. Check for size overflow.
15562 (encode_coding_object): Don't update size until xmalloc succeeds.
15563
15564 * composite.c (get_composition_id): Check for overflow in glyph
15565 length calculations.
15566
15567 Integer and memory overflow fixes for display code.
15568 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15569 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15570 (scrolling_window): Check for overflow in size calculations.
15571 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15572 Don't assume glyph table len fits in int.
15573 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15574 (row_table_size): Now ptrdiff_t, not int.
15575 (scrolling_window): Avoid overflow in size calculations.
15576 Don't update size until allocation succeeds.
15577 * fns.c (concat): Check for overflow in size calculations.
15578 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15579 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15580 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15581
15582 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15583 (get_doc_string): Check for size calculation overflow.
15584 Don't update size until allocation succeeds.
15585 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15586 EMACS_INT, where ptrdiff_t will do.
15587 (Fsubstitute_command_keys): Check for string overflow.
15588
15589 * editfns.c (set_time_zone_rule): Don't assume environment length
15590 fits in int.
15591 (message_length): Now ptrdiff_t, not int.
15592 (Fmessage_box): Don't update size until allocation succeeds.
15593 Don't assume message length fits in int.
15594 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15595
0065d054
PE
15596 * emacs.c (main): Do not reallocate argv, since there is a null at
15597 the end that can be overwritten, and this way there's no need to
15598 worry about size-calculation overflow.
15599 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
15600
15601 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15602 alloc succeeds.
15603 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15604
15605 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15606 (x_set_scroll_bar_width, x_figure_window_size):
15607 Check for integer overflow.
15608 (x_set_alpha): Do not assume XINT fits in int.
15609
15610 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15611 This is for the members text_lines, text_cols, total_lines, total_cols,
15612 where the system imposes an 'int' limit.
15613
15614 * fringe.c (Fdefine_fringe_bitmap):
15615 Don't update size until alloc works.
15616
15617 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15618 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15619
15620 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15621 Check for size-calculation overflow.
15622 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15623 do, as we prefer signed integers.
15624 (id_to_widget.max_size, id_to_widget.used)
15625 (xg_store_widget_in_map, xg_remove_widget_from_map)
15626 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15627 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15628 Use and return ptrdiff_t, not int.
15629 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15630 * gtkutil.h: Change prototypes to match the above.
15631
15632 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15633 are duplicate now that they've been promoted to lisp.h.
15634 (x_allocate_bitmap_record, x_alloc_image_color)
15635 (make_image_cache, cache_image, xpm_load):
15636 Don't update size until alloc is done.
15637 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15638 (x_detect_edges):
3256efce 15639 Check for size calculation overflow.
726e0ab1
PE
15640 (ct_colors_allocated_max): New constant.
15641 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15642 overflow.
3256efce 15643
726e0ab1
PE
15644 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15645 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15646 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15647 Use ptrdiff_t, not int, to count maps.
15648 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
15649 calculations. Don't update size until allocation succeeds.
15650 Redo calculations to avoid overflow.
726e0ab1
PE
15651 * keyboard.h: Change prototypes to match the above.
15652
15653 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15654 to count maps.
15655 (current_minor_maps): Check for size calculation overflow.
15656 * keymap.h: Change prototypes to match the above.
15657
15658 * lread.c (read1, init_obarray): Don't update size until alloc done.
15659
15660 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15661 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15662
726e0ab1
PE
15663 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15664 Now ptrdiff_t, not int.
15665 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15666 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15667
15668 * process.c (Fnetwork_interface_list): Check for overflow
15669 in size calculation.
15670
15671 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15672
15673 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15674 overflow. Don't bother calling xmalloc when xrealloc will do.
15675
15676 * search.c (Freplace_match): Check for size calculation overflow.
15677 (Fset_match_data): Don't assume list lengths fit in 'int'.
15678
15679 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15680 for command line length. Do not attempt to address one before the
15681 beginning of an array, as that's not portable.
15682
15683 * term.c (max_frame_lines): Remove; unused.
15684 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15685 not int.
15686 (encode_terminal_code, calculate_costs): Check for size
15687 calculation overflow.
15688 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
15689 table lengths and related sizes. Don't update size until alloc
15690 done. Redo calculations to avoid overflow.
15691 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
15692
15693 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
15694 subtracting pointers.
15695 (gobble_line): Check for overflow more carefully. Don't update size
15696 until alloc done.
15697
15698 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
15699 Don't update size until alloc done.
15700 Redo size calculations to avoid overflow.
15701 Check for size calculation overflow.
0065d054 15702 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
15703
15704 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
15705 Use ptrdiff_t, not int, for sizes.
15706 (store_mode_line_noprop_char): Don't update size until alloc done.
15707
0065d054
PE
15708 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
15709 Use ptrdiff_t, not int, for sizes.
15710 (Finternal_make_lisp_face, cache_face):
15711 Check for size calculation overflow.
15712 (cache_face): Treat size calculation overflows as if they were
15713 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
15714
15715 * xfns.c (x_encode_text, x_set_name_internal)
15716 (Fx_change_window_property): Use ptrdiff_t, not int, to count
15717 sizes, since they can exceed INT_MAX in size. Check for size
15718 calculation overflow.
15719
0065d054
PE
15720 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
15721 (xg_select): Check for size calculation overflow.
726e0ab1
PE
15722 Don't update size until alloc done.
15723
0065d054 15724 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 15725 as sprintf is limited to int lengths.
1d526e2f 15726
252c5ee1
PE
15727 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
15728 (X_LONG_MIN): New macros.
864d7ce7
PE
15729 Use them to make the following changes clearer.
15730 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
15731 This change doesn't affect the value now, but it may help remind
15732 future maintainers not to raise the value too much later.
15733 (SELECTION_QUANTUM): Remove, replacing with ...
15734 (selection_quantum): ... new function, which avoids overflow.
15735 All uses changed.
15736 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
15737 assumption that selection length fits in 'int'.
15738 (x_reply_selection_request, x_handle_selection_request)
15739 (x_get_window_property, receive_incremental_selection)
15740 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
15741 (lisp_data_to_selection_data, clean_local_selection_data):
15742 Use ptrdiff_t, not int, to record length of selection.
15743 (x_reply_selection_request, x_get_window_property)
15744 (receive_incremental_selection, x_property_data_to_lisp):
15745 Redo calculations to avoid overflow.
15746 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 15747 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
15748 something.
15749 (x_get_window_property, receive_incremental_selection)
15750 (lisp_data_to_selection_data, x_property_data_to_lisp):
15751 Check for size-calculation overflow.
15752 (x_get_window_property, receive_incremental_selection)
15753 (lisp_data_to_selection_data, Fx_register_dnd_atom):
15754 Don't store size until memory allocation succeeds.
15755 (x_get_window_property): Plug memory leak on memory exhaustion.
15756 Don't double-block input; malloc is safe here. Don't assume 2**34
15757 - 4 fits in unsigned long. Add an xassert to check
15758 XGetWindowProperty overflow. Be more careful about overflow
15759 calculations, and distinguish size from memory overflow better.
15760 (receive_incremental_selection): When tracing, don't assume
15761 unsigned int is less than INT_MAX.
15762 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
15763 harmful) conversions of unsigned short to int.
15764 (lisp_data_to_selection_data): Don't assume that integers
15765 in the range -65535 through -1 fit in an X unsigned short.
15766 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
15767 result parameters unless successful. Rely on cons_to_unsigned
15768 to report problems with elements; the old code wasn't right anyway.
15769 (x_check_property_data): Check for int overflow; we cannot use
15770 a wider type due to X limits.
15771 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15772
726e0ab1 15773 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 15774
0065d054
PE
15775 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15776 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
15777 (x_color_cells): Don't store size until memory allocation succeeds.
15778 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 15779 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
15780 (x_term_init): Don't assume length fits in int (sprintf is limited
15781 to int size).
bc18e09d 15782
ebfa62c0
PE
15783 Use ptrdiff_t for composition IDs.
15784 * character.c (lisp_string_width):
15785 * composite.c (composition_table_size, n_compositions)
15786 (get_composition_id, composition_gstring_from_id):
15787 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15788 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15789 * window.c (Frecenter):
15790 Use ptrdiff_t, not int, for composition IDs.
15791 * composite.c (get_composition_id): Check for integer overflow.
15792 * composite.h: Adjust prototypes to match the above changes.
15793
d3411f89
PE
15794 Use ptrdiff_t for hash table indexes.
15795 * category.c (hash_get_category_set):
15796 * ccl.c (ccl_driver):
15797 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15798 * coding.c (coding_system_charset_list, detect_coding_system):
15799 * coding.h (struct coding_system.id):
15800 * composite.c (get_composition_id, gstring_lookup_cache):
15801 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15802 * image.c (xpm_get_color_table_h):
15803 * lisp.h (hash_lookup, hash_put):
15804 * minibuf.c (Ftest_completion):
15805 Use ptrdiff_t for hash table indexes, not int (which is too
15806 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15807 32-bit --with-wide-int hosts).
15808
e097a6fa
PE
15809 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15810 Add a FIXME comment about memory leaks.
15811 (syms_of_charset): Don't assume xmalloc returns.
15812
5637687f
PE
15813 Don't assume that stated character widths fit in int.
15814 * character.c (Fchar_width, c_string_width, lisp_string_width):
15815 * character.h (CHAR_WIDTH):
15816 * indent.c (MULTIBYTE_BYTES_WIDTH):
15817 Use sanitize_char_width to avoid undefined and/or bad behavior
15818 with outlandish widths.
a66cfb1c 15819 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
15820 now that we have two such functions. All uses changed.
15821 (sanitize_char_width): New inline function.
15822
a2271ba2
PE
15823 Don't assume that tab-width fits in int.
15824 * character.h (sanitize_width): New inline function.
15825 (SANE_TAB_WIDTH): New macro.
15826 (ASCII_CHAR_WIDTH): Use it.
15827 * indent.c (sane_tab_width): Remove. All uses replaced by
15828 SANE_TAB_WIDTH (current_buffer).
15829 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
15830
18c52557
PE
15831 * fileio.c: Integer overflow issues with file modes.
15832 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
15833
caeeedc1
PE
15834 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
15835 Remove unreachable code.
15836 (read_hex, load_charset_map_from_file): Check for integer overflow.
15837
6df6ae42 15838 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
15839 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
15840 (x_send_scroll_bar_event): Likewise. Check that the size does not
15841 exceed limits imposed by XClientMessageEvent, as well as the usual
15842 ptrdiff_t and size_t limits.
15843
b13995db
PE
15844 * keyboard.c: Overflow, signedness and related fixes.
15845 (make_lispy_movement): Use same integer type in forward decl
15846 that is used in the definition.
15847 (read_key_sequence, keyremap_step):
15848 Change bufsize argument back to int, undoing my 2011-03-30 change.
15849 We prefer signed types, and int is wide enough here.
15850 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
15851 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
15852 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
15853 length, not size_t. Use ptrdiff_t for index, not int.
15854 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
15855 possibility of integer overflow.
15856
13464394
PE
15857 Overflow, signedness and related fixes for images.
15858
15859 * dispextern.h (struct it.stack[0].u.image.image_id)
15860 (struct_it.image_id, struct image.id, struct image_cache.size)
15861 (struct image_cache.used, struct image_cache.ref_count):
15862 * gtkutil.c (update_frame_tool_bar):
15863 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
15864 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
15865 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
15866 * nsmenu.m (update_frame_tool_bar):
15867 * xdisp.c (calc_pixel_width_or_height):
15868 * xfns.c (image_cache_refcount):
15869 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
15870 on typical 64-bit hosts.
15871
15872 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15873 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
15874 Omit unnecessary casts to int.
15875 (parse_image_spec): Check that integers fall into 'int' range
15876 when the callers expect that.
15877 (image_ascent): Redo ascent calculation to avoid int overflow.
15878 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
15879 (lookup_image): Remove unnecessary tests.
15880 (xbm_image_p): Locals are now of int, not EMACS_INT,
15881 since parse_image_check makes sure they fit into int.
15882 (png_load, gif_load, svg_load_image):
15883 Prefer int to unsigned where either will do.
15884 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
15885 old tiff_error_handler and tiff_warning_handler.
15886 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
15887 stack buffer overflows. It uses only the features of vsnprintf
15888 that are common to both POSIX and native Microsoft.
15889 (tiff_error_handler, tiff_warning_handler): Use it.
15890 (tiff_load, gif_load, imagemagick_load_image):
15891 Don't assume :index value fits in 'int'.
15892 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
15893 (imagemagick_load_image): Check that crop parameters fit into
15894 the integer types that MagickCropImage accepts. Don't assume
15895 Vimagemagick_render_type has a nonnegative value. Don't assume
15896 size_t fits in 'long'.
15897 (gs_load): Use printmax_t to print the widest integers possible.
15898 Check for integer overflow when computing image height and width.
15899
c11821d4
EZ
159002011-08-26 Eli Zaretskii <eliz@gnu.org>
15901
15902 * xdisp.c (redisplay_window): Don't force window start if point
15903 will be invisible in the resulting window. (Bug#9324)
15904
0c95fcf7
EZ
159052011-08-25 Eli Zaretskii <eliz@gnu.org>
15906
15907 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
15908 the display spec is of the form `(space ...)'.
15909 (handle_display_spec): Return the value returned by
15910 handle_single_display_spec, not just 1 or zero.
15911 (handle_single_display_spec): If the display spec is of the form
15912 `(space ...)', and specifies display in the text area, return 2
15913 rather than 1.
fee65a97 15914 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
15915 accurately, and prefer exact match for point under bidi.
15916 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
15917
15918 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
15919 into disp_prop; all users changed.
15920
15921 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
15922 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
15923 for the text covered by the display property.
15924
e4ed06f1
CY
159252011-08-25 Chong Yidong <cyd@stupidchicken.com>
15926
15927 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
15928 Change return value to nil.
15929 (Frecord_buffer): Delete unused function.
15930
f67cdd7f
EZ
159312011-08-24 Eli Zaretskii <eliz@gnu.org>
15932
5980d4c6
EZ
15933 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
15934 buffers, return left-to-right.
8610fe8b
EZ
15935 (set_cursor_from_row): Consider candidate row a win if its glyph
15936 represents a newline and point is on that newline. Fixes cursor
15937 positioning on the newline at EOL of R2L text within L2R
15938 paragraph, and vice versa.
15939 (try_cursor_movement): Check continued rows, in addition to
15940 continuation rows. Fixes unwarranted scroll when point enters a
15941 continued line of R2L text within an L2R paragraph, or vice versa.
15942 (cursor_row_p): Consider the case of point being equal to
15943 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
15944 from the end of a short line to the beginning of a continued line
15945 of R2L text within L2R paragraph.
15946 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
15947 composed characters.
5980d4c6 15948
f67cdd7f
EZ
15949 * bidi.c (bidi_check_type): Use xassert.
15950 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
15951 members.
15952
bca633fb
EZ
159532011-08-23 Eli Zaretskii <eliz@gnu.org>
15954
15955 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
15956 a character.
15957
4a5885a7
CY
159582011-08-23 Chong Yidong <cyd@stupidchicken.com>
15959
15960 * nsfont.m (ns_otf_to_script): Fix typo.
15961
0902a04e
KH
159622011-08-22 Kenichi Handa <handa@m17n.org>
15963
15964 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
15965 extra slot even if the purpose is char-code-property-table.
15966
1a2e6670
EZ
159672011-08-23 Eli Zaretskii <eliz@gnu.org>
15968
8ddde651
EZ
15969 * xdisp.c (redisplay_window): When computing centering_position,
15970 account for the height of the header line. (Bug#8874)
15971
425cc014
EZ
15972 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
15973 instead of CHAR_TO_BYTE. Fixes a crash when a completion
15974 candidate is selected by the mouse, and that candidate has a
15975 composed character under the mouse.
15976
1a2e6670
EZ
15977 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
15978 coordinates reported by pos-visible-in-window-p for a composed
15979 character in column zero.
15980
8b76d6f8
SM
159812011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
15982
15983 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
15984
dac347dd
EZ
159852011-08-22 Eli Zaretskii <eliz@gnu.org>
15986
15987 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
15988 consider it a hit if to_charpos is anywhere in the range of the
15989 composed buffer positions.
15990
e013fb34
CY
159912011-08-22 Chong Yidong <cyd@stupidchicken.com>
15992
15993 * image.c (gif_load): Don't assume that each subimage has the same
15994 dimensions as the base image. Handle disposal method that is
15995 "undefined" by the gif spec (Bug#9335).
15996
bd1ba3e8
CY
159972011-08-20 Chong Yidong <cyd@stupidchicken.com>
15998
15999 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 16000 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 16001
54a1215b
EZ
160022011-08-19 Eli Zaretskii <eliz@gnu.org>
16003
823564e5
EZ
16004 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16005 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16006 from an Org mode buffer to a Speedbar frame.
16007
54a1215b
EZ
16008 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16009 a composition, take its buffer position from IT->cmp_it.charpos.
16010 Fixes cursor positioning at the beginning of a line that begins
16011 with a composed character.
16012
9778ebcc
EZ
160132011-08-18 Eli Zaretskii <eliz@gnu.org>
16014
0be6ee06
EZ
16015 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16016 character bidirectional type, use STRONG_L instead. Fixes crashes
16017 in a buffer produced by `describe-categories'.
16018
9778ebcc
EZ
16019 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16020 members before the level stack, so they would be saved and
16021 restored when copying iterator state. Fixes incorrect reordering
16022 around TABs covered by display properties.
16023
156bffbe
AS
160242011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16025
6b02f655 16026 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 16027
72ad093b
CY
160282011-08-17 Chong Yidong <cyd@stupidchicken.com>
16029
16030 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
16031 (internal_condition_case_2, internal_condition_case_n):
16032 Remove unnecessary aborts (Bug#9081).
72ad093b 16033
35774242
EZ
160342011-08-17 Eli Zaretskii <eliz@gnu.org>
16035
16036 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16037 has no `load' handler, try opening the file locally. (Bug#9311)
16038
db76dd85
KB
160392011-08-16 Ken Brown <kbrown@cornell.edu>
16040
16041 * gmalloc.c: Expand comment.
16042
b215eee5
EZ
160432011-08-16 Eli Zaretskii <eliz@gnu.org>
16044
16045 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16046 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16047
a4579d33
KB
160482011-08-16 Ken Brown <kbrown@cornell.edu>
16049
16050 Fix memory allocation problems in Cygwin build (Bug#9273).
16051
16052 * unexcw.c ( __malloc_initialized): Declare external variable.
16053 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16054
8b76d6f8
SM
16055 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16056 New variables.
a4579d33
KB
16057 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16058 dumped emacs.
16059 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16060 in the static heap.
16061 [CYGWIN] (special_realloc): New function.
16062 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16063 requests to realloc storage in the static heap.
16064
3ebec551
PE
160652011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16066
16067 * bidi.c (bidi_initialize): Remove unused local.
16068
9fd8be00
EZ
160692011-08-15 Eli Zaretskii <eliz@gnu.org>
16070
6b02f655
SM
16071 * bidimirror.h:
16072 * biditype.h: Remove file.
16073 * makefile.w32-in ($(BLD)/bidi.$(O)):
16074 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
16075
16076 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16077
16078 * chartab.c: Improve commentary for the uniprop_table API.
16079
32413314
EZ
16080 * bidi.c (bidi_paragraph_init): Support zero value of
16081 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
16082 (bidi_initialize): Use uniprop_table instead of including
16083 biditype.h and bidimirror.h.
32413314 16084
9fd8be00
EZ
16085 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16086 coordinates of the iterator when restoring from ppos_it.
16087 (Bug#9296)
16088
5cf2b69b
KH
160892011-08-14 Kenichi Handa <handa@m17n.org>
16090
16091 * process.c (create_process): Call setup_process_coding_systems
72ad093b 16092 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 16093
daf17d00
EZ
160942011-08-14 Eli Zaretskii <eliz@gnu.org>
16095
16096 * xdisp.c (move_it_in_display_line_to): Don't invoke
16097 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16098 ppos_it. Fixes vertical cursor motion when line beginning is
16099 covered by an image. (Bug#9296)
16100
08e3161a
JD
161012011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16102
16103 * nsterm.h (ns_run_ascript): Declare.
16104 (NSAPP_DATA2_RUNASSCRIPT): Define.
16105
16106 * nsfns.m (as_script, as_result, as_status): New static variables.
16107 (ns_run_ascript): New function.
5e617bc2 16108 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
16109 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16110 the event loop. Get status from as_status (Bug#7276).
16111
16112 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16113 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16114 the event loop (Bug#7276).
16115
a3720aa2
AS
161162011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16117
16118 * gnutls.c (QCgnutls_bootprop_priority)
16119 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16120 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16121 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16122 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16123 (QCgnutls_bootprop_verify_hostname_error)
16124 (QCgnutls_bootprop_callbacks_verify): Rename from
16125 Qgnutls_bootprop_..., all uses changed.
16126
16127 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16128 uses changed.
16129
0a0d27fb
PE
161302011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16131
19d5c50c
PE
16132 * xfaces.c (Qframe_set_background_mode): Now static.
16133 * dispextern.h (Qframe_set_background_mode): Remove decl.
16134
0a0d27fb
PE
16135 * process.c (Fnetwork_interface_info): Declare local only if needed.
16136
377538cb
JD
161372011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16138
16139 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16140 (Fnetwork_interface_list): Allocate in increments of bytes instead
16141 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16142 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16143 sockaddr.
16144 (struct ifflag_def): notrailers is smart on OSX.
16145 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16146 Get hardware address with getifaddrs if available.
16147
08fff70c
EZ
161482011-08-12 Eli Zaretskii <eliz@gnu.org>
16149
16150 * xdisp.c (iterate_out_of_display_property): xassert that
16151 IT->position is set to within IT->object's boundaries. Break from
16152 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
16153 when IT->position is set up wrongly due to some bug.
16154 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
16155 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16156 entry. Force push_it to save on the stack the current
16157 buffer/string position, to be restored by pop_it. Fix flags in
16158 the iterator structure wrt the object coming from a display
16159 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16160 properties. (Bug#9284)
16161
7be1c708 161622011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 16163
7be1c708
CY
16164 * fontset.c (fontset_get_font_group): Add proper type checks.
16165 (Bug#9172)
aac0c6e3 16166
7be1c708 161672011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 16168
7be1c708
CY
16169 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16170 and LC_VERSION_MIN_MACOSX.
16171 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16172 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 16173
97bb72a6
EZ
161742011-08-08 Eli Zaretskii <eliz@gnu.org>
16175
16176 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
16177 no-display-properties-and-no-overlays under bidi display.
16178 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 16179 properties and overlays.
97bb72a6 16180
d5617611
CY
161812011-08-08 Chong Yidong <cyd@stupidchicken.com>
16182
37e11a63
CY
16183 * editfns.c (Fset_time_zone_rule): Document relationship with the
16184 setenv function.
16185
d5617611
CY
16186 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16187 the font entity extracted from the cache (Bug#8109).
16188
58872834
CY
161892011-08-07 Chong Yidong <cyd@stupidchicken.com>
16190
16191 * composite.c (autocmp_chars): Don't reset point. That is done by
16192 restore_point_unwind (Bug#5984).
16193
75bfc667
JL
161942011-08-07 Juri Linkov <juri@jurta.org>
16195
16196 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16197 to show the arg `TIME' instead of `TIMEVAL'.
16198
d1410150
EZ
161992011-08-06 Eli Zaretskii <eliz@gnu.org>
16200
16201 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16202 display property strides EOL and includes a newline, as in
16203 longlines-mode. (Bug#9254)
75b771e4
EZ
16204 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16205 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
16206
16207 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16208 is non-zero, even if the data buffer is NULL. Fixes a crash in
16209 vertical-motion with longlines-mode. (Bug#9254)
16210
35928349
EZ
162112011-08-05 Eli Zaretskii <eliz@gnu.org>
16212
ec7cc85b
EZ
16213 * bidi.c <bidi_cache_total_alloc>: Now static.
16214 (bidi_initialize): Initialize bidi_cache_total_alloc.
16215
8b76d6f8 16216 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
16217 cache. (Bug#9221)
16218
16219 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16220 amount allocated this far in `bidi_cache_total_alloc'.
16221 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16222 non-zero, only free the data buffer without restoring the cache
16223 contents. All callers changed.
16224
16225 * dispextern.h (bidi_unshelve_cache): Update prototype.
16226
16227 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16228 (move_it_in_display_line, move_it_to)
16229 (move_it_vertically_backward, move_it_by_lines): Replace the call
16230 to xfree to an equivalent call to bidi_unshelve_cache.
16231 (move_it_in_display_line_to): Fix logic of returning
412b6358 16232 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 16233
e2e2423b
EZ
162342011-08-05 Eli Zaretskii <eliz@gnu.org>
16235
16236 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16237 came from a string character with a `cursor' property. (Bug#9229)
16238
ae9e757a
JD
162392011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16240
16241 * Makefile.in (LIB_PTHREAD): New variable.
16242 (LIBES): Add LIB_PTHREAD (Bug#9216).
16243
16244 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16245 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16246
213bd7f2
AS
162472011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16248
6b02f655 16249 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 16250
99aaf75f
JD
162512011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16252
16253 * xterm.c (x_find_topmost_parent): New function.
16254 (x_set_frame_alpha): Find topmost parent window with
16255 x_find_topmost_parent and set the property there also (bug#9181).
16256 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16257
c74e9d86
PE
162582011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16259
16260 * callproc.c (Fcall_process): Avoid vfork clobbering
16261 the local vars buffer, coding_systems, current_dir.
16262
640c8776
SM
162632011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16264
16265 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16266
f26d0e4c
PE
162672011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16268
8a10d76c
PE
16269 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16270 so that it is not optimized away.
16271
f26d0e4c
PE
16272 * xdisp.c (compute_display_string_pos): Remove unused local.
16273
55439c61
EZ
162742011-08-02 Eli Zaretskii <eliz@gnu.org>
16275
16276 Fix slow cursor motion and scrolling in large buffers with
16277 selective display, like Org Mode buffers. (Bug#9218)
16278
16279 * dispextern.h (struct bidi_it): New member disp_prop_p.
16280
16281 * xdisp.c: Remove one-slot cache of display string positions.
16282 (compute_display_string_pos): Accept an additional argument
5e617bc2 16283 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
16284 for a display string or property. If found, set DISP_PROP_P
16285 non-zero.
16286
16287 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
16288 DISP_PROP_P, and pass it to compute_display_string_pos.
16289 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
16290 non-zero. All callers of bidi_fetch_char changed.
16291
fb33fa43
SM
162922011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16293
16294 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16295
b099e063
DM
162962010-12-03 Don March <don@ohspite.net>
16297
16298 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16299 last character M-[char] is translated to ESC [char] (bug#7541).
16300
5cc7f7af
KH
163012011-08-02 Kenichi Handa <handa@m17n.org>
16302
d0fffa3f 16303 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
16304
16305 * chartab.c (uniprop_table): Make it non-static.
16306
525d5e6e
EZ
163072011-08-01 Eli Zaretskii <eliz@gnu.org>
16308
16309 * xdisp.c (forward_to_next_line_start): Accept additional argument
16310 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16311 on the newline.
16312 (reseat_at_next_visible_line_start): Use the bidi iterator state
16313 returned by forward_to_next_line_start to restore the state of
16314 it->bidi_it after backing up to previous newline. (Bug#9212)
16315
31011111
AS
163162011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16317
16318 * regex.c (re_comp): Protoize.
16319 (re_exec): Fix return type.
16320 (regexec): Fix type of `ret'. (Bug#9203)
16321
476371c4
PE
163222011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16323
e5d76069
PE
16324 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16325 This is needed if max-image-size is a floating-point number.
16326
9a79b20c
AS
163272011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16328
16329 * print.c (print_object): Print empty symbol as ##.
16330
16331 * lread.c (read1): Read ## as empty symbol.
16332
d8c2fa78
AA
163332011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16334
16335 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16336 setting frame foreground color (Bug#9175).
16337 (x_set_background_color): Likewise.
16338
ffe57a7a
AA
16339 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16340 contents (Bug#9176).
16341 (EmacsTooltip -init): Remove bezels and add shadows to
16342 tooltip windows.
16343
bf3492a5
AA
16344 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16345 or scroll bar (Bug#8470).
16346
d55e9c53
AA
16347 * nsfont.m (nsfont_open): Remove assignment to voffset and
16348 unnecessary vars hshink, expand, hd, full_height, min_height.
16349 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16350
16351 * nsterm.h (nsfont_info): Remove voffset field.
16352
d8c2fa78 163532011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
16354
16355 Implement strike-through and overline on NextStep (Bug#8863).
16356
16357 * nsfont.m (nsfont_open): Use underline position provided by font,
16358 instead of hard-coded value of 2.
16359 (nsfont_draw): Call ns_draw_text_decoration instead.
16360
16361 * nsterm.h: Add declaration for ns_draw_text_decoration.
16362
16363 * nsterm.m (ns_draw_text_decoration): New function for drawing
16364 underline, overline, and strike-through.
16365 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16366 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 16367 accommodate underlining, etc.
4843aac3 16368
4cc60b9b
EZ
163692011-07-28 Eli Zaretskii <eliz@gnu.org>
16370
bc7ece87
EZ
16371 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16372 default.
4cc60b9b 16373
476371c4
PE
163742011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16375
66606eea
PE
16376 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16377 Without this fix, if a signal arrives just after memory fills up,
16378 'malloc' might be invoked reentrantly.
16379
476371c4
PE
16380 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16381 In other words, assume that every image size is allowed, on non-X
16382 hosts. This assumption is probably wrong, but it lets Emacs compile.
16383
f3fcc40d
AS
163842011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16385
16386 * regex.c (re_iswctype): Convert return values to boolean.
16387
350c992f
EZ
163882011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16389
16390 * xdisp.c (compute_display_string_pos): Don't use cached display
16391 string position if the buffer had its restriction changed.
16392 (Bug#9184)
16393
5266b4bb
PE
163942011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16395
16396 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16397
2573a837 163982011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 16399
41f55ccd 16400 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 16401
39e378da
PE
16402 * bidi.c: Integer size and overflow fixes.
16403 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16404 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16405 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16406 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16407 (bidi_find_other_level_edge):
16408 Use ptrdiff_t instead of EMACS_INT where either will do.
16409 This works better on 32-bit hosts configured --with-wide-int.
16410 (bidi_cache_ensure_space): Check for size-calculation overflow.
16411 Use % rather than repeated addition, for better worst-case speed.
16412 Don't set bidi_cache_size until after xrealloc returns, because it
16413 might not return.
16414 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
16415 (bidi_cache_ensure_space): Also check that the bidi cache size
16416 does not exceed that of the largest Lisp string or buffer. See Eli
16417 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 16418
5e927815
PE
16419 * alloc.c (__malloc_size_t): Remove.
16420 All uses replaced by size_t. See Andreas Schwab's note
16421 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16422
ca4aa935
PE
16423 * image.c: Improve checking for integer overflow.
16424 (check_image_size): Assume that f is nonnull, since
16425 it is always nonnull in practice. This is one less thing to
16426 worry about when checking for integer overflow later.
16427 (x_check_image_size): New function, which checks for integer
16428 overflow issues inside X.
16429 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16430 This removes the need for a memory_full check.
16431 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16432 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16433 (xbm_read_bitmap_data): Change locals back to 'int', since
16434 their values must fit in 'int'.
16435 (xpm_load_image, png_load, tiff_load):
16436 Invoke x_create_x_image_and_pixmap earlier,
16437 to avoid much needless work if the image is too large.
16438 (tiff_load): Treat overly large images as if
16439 x_create_x_image_and_pixmap failed, not as malloc failures.
16440 (gs_load): Use x_check_image_size.
16441
5f8f9cc2
PE
16442 * gtkutil.c: Omit integer casts.
16443 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16444 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16445
5adf60bc
PE
16446 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16447
c8907a93
PE
16448 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16449 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16450 would wrongly return t on a 64-bit host.
16451
e3c25c68
PE
16452 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16453 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16454 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16455 and therefore cause GCC to emit a bogus diagnostic in some cases.
16456
3f791afe
PE
16457 * image.c: Integer signedness and overflow and related fixes.
16458 This is not an exhaustive set of fixes, but it's time to
16459 record what I've got.
16460 (lookup_pixel_color, check_image_size): Remove redundant decls.
16461 (check_image_size): Don't assume that arbitrary EMACS_INT values
16462 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16463 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16464 (tiff_load, imagemagick_load_image):
16465 Check for overflow in size calculations.
16466 (x_create_x_image_and_pixmap): Remove unnecessary test for
16467 xmalloc returning NULL; that can't happen.
16468 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16469 (xpm_color_bucket): Use better integer hashing function.
16470 (xpm_cache_color): Don't possibly over-allocate memory.
16471 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16472 (gif_memory_source):
16473 Use ptrdiff_t, not int or size_t, to record sizes.
16474 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16475 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16476 either works, as we prefer signed integers.
16477 (tiff_read_from_memory, tiff_write_from_memory):
16478 Return tsize_t, not size_t, since that's what the TIFF API wants.
16479 (tiff_read_from_memory): Don't fail simply because the read would
16480 go past EOF; instead, return a short read.
16481 (tiff_load): Omit no-longer-needed casts.
16482 (Fimagemagick_types): Don't assume size fits into 'int'.
16483
3cc5a532
PE
16484 Improve hashing quality when configured --with-wide-int.
16485 * fns.c (hash_string): New function, taken from sxhash_string.
16486 Do not discard information about ASCII character case; this
16487 discarding is no longer needed.
16488 (sxhash-string): Use it. Change sig to match it. Caller changed.
16489 * lisp.h: Declare it.
16490 * lread.c (hash_string): Remove, since we now use fns.c's version.
16491 The fns.c version returns a wider integer if --with-wide-int is
16492 specified, so this should help the quality of the hashing a bit.
16493
b312a492
PE
16494 * emacs.c: Integer overflow minor fix.
16495 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16496 Define only if GNU_LINUX.
16497 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16498
dfd153ae
PE
16499 * dispnew.c: Integer signedness and overflow fixes.
16500 Remove unnecessary forward decls, that were a maintenance hassle.
16501 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16502 All uses changed.
16503 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16504 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16505 (prepare_desired_row, line_draw_cost):
16506 Use int, not unsigned, where either works.
16507 (save_current_matrix, restore_current_matrix):
16508 Use ptrdiff_t, not size_t, where either works.
16509 (init_display): Check for overflow more accurately, and without
16510 relying on undefined behavior.
16511
a81d11a3
PE
16512 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16513 Remove, replacing with the new symbols in lisp.h. All uses changed.
16514 * fileio.c (make_temp_name):
16515 * filelock.c (lock_file_1, lock_file):
16516 * xdisp.c (message_dolog):
16517 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16518 Use pMd etc. instead.
16519 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16520 replacing the pWIDE etc. symbols removed from editfns.c.
16521
3300e6fd
PE
16522 * keyboard.h (num_input_events): Now uintmax_t.
16523 This is (very slightly) less likely to mess up due to wraparound.
16524 All uses changed.
16525
fd05c7e9
PE
16526 * buffer.c: Integer signedness fixes.
16527 (alloc_buffer_text, enlarge_buffer_text):
16528 Use ptrdiff_t rather than size_t when either will do, as we prefer
16529 signed integers.
16530
903fe15d
PE
16531 * alloc.c: Integer signedness and overflow fixes.
16532 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16533 (__malloc_size_t): Default to size_t, not to int.
16534 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16535 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16536 Prefer ptrdiff_t to size_t when either would do, as we prefer
16537 signed integers.
16538 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16539 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16540 Now const. Initialize with values that are in range even if char
16541 is signed.
16542 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16543 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16544 These functions do the right thing with sizes > 2**32.
16545 (check_depth): Now ptrdiff_t, not int.
16546 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16547 Adjust to new way of storing sizes. Check for size overflow bugs
16548 in rest of code.
16549 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16550 slightly wrong anyway, as it missed one instance of
16551 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16552 (refill_memory_reserve): Omit needless cast to size_t.
16553 (mark_object_loop_halt): Mark as externally visible.
16554
ac82cc6a
PE
16555 * xselect.c: Integer signedness and overflow fixes.
16556 (Fx_register_dnd_atom, x_handle_dnd_message):
16557 Use ptrdiff_t, not size_t, since we prefer signed.
16558 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16559 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16560 x_dnd_atoms_size and x_dnd_atoms_length.
16561
c2d1e36d
PE
16562 * doprnt.c: Prefer signed to unsigned when either works.
16563 * eval.c (verror):
16564 * doprnt.c (doprnt):
16565 * lisp.h (doprnt):
16566 * xdisp.c (vmessage):
16567 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16568 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16569 prefer signed arithmetic to avoid comparison confusion.
16570 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16571 but is a bit tricky.
16572
0e926e56
PE
16573 Assume freestanding C89 headers, string.h, stdlib.h.
16574 * data.c, doprnt.c, floatfns.c, print.c:
16575 Include float.h unconditionally.
16576 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16577 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16578 * regex.c: Likewise for stddef.h, string.h.
16579 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16580 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16581 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16582 (STDC_HEADERS): Remove obsolete defines.
16583 * sysdep.c: Include limits.h unconditionally.
16584
9cfdb3ec
PE
16585 Assume support for memcmp, memcpy, memmove, memset.
16586 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16587 * regex.c (memcmp, memcpy):
16588 Remove; we assume C89 now.
16589
16590 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16591 (__malloc_safe_bcopy): Remove; no longer needed.
16592
cf950e6b 16593 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
16594 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16595 well either way, and we prefer signed to unsigned.
16596
dbf38e02
LMI
165972011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16598
16599 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16600 closes the connection while we're reading (bug#9182).
16601
d6f0886c 166022011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 16603
d6f0886c
JD
16604 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16605 are specified (Bug#9168).
24e0f6b1 16606
2eb1f9e6
PE
166072011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16608
16609 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16610 Found by GCC static checking and --with-wide-int on a 32-bit host.
16611
22381272 166122011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
16613
16614 * xdisp.c (compute_display_string_pos): Fix logic of caching
16615 previous display string position. Initialize cached_prev_pos to
16616 -1. Fixes slow-down at the beginning of a buffer.
16617
f25e39b4
EZ
166182011-07-24 Eli Zaretskii <eliz@gnu.org>
16619
16620 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16621 for attrs[LFACE_FONTSET_INDEX].
16622
04c4b52e
PE
166232011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16624
16625 * xml.c (parse_region): Remove unused local
16626 that was recently introduced.
16627
c1734fbd
EZ
166282011-07-23 Eli Zaretskii <eliz@gnu.org>
16629
be18c5a5
EZ
16630 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16631 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16632
c1734fbd
EZ
16633 * xdisp.c (move_it_in_display_line_to): Record the best matching
16634 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
16635 exit if none of the characters scanned was an exact match.
16636 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
16637 when exact match is impossible due to invisible text, and the
16638 lines are truncated.
16639
a258d627
JD
166402011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16641
16642 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16643 for OSX >= 10.7.
16644
b6d5a689
EZ
166452011-07-22 Eli Zaretskii <eliz@gnu.org>
16646
0f74f785
EZ
16647 Fix a significant slow-down of cursor motion with C-n, C-p,
16648 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16649 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 16650 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
16651 (next_element_from_buffer): Call compute_stop_pos_backwards to
16652 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
16653 base_level_stop.
16654 (reseat): Don't look for prev_stop, as that could mean a very long
16655 run.
16656 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16657 <cached_disp_overlay_modiff>: Cache for last found display string
16658 position.
551918c1 16659 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
16660 about the same buffer in the same area of character positions, and
16661 the buffer wasn't changed since the time the display string
16662 position was cached.
551918c1 16663
b2d0c91a
EZ
166642011-07-22 Eli Zaretskii <eliz@gnu.org>
16665
16666 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16667 is an integer, which is important for empty lines. (Bug#9149)
16668
043604ee
CY
166692011-07-22 Chong Yidong <cyd@stupidchicken.com>
16670
16671 * frame.c (Fmodify_frame_parameters): In tty case, update the
16672 default face if necessary (Bug#4238).
16673
da4adb04
CY
166742011-07-21 Chong Yidong <cyd@stupidchicken.com>
16675
16676 * editfns.c (Fstring_to_char): No need to explain what a character
16677 is in the docstring (Bug#6576).
16678
9abd0532
LMI
166792011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16680
16681 * xml.c (parse_region): Make sure we always return a tree.
16682
36881d16
HK
166832011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16684
16685 * xml.c (parse_region): If a document contains only comments,
16686 return that, too.
16687
1e98674d
LMI
166882011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16689
16690 * xml.c (make_dom): Return comments, too.
16691
590bd467
PE
166922011-07-19 Paul Eggert <eggert@cs.ucla.edu>
16693
16694 Port to OpenBSD.
16695 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
16696 and the surrounding thread.
16697 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
16698 rather than fgets, and retry after EINTR. Otherwise, 'emacs
16699 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
16700 timer goes off.
16701 * s/openbsd.h (BROKEN_SIGIO): Define.
16702 * unexelf.c (unexec) [__OpenBSD__]:
16703 Don't update the .mdebug section of the Alpha COFF symbol table.
16704
f41628b2
LMI
167052011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16706
16707 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
16708 (bug#8460).
16709
b59b67c5
PE
167102011-07-18 Paul Eggert <eggert@cs.ucla.edu>
16711
15e3a074
PE
16712 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
16713 This fixes some race conditions on the permissions of any newly
16714 created file.
16715
41bed37d
PE
16716 * alloc.c (valid_pointer_p): Use pipe, not open.
16717 This fixes some permissions issues when debugging.
16718
b59b67c5
PE
16719 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
16720 If fchown fails to set both uid and gid, try to set just gid,
16721 as that is sometimes allowed. Adjust the file's mode to eliminate
16722 setuid or setgid bits that are inappropriate if fchown fails.
16723
925a6be7
SM
167242011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16725
16726 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
16727 to compare Lisp_Objects.
16728 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
16729 global_gnutls_log_level, don't mistake it for a Lisp_Object.
16730 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
16731
52968808
AS
167322011-07-17 Andreas Schwab <schwab@linux-m68k.org>
16733
0a6a104b
AS
16734 * lread.c (read_integer): Unread even EOF character.
16735 (read1): Likewise. Properly record start position of symbol.
16736
52968808
AS
16737 * lread.c (read1): Read `#:' as empty uninterned symbol if no
16738 symbol character follows.
16739
9e381cdd
PE
167402011-07-17 Paul Eggert <eggert@cs.ucla.edu>
16741
16742 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
16743 This works around a problem with the previous change to Fcopy_file.
16744 Recent glibc declares fchown with __attribute__((warn_unused_result)),
16745 and without this change, GCC might complain about discarding
16746 fchown's return value.
16747
b5641435
JB
167482011-07-16 Juanma Barranquero <lekktu@gmail.com>
16749
16750 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
16751
a8031457
PE
167522011-07-16 Paul Eggert <eggert@cs.ucla.edu>
16753
16754 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
16755
dd889327
LMI
167562011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
16757
750c33f7
LMI
16758 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
16759 it's used from the C level.
16760
dd889327
LMI
16761 * process.c: Use the same condition for POLL_FOR_INPUT in both
16762 keyboard.c and process.c (bug#1858).
16763
87e86684
LM
167642011-07-09 Lawrence Mitchell <wence@gmx.li>
16765
16766 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
16767 (Fgnutls_boot): Use it.
16768
64348f40
AS
167692011-07-15 Andreas Schwab <schwab@linux-m68k.org>
16770
16771 * doc.c (Fsubstitute_command_keys): Revert last change.
16772
1d698799
LMI
167732011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16774
f863868c
LMI
16775 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16776 quotes the next character, and doesn't affect other longer
16777 sequences (bug#8935).
16778
1d698799
LMI
16779 * lread.c (syms_of_lread): Clarify that is isn't only
16780 `eval-buffer' and `eval-defun' that's affected by
16781 `lexical-binding' (bug#8460).
16782
aa4b6df6
EZ
167832011-07-15 Eli Zaretskii <eliz@gnu.org>
16784
16785 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 16786 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 16787
5d856da6
PE
167882011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16789
ad6042bb
PE
16790 Fix minor problems found by static checking.
16791 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16792 (elsz): Now a signed constant, not a size_t var. We prefer signed
16793 types to unsigned, to avoid integer comparison confusion. Without
16794 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16795 "cannot optimize loop, the loop counter may overflow", a symptom
16796 of the confusion.
f00bbb22 16797 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
16798 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16799
6468f31c
LMI
168002011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16801
49080b10
LMI
16802 * search.c (Fre_search_backward): Mention `case-fold-search' in
16803 all the re_search_* functions (bug#8138).
16804
6468f31c
LMI
16805 * keyboard.c (Fopen_dribble_file): Document when the file is
16806 closed (bug#8056).
16807
c965adc5
EZ
168082011-07-14 Eli Zaretskii <eliz@gnu.org>
16809
df9733bf
EZ
16810 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16811 bidi_cache_idx.
16812
0bb23927
EZ
16813 Support bidi reordering of display and overlay strings.
16814 * xdisp.c (compute_display_string_pos)
16815 (compute_display_string_end): Accept additional argument STRING.
16816 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16817 (reseat_to_string): Initialize bidi_it->string.s and
16818 bidi_it->string.schars.
16819 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
16820 NULL (avoids a crash in bidi_paragraph_init).
16821 Initialize itb.string.lstring.
0bb23927
EZ
16822 (init_iterator): Call bidi_init_it only of a valid
16823 buffer position was specified. Initialize paragraph_embedding to
16824 L2R.
16825 (reseat_to_string): Initialize the bidi iterator.
16826 (display_string): If we need to ignore text properties of
16827 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16828 original value of -1 will not work with bidi.)
16829 (compute_display_string_pos): First arg is now struct
16830 `text_pos *'; all callers changed. Support display properties on
16831 Lisp strings.
16832 (compute_display_string_end): Support display properties on Lisp
16833 strings.
16834 (init_iterator, reseat_1, reseat_to_string): Initialize the
16835 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
16836 when iterating on a string not from display properties).
640c8776
SM
16837 (compute_display_string_pos, compute_display_string_end):
16838 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
16839 arrow keys.
16840 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
16841 base_level_stop; instead, set base_level_stop to BEGV.
16842 Fixes crashes in vertical-motion.
0bb23927
EZ
16843 (next_element_from_buffer): Improve commentary for when
16844 the iterator is before prev_stop.
16845 (init_iterator): Initialize bidi_p from the default value of
16846 bidi-display-reordering, not from buffer-local value. Use the
16847 buffer-local value only if initializing for buffer iteration.
16848 (handle_invisible_prop): Support invisible properties on strings
16849 that are being bidi-reordered.
16850 (set_iterator_to_next): Support bidi reordering of C strings and
16851 Lisp strings.
16852 (next_element_from_string): Support bidi reordering of Lisp
16853 strings.
16854 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
16855 (display_string): Support display of R2L glyph rows.
16856 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
16857 (init_iterator): Don't initialize it->bidi_p for strings
16858 here.
16859 (reseat_to_string): Initialize it->bidi_p for strings here.
16860 (next_element_from_string, next_element_from_c_string)
16861 (next_element_from_buffer): Add xassert's for correspondence
16862 between IT's object being iterated and it->bidi_it.string
16863 structure.
16864 (face_before_or_after_it_pos): Support bidi iteration.
16865 (next_element_from_c_string): Handle the case of the first string
16866 character that is not the first one in the visual order.
16867 (get_visually_first_element): New function, refactored from common
16868 parts of next_element_from_buffer, next_element_from_string, and
16869 next_element_from_c_string.
16870 (tool_bar_lines_needed, redisplay_tool_bar)
16871 (display_menu_bar): Force left-to-right direction. Add a FIXME
16872 comment for making that be controlled by a user option.
16873 (push_it, pop_it): Save and restore the state of the
16874 bidi iterator. Save and restore the bidi_p flag.
16875 (pop_it): Iterate out of display property for string iteration as
16876 well.
16877 (iterate_out_of_display_property): Support iteration over strings.
16878 (handle_single_display_spec): Set up it->bidi_it for iteration
16879 over a display string, and call bidi_init_it.
16880 (handle_single_display_spec, next_overlay_string)
16881 (get_overlay_strings_1, push_display_prop): Set up the bidi
16882 iterator for displaying display or overlay strings.
16883 (forward_to_next_line_start): Don't use the shortcut if
16884 bidi-iterating.
16885 (back_to_previous_visible_line_start): If handle_display_prop
16886 pushed the iterator stack, restore the internal state of the bidi
16887 iterator by calling bidi_pop_it same number of times.
16888 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
16889 and we are bidi-iterating, don't decrement the iterator position;
16890 instead, set the first_elt flag in the bidi iterator, to produce
16891 the same effect.
16892 (reseat_1): Remove redundant setting of string_from_display_prop_p.
16893 (push_display_prop): xassert that we are iterating a buffer.
16894 (push_it, pop_it): Save and restore paragraph_embedding member.
16895 (handle_single_display_spec, next_overlay_string)
16896 (get_overlay_strings_1, reseat_1, reseat_to_string)
16897 (push_display_prop): Set up the `unibyte' member of bidi_it.string
16898 correctly. Don't assume unibyte strings are not bidi-reordered.
16899 (compute_display_string_pos)
16900 (compute_display_string_end): Fix handling the case of C string.
16901 (push_it, pop_it): Save and restore from_disp_prop_p.
16902 (handle_single_display_spec, push_display_prop): Set the
16903 from_disp_prop_p flag.
16904 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
16905 (pop_it): Call iterate_out_of_display_property only if we are
16906 popping after iteration over a string that came from a display
16907 property. Fix a typo in popping stretch info. Add an assertion
16908 for verifying that the iterator position is in sync with the bidi
16909 iterator.
16910 (handle_single_display_spec, get_overlay_strings_1)
16911 (push_display_prop): Fix initialization of paragraph direction for
16912 string when that of the parent object is not yet determined.
16913 (reseat_1): Call bidi_init_it to resync the bidi
16914 iterator with IT's position. (Bug#7616)
16915 (find_row_edges): If ROW->start.pos gives position
16916 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
16917 (handle_stop, back_to_previous_visible_line_start, reseat_1):
16918 Reset the from_disp_prop_p flag.
16919 (SAVE_IT, RESTORE_IT): New macros.
16920 (pos_visible_p, face_before_or_after_it_pos)
16921 (back_to_previous_visible_line_start)
16922 (move_it_in_display_line_to, move_it_in_display_line)
16923 (move_it_to, move_it_vertically_backward, move_it_by_lines)
16924 (try_scrolling, redisplay_window, display_line): Use them when
16925 saving a temporary copy of the iterator and restoring it back.
16926 (back_to_previous_visible_line_start, reseat_1)
16927 (init_iterator): Empty the bidi cache "stack".
16928 (move_it_in_display_line_to): If iterator ended up at
16929 EOL, but we never saw any buffer positions smaller than
16930 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
16931 motion in bidi-reordered lines.
16932 (move_it_in_display_line_to): Record prev_method and prev_pos
16933 immediately before the call to set_iterator_to_next. Fixes cursor
16934 motion in bidi-reordered lines with stretch glyphs and strings
16935 displayed in margins. (Bug#8133) (Bug#8867)
16936 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
16937 TO_CHARPOS.
640c8776
SM
16938 (pos_visible_p): Support positions in bidi-reordered lines.
16939 Save and restore bidi cache.
0bb23927
EZ
16940
16941 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
16942 (bidi_paragraph_info): Delete unused struct.
16943 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
16944 (bidi_cache_start): New variable.
16945 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
16946 to zero.
16947 (bidi_cache_fetch_state, bidi_cache_search)
16948 (bidi_cache_find_level_change, bidi_cache_iterator_state)
16949 (bidi_cache_find, bidi_peek_at_next_level)
16950 (bidi_level_of_next_char, bidi_find_other_level_edge)
16951 (bidi_move_to_visually_next): Compare cache index with
16952 bidi_cache_start rather than with zero.
16953 (bidi_fetch_char): Accept new argument STRING; all callers
16954 changed. Support iteration over a string. Support strings with
16955 display properties. Support unibyte strings. Fix the type of
16956 `len' according to what STRING_CHAR_AND_LENGTH expects.
16957 (bidi_paragraph_init, bidi_resolve_explicit_1)
16958 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
16959 (bidi_level_of_next_char, bidi_move_to_visually_next):
16960 Support iteration over a string.
0bb23927
EZ
16961 (bidi_set_sor_type, bidi_resolve_explicit_1)
16962 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
16963 can now be zero (for strings); special values 0 and -1 were
16964 changed to -1 and -2, respectively.
16965 (bidi_char_at_pos): New function.
16966 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
16967 Call it instead of FETCH_MULTIBYTE_CHAR.
16968 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
16969 initialized to valid values.
16970 (bidi_init_it): Don't initialize charpos and bytepos with invalid
16971 values.
16972 (bidi_level_of_next_char): Allow the sentinel "position" to pass
16973 the test for valid cached positions. Fix the logic for looking up
16974 the sentinel state in the cache. GCPRO the Lisp string we are
16975 iterating.
16976 (bidi_push_it, bidi_pop_it): New functions.
16977 (bidi_initialize): Initialize the bidi cache start stack pointer.
16978 (bidi_cache_ensure_space): New function, refactored from part of
16979 bidi_cache_iterator_state. Don't assume the required size is just
16980 one BIDI_CACHE_CHUNK away.
16981 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
16982 (bidi_count_bytes, bidi_char_at_pos): New functions.
16983 (bidi_cache_search): Don't assume bidi_cache_last_idx is
16984 always valid if bidi_cache_idx is valid.
16985 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
16986 is valid if it's going to be used.
16987 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
16988 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
16989 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16990 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
16991 (bidi_find_other_level_edge, bidi_cache_start_stack):
16992 All variables related to cache indices are now EMACS_INT.
c965adc5 16993
0bb23927
EZ
16994 * dispextern.h (struct bidi_string_data): New structure.
16995 (struct bidi_it): New member `string'. Make flag members be 1-bit
16996 fields, and put them last in the struct.
640c8776
SM
16997 (compute_display_string_pos, compute_display_string_end):
16998 Update prototypes.
0bb23927
EZ
16999 (bidi_push_it, bidi_pop_it): Add prototypes.
17000 (struct iterator_stack_entry): New members bidi_p,
17001 paragraph_embedding, and from_disp_prop_p.
17002 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
17003 (bidi_shelve_cache, bidi_unshelve_cache):
17004 Declare prototypes.
0bb23927
EZ
17005
17006 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17007 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17008 and vector-like objects.
17009
17010 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17011 cache around display iteration.
17012
17013 * window.c (Fwindow_end, window_scroll_pixel_based)
17014 (displayed_window_lines, Frecenter): Save and restore the bidi
17015 cache around display iteration.
17016
3bbd2265
LMI
170172011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17018
17019 * editfns.c (Fdelete_region): Clarify the use of the named
17020 parameters (bug#6788).
17021
adc47434
MR
170222011-07-14 Martin Rudalics <rudalics@gmx.at>
17023
17024 * indent.c (Fvertical_motion): Set and restore w->pointm when
17025 saving and restoring the window's buffer (Bug#9006).
17026
837c31f8
LMI
170272011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17028
17029 * editfns.c (Fstring_to_char): Clarify just what is returned
17030 (bug#6576). Text by Eli Zaretskii.
17031
ac389d0c
JB
170322011-07-13 Juanma Barranquero <lekktu@gmail.com>
17033
17034 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17035
0be0ce47
EZ
170362011-07-13 Eli Zaretskii <eliz@gnu.org>
17037
17038 * buffer.c (mmap_find): Fix a typo.
17039
cd18e7e3
JB
170402011-07-13 Johan Bockgård <bojohan@gnu.org>
17041
17042 Fix execution of x selection hooks.
17043 * xselect.c (Qx_lost_selection_functions)
17044 (Qx_sent_selection_functions): New vars.
17045 (syms_of_xselect): DEFSYM them.
17046 (x_handle_selection_request): Pass Qx_sent_selection_functions
17047 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17048 (x_handle_selection_clear,x_clear_frame_selections):
17049 Pass Qx_lost_selection_functions rather than
17050 Vx_lost_selection_functions to Frun_hook_with_args.
17051
47ea7f44
PE
170522011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17053
ac389d0c 17054 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
17055 The old code sometimes used this field without initializing it.
17056
47ea7f44
PE
17057 * alloc.c (gc_sweep): Don't read past end of array.
17058 In theory, the old code could also have corrupted Emacs internals,
17059 though it'd be very unlikely.
17060
bc985c87
AS
170612011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17062
17063 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 17064 argument. (Bug#4026)
bc985c87 17065
0cf34688
LMI
170662011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17067
b3dadd76
LMI
17068 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17069 key" (bug#4257).
17070
0cf34688
LMI
17071 * window.c (Fset_window_start): Doc fix (bug#4199).
17072 (Fset_window_hscroll): Ditto.
17073
270768cd
PE
170742011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17075
077e3dda 17076 Fix minor new problems caught by GCC 4.6.1.
270768cd 17077 * term.c (init_tty): Remove unused local.
490011a6 17078 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 17079 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 17080 not used otherwise.
270768cd 17081
b1f58454
CY
170822011-07-12 Chong Yidong <cyd@stupidchicken.com>
17083
17084 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17085
22b9578d
LMI
170862011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17087
6e70ab07
LMI
17088 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17089 are the mini-buffer and the echo area (bug#3320).
17090
22b9578d
LMI
17091 * term.c (init_tty): Remove support for supdup, c10 and perq
17092 terminals, which are no longer supported (bug#1482).
17093
8974cc9f
JB
170942011-07-10 Johan Bockgård <bojohan@gnu.org>
17095
17096 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17097
a560d974
JD
170982011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17099
17100 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17101 for non-popups (Bug#3642).
17102
1dae0f0a
AS
171032011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17104
268c2c36 17105 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 17106 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
17107 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17108 * cm.c (losecursor): Likewise.
1dae0f0a
AS
17109 * data.c (fmod): Likewise.
17110 * dispnew.c (swap_glyphs_in_rows): Likewise.
17111 * emacs.c (memory_warning_signal): Likewise.
17112 * floatfns.c (float_error): Likewise.
17113 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17114 (otf_open, font_otf_capability, generate_otf_features)
17115 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17116 Likewise.
17117 * image.c (pbm_read_file): Likewise.
17118 * indent.c (string_display_width): Likewise.
17119 * intervals.c (check_for_interval, search_for_interval)
17120 (inc_interval_count, count_intervals, root_interval)
17121 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17122 * lread.c (defalias): Likewise.
268c2c36 17123 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
17124 * regex.c (set_image_of_range_1, set_image_of_range)
17125 (regex_grow_registers): Likewise.
17126 * sysdep.c (strerror): Likewise.
17127 * termcap.c (valid_filename_p, tprint, main): Likewise.
17128 * tparam.c (main): Likewise.
17129 * unexhp9k800.c (run_time_remap, save_data_space)
17130 (update_file_ptrs, read_header, write_header, calculate_checksum)
17131 (copy_file, copy_rest, display_header): Likewise.
17132 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17133 Likewise.
17134 * xdisp.c (check_it): Likewise.
17135 * xfaces.c (register_color, unregister_color, unregister_colors):
17136 Likewise.
17137 * xfns.c (print_fontset_result): Likewise.
17138 * xrdb.c (member, fatal, main): Likewise.
17139
99033785
PE
171402011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17141
17142 Fix minor problems found by static checking (Bug#9031).
17143 * chartab.c (char_table_set_range, map_sub_char_table):
17144 Remove unused locals.
17145 (uniprop_table): Now static.
17146 * composite.c (_work_char): Remove unused static var.
17147
9cb2ac56
JB
171482011-07-09 Juanma Barranquero <lekktu@gmail.com>
17149
17150 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17151
f25661f0
JD
171522011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17153
17154 * gtkutil.c (qttip_cb): Remove code without function.
17155
8278c4fe
EZ
171562011-07-09 Eli Zaretskii <eliz@gnu.org>
17157
17158 * w32.c (pthread_sigmask): New stub.
17159
1692ae2d 171602011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 17161
8a6ebd58 17162 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
17163 sigprocmask is portable only for single-threaded applications, and
17164 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
17165 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17166 (LIBES): Use it.
17167 * callproc.c (Fcall_process):
17168 * process.c (create_process):
17169 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17170 Use pthread_sigmask, not sigprocmask.
123403e4 17171
1b854618
JD
171722011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17173
17174 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17175 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17176 wrong (Bug#8591).
17177
3fe4b549
JD
171782011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17179
0ce7e563
JD
17180 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17181 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17182 (xg_hide_tooltip): Fix comment.
17183
3fe4b549
JD
17184 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17185 in registerServicesMenuSendTypes.
17186 (validRequestorForSendType): Don't check ns_return_types.
17187
17188 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17189 ns_return_type.
17190
5df75e47
JR
171912011-07-08 Jason Rumney <jasonr@gnu.org>
17192
22610910
JR
17193 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17194 SH_SHOW for hidden windows (Bug#5482).
17195
5df75e47
JR
17196 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17197 frame struct members of non-existent frames (Bug#6284).
17198
699c10bd
JD
171992011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17200
4393663b
JD
17201 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17202 variable firstTime not needed on OSX >= 10.6.
17203 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17204 >= 10.5. Use setKnobProportion, setDoubleValue.
17205
17206 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17207 (MAC_OS_X_VERSION_10_5): Define if not defined.
17208 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17209 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17210 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17211
17212 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 17213 cString and lossyCString on OSX >= 10.4.
4393663b 17214
58179cce 17215 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
17216 sizeToFit on OSX >= 10.2.
17217
17218 * nsimage.m (allocInitFromFile): Don't use deprecated method
17219 bestRepresentationForDevice on OSX >= 10.6.
17220
17221 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17222 to avoid warning.
17223
17224 * emacs.c: Declare unexec_init_emacs_zone.
17225
a63e0781
JD
17226 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17227
699c10bd
JD
17228 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17229
17230 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17231 on svcsMenu (Bug#8842).
17232
17233 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17234 ns_return_types.
17235 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17236
17237 * nsterm.m (QUTF8_STRING): Declare.
17238 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17239 (validRequestorForSendType): Return type is (id).
17240 Change indexOfObjectIdenticalTo to indexOfObject.
17241 Check if we have local selection before returning self (Bug#8842).
17242 (writeSelectionToPasteboard): Put local selection into paste board
17243 if we have a local selection (Bug#8842).
17244 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17245
17246 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17247 (ns_get_local_selection): Declare.
17248
54e10184
LMI
172492011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17250
9888ff71
LMI
17251 * keymap.c (describe_map_tree): Don't insert a double newline at
17252 the end of the buffer (bug#1169) and return whether we inserted
17253 something.
17254
54e10184
LMI
17255 * callint.c (Fcall_interactively): Change "reading args" to
17256 "providing args" to try to clarify what it does (bug#1010).
17257
15fa4783
KH
172582011-07-07 Kenichi Handa <handa@m17n.org>
17259
17260 * composite.c (composition_compute_stop_pos): Ignore a static
17261 composition starting before CHARPOS (Bug#8915).
17262
17263 * xdisp.c (handle_composition_prop): Likewise.
17264
a8815b00
EZ
172652011-07-07 Eli Zaretskii <eliz@gnu.org>
17266
17267 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17268 (Bug#9015)
17269
ef7b981d 172702011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
17271
17272 * character.h (unicode_category_t): New enum type.
17273
17274 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17275 (Qchar_code_property_table): New variable.
17276 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17277 (UNIPROP_COMPRESSED_FORM_P): New macros.
17278 (char_table_ascii): Uncompress the compressed values.
17279 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17280 Uncompress the compressed values.
ac389d0c 17281 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
17282 (char_table_ref_and_range): Uncompress the compressed values.
17283 (sub_char_table_set): New arg is_uniprop. Callers changed.
17284 Uncompress the compressed values.
17285 (sub_char_table_set_range): Args changed. Callers changed.
17286 (char_table_set_range): Adjuted for the above change.
17287 (map_sub_char_table): Delete args default_val and parent. Add arg
17288 top. Give decoded values to a Lisp function.
640c8776 17289 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
17290 values to a Lisp function. Gcpro more variables.
17291 (uniprop_table_uncompress)
17292 (uniprop_decode_value_run_length): New functions.
17293 (uniprop_decoder, uniprop_decoder_count): New variables.
17294 (uniprop_get_decoder, uniprop_encode_value_character)
17295 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17296 New functions.
17297 (uniprop_encoder, uniprop_encoder_count): New variables.
17298 (uniprop_get_encoder, uniprop_table)
17299 (Funicode_property_table_internal, Fget_unicode_property_internal)
17300 (Fput_unicode_property_internal): New functions.
17301 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17302 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 17303 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
17304 char-code-property-alist.
17305
640c8776 17306 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
17307 Vunicode_category_table.
17308
640c8776 17309 * font.c (font_range): Adjust for the change of
c805dec0
KH
17310 Vunicode_category_table.
17311
76b397fb
DN
173122011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17313
17314 * m/iris4d.h: Remove file, move contents ...
17315 * s/irix6-5.h: ... here.
17316
22b4128e
PE
173172011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17318
17319 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
17320 * alloc.c (mark_buffer):
17321 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17322 (clone_per_buffer_values): Don't assume that
22b4128e
PE
17323 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17324 This isn't true in general, and it's particularly not true
17325 if Emacs is configured with --with-wide-int.
17326 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17327 New macros, used in the buffer.c change.
17328
869795d6
JD
173292011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17330
17331 * xsettings.c: Use both GConf and GSettings if both are available.
17332 (store_config_changed_event): Add comment.
17333 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17334 (store_tool_bar_style_changed): New functions.
5e617bc2 17335 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
17336 (struct xsettings): Move font inside HAVE_XFT.
17337 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 17338 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 17339 Move inside HAVE_XFT.
640c8776 17340 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
17341 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17342 also.
17343 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 17344 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 17345 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
17346 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17347 (parse_settings): Move check for font inside HAVE_XFT.
17348 (read_settings, apply_xft_settings): Add comment.
17349 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17350 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17351 call store_font_name_changed.
17352 (xft_settings_event): Add comment.
17353 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17354 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17355 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17356 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17357 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
17358 (xsettings_get_system_font, xsettings_get_system_normal_font):
17359 Add comment.
869795d6 17360
d8ed26bd
PE
173612011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17362
17363 Random fixes. E.g., (random) never returned negative values.
17364 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17365 subseconds part to the entropy, as that's a bit more random.
17366 Prefer signed to unsigned, since the signedness doesn't matter and
17367 in general we prefer signed. When given a limit, use a
17368 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17369 latter isn't right if USE_2_TAGS_FOR_INTS.
17370 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17371 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17372
cabf1cac
SM
173732011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17374
17375 * textprop.c (text_property_stickiness):
17376 Obey Vtext_property_default_nonsticky.
17377 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17378 * w32fns.c (syms_of_w32fns):
17379 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17380
6e9b2be9
PE
173812011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17382
17383 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17384 This is more efficient than Ffile_directory_p and avoids a minor race.
17385
90186c68
LMI
173862011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17387
7c301272
LMI
17388 * buffer.c (Foverlay_put): Say what the return value is
17389 (bug#7835).
17390
c4f2d8d4
LMI
17391 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17392 is a directory before asking whether to use the file name
17393 (bug#7564).
ad637907
LMI
17394 (barf_or_query_if_file_exists): Make the "File is a directory"
17395 error be more correct.
c4f2d8d4 17396
90186c68
LMI
17397 * fns.c (Frequire): Remove the mention of the .gz files, since
17398 that's installation-specific, but keep the mention of
17399 `get-load-suffixes'.
17400
da64016e
PE
174012011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17402
17403 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17404 Report string overflow if the output is too long.
17405
7d47b580
JB
174062011-07-04 Juanma Barranquero <lekktu@gmail.com>
17407
a555cb87
JB
17408 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17409 (syms_of_gnutls): Remove duplicate DEFSYM for
17410 Qgnutls_bootprop_verify_hostname_error, an error for
17411 Qgnutls_bootprop_verify_error (which is no longer used).
17412
7d47b580
JB
17413 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17414 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17415 Also (re)move comments that are misplaced or no longer relevant.
17416
1e49bfab
LMI
174172011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17418
17419 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17420
1485f4c0
CY
174212011-07-03 Chong Yidong <cyd@stupidchicken.com>
17422
17423 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17424 and background color parameters if they have been changed.
17425
a9ab721e
LMI
174262011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17427
17428 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17429
cf7cff57
PE
174302011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17431
2e13213d
PE
17432 * xsettings.c (SYSTEM_FONT): Define only when used.
17433 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17434
cf7cff57
PE
17435 * keymap.c (access_keymap_1): Now static.
17436
7a8e04f7
CY
174372011-07-02 Chong Yidong <cyd@stupidchicken.com>
17438
17439 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17440 leave any prefix arg for the up event (Bug#1586).
17441
61352f62
LMI
174422011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17443
69bb1ef7
LMI
17444 * lread.c (syms_of_lread): Mention single symbols defined by
17445 `defvar' or `defconst' (bug#7154).
17446
61352f62 17447 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 17448 (Frequire): Mention get-load-suffixes.
61352f62 17449
28545e04
MR
174502011-07-02 Martin Rudalics <rudalics@gmx.at>
17451
17452 * window.h (window): Remove clone_number slot.
17453 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17454 Remove.
17455 (make_parent_window, make_window, saved_window)
17456 (Fset_window_configuration, save_window_save): Don't deal with
17457 clone numbers.
17458 * buffer.c (Qclone_number): Remove declaration.
17459 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17460
3349e122
SM
174612011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17462
17463 Add multiple inheritance to keymaps.
17464 * keymap.c (Fmake_composed_keymap): New function.
17465 (Fset_keymap_parent): Simplify.
17466 (fix_submap_inheritance): Remove.
17467 (access_keymap_1): New function extracted from access_keymap to handle
17468 embedded parents and handle lists of maps.
17469 (access_keymap): Use it.
17470 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17471 (Fcopy_keymap): Handle embedded parents.
17472 (Fcommand_remapping, define_as_prefix): Simplify.
17473 (Fkey_binding): Simplify.
17474 (syms_of_keymap): Move minibuffer-local-completion-map,
17475 minibuffer-local-filename-completion-map,
17476 minibuffer-local-must-match-map, and
17477 minibuffer-local-filename-must-match-map to Elisp.
17478 (syms_of_keymap): Defsubr make-composed-keymap.
17479 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17480 (parse_menu_item): Trivial simplification.
17481
3279eb87
GM
174822011-07-01 Glenn Morris <rgm@gnu.org>
17483
17484 * Makefile.in (SETTINGS_LIBS): Fix typo.
17485
39cb9e56 174862011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
17487
17488 * coding.c (Fencode_coding_string): Record the last coding system
17489 used, as the function doc string says (bug#8738).
17490
0949d2b6
JD
174912011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17492
17493 * xsettings.c (store_monospaced_changed): Take new font as arg and
17494 check for change against current_mono_font.
17495 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17496 (emacs_settings_constructor, emacs_settings_get_property)
17497 (emacs_settings_set_property, emacs_settings_class_init)
17498 (emacs_settings_init, gsettings_obj): Remove.
17499 (something_changedCB): New function for HAVE_GSETTINGS.
17500 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17501 with value as argument.
17502 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17503 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 17504 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
17505 "changed".
17506
17507 * xgselect.c: Add defined (HAVE_GSETTINGS).
17508 (xgselect_initialize): Ditto.
17509
17510 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17511 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17512 xg_select.
17513
bbc6b304
PE
175142011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17515
17516 * eval.c (struct backtrace): Simplify and port the data structure.
17517 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17518 signed bit field, as this assumption is not portable and it makes
17519 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17520 "char debug_on_exit : 1" as this is not portable either; instead,
17521 use the portable "unsigned int debug_on_exit : 1". Remove unused
17522 member evalargs. Remove obsolete comments about cc bombing out.
17523
9851bfc5
JD
175242011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17525
51bb811f 17526 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
17527 Let HAVE_GSETTINGS override HAVE_GCONF.
17528 (store_monospaced_changed): New function.
17529 (EMACS_SETTINGS): A new type derived from GObject to handle
17530 GSettings notifications.
17531 (emacs_settings_constructor, emacs_settings_get_property)
17532 (emacs_settings_set_property, emacs_settings_class_init):
17533 New functions.
17534 (gsettings_client, gsettings_obj): New variables.
17535 (GSETTINGS_SCHEMA): New define.
17536 (something_changedCB): Call store_monospaced_changed.
17537 (init_gsettings): New function.
17538 (xsettings_initialize): Call init_gsettings.
17539 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17540 to NULL.
17541
640c8776 17542 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
17543 GCONF_CFLAGS/LIBS.
17544
5386012d
MR
175452011-06-29 Martin Rudalics <rudalics@gmx.at>
17546
17547 * window.c (resize_root_window, grow_mini_window)
17548 (shrink_mini_window): Rename Qresize_root_window to
17549 Qwindow_resize_root_window and Qresize_root_window_vertically to
17550 Qwindow_resize_root_window_vertically.
17551
f13e0b08
PE
175522011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17553
17554 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17555
94515237
JB
175562011-06-27 Juanma Barranquero <lekktu@gmail.com>
17557
17558 * makefile.w32-in: Redesign dependencies so they reflect more
17559 clearly which files are directly included by each source file,
17560 and not through other includes.
17561
e43b6e43
MR
175622011-06-27 Martin Rudalics <rudalics@gmx.at>
17563
17564 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17565 (sort_overlays, overlay_strings): When an overlay's clone number
17566 matches the window's clone number process the overlay even if
17567 the overlay's window property doesn't match the current window.
17568
d68443dc
MR
17569 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17570 (Fwindow_hchild): Rename to Fwindow_left_child.
17571 (Fwindow_next): Rename to Fwindow_next_sibling.
17572 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
17573 (resize_window_check): Rename to window_resize_check.
17574 (resize_window_apply): Rename to window_resize_apply.
17575 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17576 (Fdelete_other_windows_internal, resize_frame_windows)
17577 (Fsplit_window_internal, Fdelete_window_internal)
17578 (grow_mini_window, shrink_mini_window)
17579 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 17580
c7e73be5
JD
175812011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17582
17583 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17584 (emacs_fixed_set_min_size): Remove.
17585 (emacs_fixed_new): Take frame as argument.
17586
17587 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17588 (_EmacsFixedPrivate): Remove minwidth/height.
17589 Add struct frame *f.
17590 (emacs_fixed_init): Initialize priv->f.
17591 (get_parent_class, emacs_fixed_set_min_size): Remove.
17592 (emacs_fixed_new): Set priv->f to argument.
17593 (emacs_fixed_get_preferred_width)
17594 (emacs_fixed_get_preferred_height): Use min_width/height from
17595 frames size_hint to set minimum and natural (Bug#8919).
17596 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17597 and use min_width/height from frames size_hint to set
17598 min_width/height (Bug#8919).
17599
17600 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
17601 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17602 Fix indentation.
c7e73be5 17603
cf99dcf8
EZ
176042011-06-26 Eli Zaretskii <eliz@gnu.org>
17605
17606 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17607 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17608 called at ZV.
17609
029529ac
CY
176102011-06-26 Chong Yidong <cyd@stupidchicken.com>
17611
17612 * process.c (wait_reading_process_output): Bypass select if
17613 waiting for a cell while ignoring keyboard input, and input is
17614 pending. Suggested by Jan Djärv (Bug#8869).
17615
7a7ef429
PE
176162011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17617
17618 Use gnulib's dup2 module instead of rolling our own.
17619 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17620
11fdef7d 176212011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
17622
17623 * dispnew.c (scrolling_window): Before scrolling, turn off a
17624 mouse-highlight in the window being scrolled.
17625
cd3520a4
JB
176262011-06-24 Juanma Barranquero <lekktu@gmail.com>
17627
17628 Move DEFSYM to lisp.h and use everywhere.
17629
17630 * character.h (DEFSYM): Move declaration...
17631 * lisp.h (DEFSYM): ...here.
17632
17633 * gnutls.c:
17634 * minibuf.c:
17635 * w32menu.c:
17636 * w32proc.c:
17637 * w32select.c: Don't include character.h.
17638
17639 * alloc.c (syms_of_alloc):
17640 * buffer.c (syms_of_buffer):
17641 * bytecode.c (syms_of_bytecode):
17642 * callint.c (syms_of_callint):
17643 * casefiddle.c (syms_of_casefiddle):
17644 * casetab.c (init_casetab_once):
17645 * category.c (init_category_once, syms_of_category):
17646 * ccl.c (syms_of_ccl):
17647 * cmds.c (syms_of_cmds):
17648 * composite.c (syms_of_composite):
17649 * dbusbind.c (syms_of_dbusbind):
17650 * dired.c (syms_of_dired):
17651 * dispnew.c (syms_of_display):
17652 * doc.c (syms_of_doc):
17653 * editfns.c (syms_of_editfns):
17654 * emacs.c (syms_of_emacs):
17655 * eval.c (syms_of_eval):
17656 * fileio.c (syms_of_fileio):
17657 * fns.c (syms_of_fns):
17658 * frame.c (syms_of_frame):
17659 * fringe.c (syms_of_fringe):
17660 * insdel.c (syms_of_insdel):
17661 * keymap.c (syms_of_keymap):
17662 * lread.c (init_obarray, syms_of_lread):
17663 * macros.c (syms_of_macros):
17664 * msdos.c (syms_of_msdos):
17665 * print.c (syms_of_print):
17666 * process.c (syms_of_process):
17667 * search.c (syms_of_search):
17668 * sound.c (syms_of_sound):
17669 * syntax.c (init_syntax_once, syms_of_syntax):
17670 * terminal.c (syms_of_terminal):
17671 * textprop.c (syms_of_textprop):
17672 * undo.c (syms_of_undo):
17673 * w32.c (globals_of_w32):
17674 * window.c (syms_of_window):
17675 * xdisp.c (syms_of_xdisp):
17676 * xfaces.c (syms_of_xfaces):
17677 * xfns.c (syms_of_xfns):
17678 * xmenu.c (syms_of_xmenu):
17679 * xsettings.c (syms_of_xsettings):
17680 * xterm.c (syms_of_xterm): Use DEFSYM.
17681
4228cf16
TZ
176822011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17683
cd3520a4 17684 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 17685
7fcccf1e
PE
176862011-06-23 Paul Eggert <eggert@cs.ucla.edu>
17687
7efb4e0e
PE
17688 Integer and buffer overflow fixes (Bug#8873).
17689
ff5844ad
PE
17690 * print.c (printchar, strout): Check for string overflow.
17691 (PRINTPREPARE, printchar, strout):
17692 Don't set size unless allocation succeeds.
17693
90532f02
PE
17694 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
17695 for sizes. Check for string overflow more accurately.
17696 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
17697
6d84508d
PE
17698 * macros.c: Integer and buffer overflow fixes.
17699 * keyboard.h (struct keyboard.kbd_macro_bufsize):
17700 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
17701 Use ptrdiff_t, not int, for sizes.
17702 Don't increment bufsize until after realloc succeeds.
17703 Check for size-calculation overflow.
17704 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
17705
437b2cb4
PE
17706 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
17707
8b9ac8b4
PE
17708 * lread.c: Integer overflow fixes.
17709 (read_integer): Radix is now EMACS_INT, not int,
17710 to improve quality of diagnostics for out-of-range radices.
17711 Calculate buffer size correctly for out-of-range radices.
17712 (read1): Check for integer overflow in radices, and in
17713 read-circle numbers.
82cb60d3
PE
17714 (read_escape): Avoid int overflow.
17715 (Fload, openp, read_buffer_size, read1)
17716 (substitute_object_recurse, read_vector, read_list, map_obarray):
17717 Use ptrdiff_t, not int, for sizes.
17718 (read1): Use EMACS_INT, not int, for sizes.
20270765 17719 Check for size overflow.
8b9ac8b4 17720
7fcccf1e
PE
17721 * image.c (cache_image): Check for size arithmetic overflow.
17722
bfbbd7e7
PE
17723 * lread.c: Integer overflow issues.
17724 (saved_doc_string_size, saved_doc_string_length)
17725 (prev_saved_doc_string_size, prev_saved_doc_string_length):
17726 Now ptrdiff_t, not int.
17727 (read1): Don't assume doc string length fits in int. Check for
17728 out-of-range doc string lengths.
17729 (read_list): Don't assume file position fits in int.
39019e54 17730 (read_escape): Check for hex character overflow.
bfbbd7e7 17731
4e323265
LL
177322011-06-22 Leo Liu <sdl.web@gmail.com>
17733
17734 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
17735 Move to minibuffer.el.
17736
85fece3e
PE
177372011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17738
20b84ce9 17739 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
17740 The following patches are for when GLYPH_DEBUG && !XASSERT.
17741 * dispextern.h (trace_redisplay_p, dump_glyph_string):
17742 * dispnew.c (flush_stdout):
17743 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
17744 Mark as externally visible.
17745 * dispnew.c (check_window_matrix_pointers): Now static.
17746 * dispnew.c (window_to_frame_vpos):
17747 * xfns.c (unwind_create_frame):
17748 * xterm.c (x_check_font): Remove unused local.
17749 * scroll.c (CHECK_BOUNDS):
17750 * xfaces.c (cache_fache): Rename local to avoid shadowing.
17751 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
17752 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
17753 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
17754 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
17755 Now static.
17756 (debug_method_add): Use va_list and vsprintf rather than relying
17757 on undefined behavior with wrong number of arguments.
17758 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
17759 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
17760 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
17761 since we're not interested in debugging glyphs with old libraries.
17762 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
17763 GCC 4.6.0's static checking.
17764
0766b489
PE
177652011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17766
31fd4b32
PE
17767 Integer overflow and signedness fixes (Bug#8873).
17768 A few related buffer overrun fixes, too.
17769
b79e8648
PE
17770 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
17771
0766b489
PE
17772 * dispextern.h (struct face.stipple):
17773 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17774 (x_bitmap_mask, x_allocate_bitmap_record)
17775 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17776 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17777 (x_create_bitmap_from_xpm_data):
17778 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17779 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17780 (.bitmaps_last):
17781 * xfaces.c (load_pixmap):
17782 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17783 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17784 (.bitmaps_last, struct x_output.icon_bitmap):
17785 Use ptrdiff_t, not int, for bitmap indexes.
17786 (x_allocate_bitmap_record): Check for size overflow.
17787 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17788
b081724f
PE
17789 Use ptrdiff_t, not int, for overlay counts.
17790 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17791 * editfns.c (overlays_around, get_pos_property):
17792 * textprop.c (get_char_property_and_overlay):
17793 * xdisp.c (next_overlay_change, note_mouse_highlight):
17794 * xfaces.c (face_at_buffer_position):
21514da7
PE
17795 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17796 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17797 (Fnext_overlay_change, Fprevious_overlay_change)
17798 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 17799 Use ptrdiff_t, not int, for sizes.
21514da7 17800 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 17801
3de73e5e
PE
17802 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17803
2606c57b
PE
17804 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17805 (x_session_initialize): Do not assume string length fits in int.
17806
aaafe47a
PE
17807 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17808 This is unlikely, but can occur if DPI is outlandish.
17809
2674ddc8 17810 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
17811 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17812
28154962
PE
17813 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17814 * xrdb.c (magic_file_p, search_magic_path):
17815 Omit last arg SUFFIX; it was always 0. All callers changed.
17816 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17817
7de51af5
PE
17818 * xfont.c (xfont_match): Avoid need for strlen.
17819
25ed6cc3
PE
17820 * xfns.c: Don't assume strlen fits in int.
17821 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17822
4eab31dd
PE
17823 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17824 not unsigned long, as we prefer signed integers. All callers changed.
17825 Detect integer overflow in repeat count.
17826 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 17827 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 17828
171e2a58
PE
17829 * termcap.c: Don't assume sizes fit in int and never overflow.
17830 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
17831 (gobble_line): Check for size-calculation overflow.
17832
ad39faca 17833 * minibuf.c (Fread_buffer):
6e5bb2dc 17834 * lread.c (intern, intern_c_string):
74ca2eb3
PE
17835 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
17836 Don't assume string length fits in int.
17837
52c61c22 17838 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
17839 * gtkutil.c (style_changed_cb): Avoid need for strlen.
17840
b5b8c9e5
PE
17841 * font.c: Don't assume string length fits in int.
17842 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
17843 Use ptrdiff_t, not int.
ccd6111c
PE
17844 (font_intern_prop): Don't assume string length fits in int.
17845 Don't assume integer property fits in fixnum.
17846 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 17847
882f0d81 17848 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 17849 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
17850 Reformulate so as not to need the command string.
17851 Invoke gzip -cd rather than gunzip, as it's more portable.
17852 (lock_info_type, lock_file_1, lock_file):
17853 Don't assume pid_t and time_t fit in unsigned long.
17854 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
17855 (current_lock_owner): Prefer signed type for sizes.
17856 Use memcpy, not strncpy, where memcpy is what is really wanted.
17857 Don't assume (via atoi) that time_t and pid_t fit in int.
17858 Check for time_t and/or pid_t out of range, e.g., via a network share.
17859 Don't alloca where an auto var works fine.
17860
93f4cf88
PE
17861 * fileio.c: Fix some integer overflow issues.
17862 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
17863 Don't assume string length fits in int.
17864 (directory_file_name): Don't assume string length fits in long.
17865 (make_temp_name): Don't assume pid fits in int, or that its print
17866 length is less than 20.
17867
f3e92b69
PE
17868 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
17869
1bfdaf10
PE
17870 * coding.c (make_subsidiaries): Don't assume string length fits in int.
17871
35016e9a
PE
17872 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
17873
3d1e65a1
PE
17874 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
17875 We prefer signed integers, even for size calculations.
17876
0b963a93
PE
17877 * emacs.c: Don't assume string length fits in 'int'.
17878 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
17879 (main): Don't invoke strlen when not needed.
17880
573f4b54
PE
17881 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
17882 (XD_DEBUG_MESSAGE): Don't waste a byte.
17883
989f33ba
PE
17884 * callproc.c (getenv_internal_1, getenv_internal)
17885 (Fgetenv_internal):
965d34eb
PE
17886 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
17887
e4d29b33
PE
17888 * lread.c (invalid_syntax): Omit length argument.
17889 All uses changed. This doesn't fix a bug, but it simplifies the
17890 code away from its former Hollerith-constant appearance, and it's
17891 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 17892 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 17893
eb49b136
PE
17894 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
17895 This didn't break anything, but it didn't help either.
17896 It's confusing to put a bogus integer in a place where the actual
17897 value does not matter.
9f62aeb1 17898 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 17899 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 17900
15375a22
PE
17901 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
17902 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
17903 implementation.
b61cc01c
PE
17904 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
17905 We prefer signed types, and the value cannot exceed the EMACS_INT
17906 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
17907 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
17908 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
17909 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 17910
53b2623d
PE
17911 * indent.c (sane_tab_width): New function.
17912 (current_column, scan_for_column, Findent_to, position_indentation)
17913 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 17914 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 17915
51cab52b 17916 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 17917
f2ed8a70
PE
17918 * lisp.h (lint_assume): New macro.
17919 * composite.c (composition_gstring_put_cache):
17920 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
17921
abe80cc6
PE
17922 * editfns.c, insdel.c:
17923 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 17924
b02c740e
PE
17925 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
17926
ebc96716
PE
17927 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
17928
b4e50fa0 17929 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 17930 Use much-faster test for byte-length change.
311d5d7c 17931 Don't assume string byte-length fits in 'int'.
a4cf38e4 17932 Check that character arg fits in 'int'.
85461888 17933 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 17934
c0c1ee9f
PE
17935 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
17936
a498d7f4
PE
17937 * fns.c (concat): Catch string overflow earlier.
17938 Do not rely on integer wraparound.
17939
51cab52b
PE
17940 * dispextern.h (struct it.overlay_strings_charpos)
17941 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
17942 * xdisp.c (forward_to_next_line_start)
17943 (back_to_previous_visible_line_start)
17944 (reseat_at_next_visible_line_start, next_element_from_buffer):
17945 Don't arbitrarily truncate the value of 'selective' to int.
17946
76031fad
PE
17947 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
17948
5eb55db9
PE
17949 * composite.c: Don't truncate sizes to 'int'.
17950 (composition_gstring_p, composition_reseat_it)
17951 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
17952 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
17953 not EMACS_UINT, for indexes.
5eb55db9 17954
0703a717
PE
17955 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
17956
d6202519
PE
17957 * buffer.c: Include <verify.h>.
17958 (struct sortvec.priority, struct sortstr.priority):
8961a454 17959 Now EMACS_INT, not int.
c20998a7 17960 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
17961 (struct sortstr.size, record_overlay_string)
17962 (struct sortstrlist.size, struct sortlist.used):
17963 Don't truncate size to int.
17964 (record_overlay_string): Check for size-calculation overflow.
d6202519 17965 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 17966
d5a19415
JM
179672011-06-22 Jim Meyering <meyering@redhat.com>
17968
029529ac 17969 Don't leak an XBM-image-sized buffer
d5a19415
JM
17970 * image.c (xbm_load): Free the image buffer after using it.
17971
a9041e6c
PE
179722011-06-21 Paul Eggert <eggert@cs.ucla.edu>
17973
17974 Port to Sun C.
17975 * composite.c (find_automatic_composition): Omit needless 'return 0;'
17976 that Sun C diagnosed.
17977 * fns.c (secure_hash): Fix pointer signedness issue.
17978 * intervals.c (static_offset_intervals): New function.
17979 (offset_intervals): Use it.
17980
7f3f739f
LL
179812011-06-21 Leo Liu <sdl.web@gmail.com>
17982
17983 * deps.mk (fns.o):
17984 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
17985 sha512.h.
17986
17987 * fns.c (secure_hash): Rename from crypto_hash_function and change
17988 the first arg to accept symbols.
5b66d427 17989 (Fsecure_hash): New primitive.
7f3f739f
LL
17990 (syms_of_fns): New symbols.
17991
76147d94
DD
179922011-06-20 Deniz Dogan <deniz@dogan.se>
17993
17994 * process.c (Fset_process_buffer): Clarify return value in
17995 docstring.
17996
7d7d0045
CY
179972011-06-18 Chong Yidong <cyd@stupidchicken.com>
17998
17999 * dispnew.c (add_window_display_history): Use BVAR.
18000
18001 * xdisp.c (debug_method_add): Use BVAR.
18002 (check_window_end, dump_glyph_matrix, dump_glyph)
18003 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18004
18005 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18006 Likewise.
18007
18008 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18009 check till after the cache is created in init_frame_faces.
18010
ff2bc410
SM
180112011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18012
18013 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18014
28177add
PE
180152011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18016
dd3482fe
PE
18017 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18018 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18019 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18020
393d71f3 18021 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
18022 * fileio.c (Finsert_file_contents):
18023 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18024 Remove the old (too-loose) buffer overflow checks.
18025 They weren't needed, since make_gap checks for buffer overflow.
18026 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18027 The old code merely checked for Emacs fixnum overflow, and relied
18028 on undefined (wraparound) behavior. The new code avoids undefined
18029 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18030
2e6813b0 18031 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
18032 Tune. Don't use wider integers than needed. Don't use alloca.
18033 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 18034
599a9e4f
PE
18035 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18036
99561444
PE
18037 * insdel.c, lisp.h (buffer_overflow): New function.
18038 (insert_from_buffer_1, replace_range, replace_range_2):
18039 * insdel.c (make_gap_larger):
18040 * editfns.c (Finsert_char):
18041 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18042
28177add
PE
18043 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18044
e69dafad
PE
180452011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18046
4baa020d 18047 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 18048
b1c46f02
PE
18049 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18050 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18051
e69dafad
PE
18052 * fileio.c: Don't assume EMACS_INT fits in off_t.
18053 (emacs_lseek): New static function.
18054 (Finsert_file_contents, Fwrite_region): Use it.
18055 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18056
566684ea
PE
18057 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18058
e6966cd6
PE
18059 * fns.c: Don't overflow int when computing a list length.
18060 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18061 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18062 truncation on 64-bit hosts. Check for QUIT every
18063 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18064 faster and is responsive enough.
18065 (Flength): Report an error instead of overflowing an integer.
18066 (Fsafe_length): Return a float if the value is not representable
18067 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 18068 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 18069 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 18070
dd0b0efb
PE
18071 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18072 (header_size, word_size): New constants.
18073 (allocate_vectorlike): Don't check size overflow here.
18074 (allocate_vector): Check it here instead, since this is the only
18075 caller of allocate_vectorlike that could cause overflow.
18076 Check that the new vector's length is representable as a fixnum.
18077
86fe5cfe
PE
18078 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18079 The previous code was bogus. For example, next_almost_prime (32)
18080 returned 39, which is undesirable as it is a multiple of 3; and
18081 next_almost_prime (24) returned 25, which is a multiple of 5 so
18082 why was the code bothering to check for multiples of 7?
18083
80e88859
PE
18084 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18085
4a2f0ad6
PE
18086 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18087
f66c7cf8
PE
18088 Variadic C functions now count arguments with ptrdiff_t.
18089 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18090 Back then I didn't know that the Emacs coding style prefers signed int.
18091 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
18092 were being counted with int, which may truncate counts on 64-bit
18093 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
18094 * lisp.h (struct Lisp_Subr.function.aMANY)
18095 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18096 Arg counts are now ptrdiff_t, not size_t.
18097 All variadic functions and their callers changed accordingly.
18098 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18099 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18100 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18101 * callint.c (Fcall_interactively): Check arg count for overflow,
18102 to avoid potential buffer overrun. Use signed char, not 'int',
18103 for 'varies' array, so that we needn't bother to check its size
18104 calculation for overflow.
18105 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18106 * eval.c (apply_lambda):
18107 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18108 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18109 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18110
a1759b76
PE
18111 * callint.c (Fcall_interactively): Don't use index var as event count.
18112
d96be9fc
PE
18113 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18114 * mem-limits.h (SIZE): Remove; no longer used.
18115
a690a978 18116 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 18117
578c21e6
PE
18118 Remove unnecessary casts.
18119 * xterm.c (x_term_init):
18120 * xfns.c (x_set_border_pixel):
18121 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18122 These aren't needed now that we assume ANSI C.
18123
96f53c6c
PE
18124 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18125 It's more likely to cause problems (due to unsigned overflow)
18126 than to cure them.
18127
83c77d31
PE
18128 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18129
ee2079f1
PE
18130 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18131
6da65536
PE
18132 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18133
7147c4a4
PE
18134 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18135
193e32d9
PE
18136 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18137
e5533da6
PE
18138 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18139
9910e595
PE
18140 GLYPH_CODE_FACE returns EMACS_INT, not int.
18141 * dispextern.h (merge_faces):
18142 * xfaces.c (merge_faces):
01103c44
PE
18143 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18144 Don't assume EMACS_INT fits in int.
9910e595 18145
2638320e
PE
18146 * character.h (CHAR_VALID_P): Remove unused parameter.
18147 * fontset.c, lisp.h, xdisp.c: All uses changed.
18148
045eb8d9
PE
18149 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18150
c1f134b5
PE
18151 * fns.c (concat): Minor tuning based on overflow analysis.
18152 This doesn't fix any bugs. Use int to hold character, instead
18153 of constantly refetching from Emacs object. Use XFASTINT, not
18154 XINT, for value known to be a character. Don't bother comparing
18155 a single byte to 0400, as it's always less.
18156
395fcb93 18157 * floatfns.c (Fexpt):
327eeec8
PE
18158 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18159
abbd3d23
PE
18160 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18161 for characters.
18162
684a03ef
PE
18163 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18164
0fed43f3
PE
18165 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18166 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18167 incorrectly succeed when S was a string, because 4294967386 was
18168 truncated before it was used.
18169
8fd02eb7
PE
18170 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18171 Otherwise, an out-of-range integer could cause undefined behavior
18172 on a 64-bit host.
18173
f8c86b69
PE
18174 * composite.c: Use int, not EMACS_INT, for characters.
18175 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18176 EMACS_INT, for values that are known to be in character range.
18177 This doesn't fix any bugs but is the usual style inside Emacs and
18178 may generate better code on 32-bit machines.
18179
34206dd2
PE
18180 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18181 This is for reasons similar to the recent CHAR_STRING fix.
18182 * charset.c (Fencode_char): Check that character arg is actually
18183 a character. Pass an int to ENCODE_CHAR.
18184 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18185 wider than 'int', as a compile-time check to prevent future regressions
18186 in this area.
18187
c5958d4c 18188 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
18189
18190 Make sure a 64-bit char is never passed to CHAR_STRING.
18191 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18192 by silently ignoring the top 32 bits, allowing some values
18193 that were far too large to be valid characters.
18194 * character.h: Include <verify.h>.
18195 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18196 arguments are no wider than unsigned, as a compile-time check
18197 to prevent future regressions in this area.
18198 * data.c (Faset):
01103c44 18199 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
18200 (Fsubst_char_in_region):
18201 * fns.c (concat):
18202 * xdisp.c (decode_mode_spec_coding):
18203 Adjust to CHAR_STRING's new requirement.
18204 * editfns.c (Finsert_char, Fsubst_char_in_region):
18205 * fns.c (concat): Check that character args are actually
18206 characters. Without this test, these functions did the wrong
18207 thing with wildly out-of-range values on 64-bit hosts.
18208
d37ca623
PE
18209 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18210 These casts should not be needed on 32-bit hosts, either.
18211 * keyboard.c (read_char):
18212 * lread.c (Fload): Remove casts to unsigned.
18213
ea204efb
PE
18214 * lisp.h (UNSIGNED_CMP): New macro.
18215 This fixes comparison bugs on 64-bit hosts.
18216 (ASCII_CHAR_P): Use it.
18217 * casefiddle.c (casify_object):
01103c44 18218 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
18219 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18220 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18221 * dispextern.h (FACE_FROM_ID):
18222 * keyboard.c (read_char): Use UNSIGNED_CMP.
18223
41cb286c
PE
18224 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18225 not to EMACS_INT, to avoid GCC warning.
18226
4a1b9832
PE
18227 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18228
55daad71
PE
18229 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18230 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18231 isn't needed on 32-bit machines.
8f95c75c 18232
01103c44
PE
18233 * buffer.c (Fgenerate_new_buffer_name):
18234 Use EMACS_INT for count, not int.
0ceccced 18235 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
18236
18237 * data.c (Qcompiled_function): Now static.
18238
c6f072e7
PE
18239 * window.c (window_body_lines): Now static.
18240
20ce5912
PE
18241 * image.c (gif_load): Rename local to avoid shadowing.
18242
9c4c5f81
PE
18243 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18244 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18245 * alloc.c (make_save_value): Integer argument is now of type
18246 ptrdiff_t, not int.
18247 (mark_object): Use ptrdiff_t, not int.
18248 * lisp.h (pD): New macro.
18249 * print.c (print_object): Use it.
18250
c0c5c8ae
PE
18251 * alloc.c: Use EMACS_INT, not int, to count objects.
18252 (total_conses, total_markers, total_symbols, total_vector_size)
18253 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
18254 (total_free_floats, total_floats, total_free_intervals)
18255 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
18256 Now EMACS_INT, not int. All uses changed.
18257 (Fgarbage_collect): Compute overall total using a double, so that
18258 integer overflow is less likely to be a problem. Check for overflow
18259 when converting back to an integer.
5a25e253
PE
18260 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18261 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18262 These were 'int' variables that could overflow on 64-bit hosts;
18263 they were never used, so remove them instead of repairing them.
211a0b2a 18264 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
18265 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18266 Previously, this ceilinged at INT_MAX, but that doesn't work on
18267 64-bit machines.
e46bb31a 18268 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 18269
c78baabf 18270 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 18271 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
18272 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18273 when a (possibly-narrower) signed value would do just as well.
18274 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 18275
c9d624c6
PE
18276 * alloc.c: Catch some string size overflows that we were missing.
18277 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18278 for convenience in STRING_BYTES_MAX.
18279 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18280 The definition here is exact; the one in lisp.h was approximate.
18281 (allocate_string_data): Check for string overflow. This catches
18282 some instances we weren't catching before. Also, it catches
18283 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18284 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18285 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 18286
c9d624c6
PE
18287 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18288 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 18289 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 18290
353032ce
PE
18291 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18292
2bccce07
PE
18293 * alloc.c (Fmake_string): Check for out-of-range init.
18294
0ac30604
SM
182952011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18296
18297 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18298
c195f2de
JD
182992011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18300
18301 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18302 xg_get_default_scrollbar_width.
18303
18304 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18305 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18306 (style_changed_cb): Call update_theme_scrollbar_width and call
18307 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18308 all frames (Bug#8505).
18309 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18310 Call gtk_window_set_resizable if HAVE_GTK3.
18311 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18312 and height if HAVE_GTK3 (Bug#8505).
18313 (scroll_bar_width_for_theme): New variable.
18314 (update_theme_scrollbar_width): New function.
18315 (xg_get_default_scrollbar_width): Move code to
18316 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18317 (xg_initialize): Call update_theme_scrollbar_width.
18318
18319 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18320
18321 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18322
e10ac9f1
MR
183232011-06-12 Martin Rudalics <rudalics@gmx.at>
18324
18325 * frame.c (make_frame): Call other_buffer_safely instead of
18326 other_buffer.
18327
18328 * window.c (temp_output_buffer_show): Call display_buffer with
18329 second argument Vtemp_buffer_show_specifiers and reset latter
18330 immediately after the call.
18331 (Vtemp_buffer_show_specifiers): New variable.
18332 (auto_window_vscroll_p, next_screen_context_lines)
18333 (Vscroll_preserve_screen_position): Remove leading asterisks from
18334 doc-strings.
18335
2d3c217e 183362011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 18337
7b7f97e8 18338 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
18339 * buffer.c (Qclone_number): Remove for now, as it's unused.
18340 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18341 (record_buffer): Remove unused local.
18342 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18343 (set_frame_buffer_list): Remove; unused.
18344 * frame.h (other_visible_frames): Remove decl.
18345 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18346 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18347 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18348 if HAVE_GPM.
18349 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18350 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18351 Define only if HAVE_GPM.
18352 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18353 (update_hints_inhibit): Remove; never set. All uses removed.
18354 * widgetprv.h (emacsFrameClassRec): Remove decl.
18355 * window.c (delete_deletable_window): Now returns void, since it
18356 wasn't returning anything.
18357 (compare_window_configurations): Remove unused locals.
18358 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18359 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
18360 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18361 the same widths as pointers. This follows up on the 2011-05-06 patch.
18362 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18363 * xterm.h: Likewise.
18364 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18365
1384b89e
JB
183662011-06-12 Juanma Barranquero <lekktu@gmail.com>
18367
18368 * makefile.w32-in: Update dependencies.
18369 (LISP_H): Add lib/intprops.h.
18370
1100a63c
CY
183712011-06-11 Chong Yidong <cyd@stupidchicken.com>
18372
18373 * image.c (gif_load): Add animation frame delay to the metadata.
18374 (syms_of_image): Use DEFSYM. New symbol `delay'.
18375
6198ccd0
MR
183762011-06-11 Martin Rudalics <rudalics@gmx.at>
18377
18378 * window.c (delete_deletable_window): Re-add.
18379 (Fset_window_configuration): Rewrite to handle dead buffers and
18380 consequently deletable windows.
18381 (window_tree, Fwindow_tree): Remove. Supply functionality in
18382 window.el.
18383 (compare_window_configurations): Simplify code.
18384
b6e3633c
AS
183852011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18386
1ab0dee5
AS
18387 * image.c (imagemagick_load_image): Fix type mismatch.
18388 (Fimagemagick_types): Likewise.
18389
b6e3633c
AS
18390 * window.h (replace_buffer_in_windows): Declare.
18391
9397e56f
MR
183922011-06-11 Martin Rudalics <rudalics@gmx.at>
18393
18394 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18395 Qclone_number. Remove external declaration of Qdelete_window.
18396 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18397 code.
640c8776
SM
18398 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18399 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
18400 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18401 buffer list implementation.
18402 (other_buffer_safely): New function.
18403 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18404 calls to replace_buffer_in_windows and
18405 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18406 if allowed.
18407 (record_buffer): Inhibit quitting and rewrite using quittable
18408 functions. Run Qbuffer_list_update_hook if allowed.
18409 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
18410 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18411 Move switch-to-buffer to window.el.
9397e56f
MR
18412 (bury-buffer): Move to window.el.
18413 (Vbuffer_list_update_hook): New variable.
18414
18415 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18416 section.
18417
18418 * window.h (resize_frame_windows): Move up in code.
18419 (Fwindow_frame): Remove EXFUN.
18420 (replace_buffer_in_all_windows): Remove prototype.
18421 (replace_buffer_in_windows_safely): Add prototype.
18422
18423 * window.c: Declare Qdelete_window static again. Move down
18424 declaration of select_count.
18425 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18426 (Fother_window): Move to window.el.
18427 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18428 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18429 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18430 window.el.
18431 (replace_buffer_in_windows): Implement by calling
18432 Qreplace_buffer_in_windows.
18433 (replace_buffer_in_all_windows): Remove with some functionality
18434 moved into replace_buffer_in_windows_safely.
18435 (replace_buffer_in_windows_safely): New function.
18436 (select_window_norecord, select_frame_norecord): Move in front
18437 of run_window_configuration_change_hook. Remove now obsolete
18438 declarations.
640c8776
SM
18439 (Fset_window_buffer): Rewrite doc-string.
18440 Call Qrecord_window_buffer.
9397e56f
MR
18441 (keys_of_window): Move binding for other-window to window.el.
18442
b50691aa
CY
184432011-06-11 Chong Yidong <cyd@stupidchicken.com>
18444
18445 * dispextern.h (struct image): Replace data member, whose int_val
18446 and ptr_val fields were not used by anything, with a single
18447 lisp_val object.
18448
18449 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18450 (gif_clear_image, gif_load, imagemagick_load_image)
18451 (gs_clear_image, gs_load): Callers changed.
18452
3f754b86
PE
184532011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18454
cca69397
PE
18455 * buffer.h: Include <time.h>, for time_t.
18456 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18457
109e28d0
PE
18458 Fix minor problems found by static checking.
18459
60737f02
PE
18460 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18461
4b66faf3
PE
18462 Make identifiers static if they are not used in other modules.
18463 * data.c (Qcompiled_function, Qframe, Qvector):
18464 * image.c (QimageMagick, Qsvg):
18465 * minibuf.c (Qmetadata):
18466 * window.c (resize_window_check, resize_root_window): Now static.
18467 * window.h (resize_window_check, resize_root_window): Remove decls.
18468
109e28d0
PE
18469 * window.c (window_deletion_count, delete_deletable_window):
18470 Remove; unused.
46a4ce9e
PE
18471 (window_body_lines): Now static.
18472 (Fdelete_other_windows_internal): Mark vars as initialized.
18473 Make sure 'resize_failed' is initialized.
18474 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18475 (resize_window_apply): Remove unused local.
18476 * window.h (delete_deletable_window): Remove decl.
18477
109e28d0 18478 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
18479 (imagemagick_load_image): Fix pointer signedness problem by changing
18480 last arg from unsigned char * to char *. All uses changed.
18481 Also, fix a local for similar reasons.
18482 Remove unused locals. Remove locals to avoid shadowing.
18483 (fn_rsvg_handle_free): Remove; unused.
18484 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 18485 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 18486
3f754b86
PE
18487 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18488
2547adb1
CY
184892011-06-10 Chong Yidong <cyd@stupidchicken.com>
18490
18491 * image.c (gif_load): Fix omitted cast error introduced by
18492 2011-06-06 change.
18493
2c8e37d4
MR
184942011-06-10 Martin Rudalics <rudalics@gmx.at>
18495
18496 * window.h (resize_proportionally, orig_total_lines)
18497 (orig_top_line): Remove from window structure.
18498 (set_window_height, set_window_width, change_window_heights)
18499 (Fdelete_window): Remove prototypes.
18500 (resize_frame_windows): Remove duplicate declaration.
18501
440a42e3
EZ
185022011-06-10 Eli Zaretskii <eliz@gnu.org>
18503
18504 * window.h (resize_frame_windows, resize_window_check)
18505 (delete_deletable_window, resize_root_window)
18506 (resize_frame_windows): Declare prototypes.
18507
18508 * window.c (resize_window_apply): Make definition be "static" to
18509 match the prototype.
18510
562dd5e9
MR
185112011-06-10 Martin Rudalics <rudalics@gmx.at>
18512
18513 * window.c: Remove declarations of Qwindow_size_fixed,
18514 window_min_size_1, window_min_size_2, window_min_size,
18515 size_window, window_fixed_size_p, enlarge_window, delete_window.
18516 Remove static from declaration of Qdelete_window, it's
18517 temporarily needed by Fbury_buffer.
18518 (replace_window): Don't assign orig_top_line and
18519 orig_total_lines.
18520 (Fdelete_window, delete_window): Remove. Window deletion is
18521 handled by window.el.
640c8776
SM
18522 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18523 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
18524 (Fdelete_other_windows): Remove. Deleting other windows is
18525 handled by window.el.
18526 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18527 handled in window.el.
18528 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18529 Window minimum sizes are handled in window.el.
18530 (shrink_windows, size_window, set_window_height)
18531 (set_window_width, change_window_heights, window_height)
18532 (window_width, CURBEG, CURSIZE, enlarge_window)
18533 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18534 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18535 handled in window.el.
18536 (make_dummy_parent): Rename to make_parent_window and give it a
18537 second argument horflag.
18538 (make_window): Don't set resize_proportionally any more.
18539 (Fsplit_window): Remove. Windows are split in window.el.
18540 (save_restore_action, save_restore_orig_size)
18541 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18542 Resize mini windows in window.el.
18543 (grow_mini_window, shrink_mini_window): Implement by calling
18544 Qresize_root_window_vertically, resize_window_check and
18545 resize_window_apply.
640c8776
SM
18546 (saved_window, Fset_window_configuration, save_window_save):
18547 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
18548 resize_proportionally.
18549 (window_min_height, window_min_width): Move to window.el.
18550 (keys_of_window): Move bindings for delete-other-windows,
18551 split-window, delete-window and enlarge-window to window.el.
18552
18553 * buffer.c: Temporarily extern Qdelete_window.
18554 (Fbury_buffer): Temporarily call Qdelete_window instead of
18555 Fdelete_window (Fbury_buffer will move to window.el soon).
18556
18557 * frame.c (set_menu_bar_lines_1): Remove code handling
18558 orig_top_line and orig_total_lines.
18559
18560 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18561 set_window_height but set heights directly.
18562 (change_frame_size_1): Use resize_frame_windows.
18563
18564 * xdisp.c (init_xdisp): Don't use set_window_height but set
18565 heights directly.
18566
640c8776
SM
18567 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18568 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
18569 run_window_configuration_change_hook.
18570
18571 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18572 instead of change_window_heights and run
18573 run_window_configuration_change_hook.
18574
1a13852e
MR
185752011-06-09 Martin Rudalics <rudalics@gmx.at>
18576
18577 * window.c (replace_window): Rename second argument REPLACEMENT to
18578 NEW. New third argument SETFLAG. Rewrite.
18579 (delete_window, make_dummy_parent): Call replace_window with
18580 third argument 1.
18581 (window_list_1): Move down in code.
18582 (run_window_configuration_change_hook): Move set_buffer part
18583 before select_frame_norecord part in order to unwind correctly.
18584 Rename count1 to count.
18585 (recombine_windows, delete_deletable_window, resize_root_window)
18586 (Fdelete_other_windows_internal)
18587 (Frun_window_configuration_change_hook, make_parent_window)
18588 (resize_window_check, resize_window_apply, Fresize_window_apply)
18589 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
18590 (Fdelete_window_internal, Fresize_mini_window_internal):
18591 New functions.
1a13852e
MR
18592 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18593
f3d1777e
MR
185942011-06-08 Martin Rudalics <rudalics@gmx.at>
18595
496e208e
MR
18596 * window.h (window): Add some new members to window structure -
18597 normal_lines, normal_cols, new_total, new_normal, clone_number,
18598 splits, nest, prev_buffers, next_buffers.
18599 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 18600 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 18601
f3d1777e
MR
18602 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18603 Remove.
496e208e
MR
18604 (make_dummy_parent): Set new members of windows structure.
18605 (make_window): Move down in code. Handle new members of window
18606 structure.
18607 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18608 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18609 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18610 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
18611 (Fset_window_next_buffers, Fset_window_clone_number):
18612 New functions.
496e208e
MR
18613 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18614 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18615 Doc-string fixes.
18616 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18617 Argument WINDOW can be now internal window too.
18618 (Fwindow_use_time): Move up in code.
18619 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18620 Rewrite doc-string.
18621 (Fset_window_configuration, saved_window)
18622 (Fcurrent_window_configuration, save_window_save): Handle new
18623 members of window structure.
b9e809c2
MR
18624 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18625 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18626 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18627 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18628 Qget_mru_window, Qresize_root_window,
18629 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18630 Qauto_buffer_name; staticpro them.
f3d1777e 18631
abde8f8c
MR
186322011-06-07 Martin Rudalics <rudalics@gmx.at>
18633
18634 * window.c (Fwindow_total_size, Fwindow_left_column)
18635 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18636 (Fwindow_list_1): New functions.
18637 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
18638 (Fwindow_width, Fscroll_left, Fscroll_right):
18639 Use window_body_cols instead of window_box_text_cols.
18640 (delete_window, Fset_window_configuration):
18641 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
18642 (delete_all_subwindows): Take a window as argument and not a
18643 structure. Rewrite.
190b47e6
MR
18644 (window_loop): Remove handling of GET_LRU_WINDOW and
18645 GET_LARGEST_WINDOW.
18646 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
18647
18648 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
18649 window_box_text_cols. delete_all_subwindows now takes a
18650 Lisp_Object as argument.
abde8f8c 18651
640c8776
SM
18652 * indent.c (compute_motion, Fcompute_motion):
18653 Use window_body_cols instead of window_box_text_cols.
abde8f8c 18654
fa8a67e6
MR
18655 * frame.c (delete_frame): Call delete_all_subwindows with root
18656 window as argument.
18657
a54e3482
DC
186582011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18659
18660 * fns.c (Fputhash): Document return value.
18661
60002bf5
CY
186622011-06-06 Chong Yidong <cyd@stupidchicken.com>
18663
18664 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18665
0c671da6 186662011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 18667
b862a52a 18668 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 18669
be44ca6c
PE
18670 Check for overflow when converting integer to cons and back.
18671 * charset.c (Fdefine_charset_internal, Fdecode_char):
18672 Use cons_to_unsigned to catch overflow.
18673 (Fencode_char): Use INTEGER_TO_CONS.
18674 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18675 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18676 * data.c (long_to_cons, cons_to_long): Remove.
18677 (cons_to_unsigned, cons_to_signed): New functions.
18678 These signal an error for invalid or out-of-range values.
18679 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18680 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18681 * font.c (Ffont_variation_glyphs):
18682 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18683 * lisp.h: Include <intprops.h>.
18684 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18685 (cons_to_signed, cons_to_unsigned): New decls.
18686 (long_to_cons, cons_to_long): Remove decls.
18687 * undo.c (record_first_change): Use INTEGER_TO_CONS.
18688 (Fprimitive_undo): Use CONS_TO_INTEGER.
18689 * xfns.c (Fx_window_property): Likewise.
18690 * xselect.c: Include <limits.h>.
18691 (x_own_selection, selection_data_to_lisp_data):
18692 Use INTEGER_TO_CONS.
18693 (x_handle_selection_request, x_handle_selection_clear)
18694 (x_get_foreign_selection, Fx_disown_selection_internal)
18695 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
18696 (lisp_data_to_selection_data): Use cons_to_unsigned.
18697 (x_fill_property_data): Use cons_to_signed.
18698 Report values out of range.
18699
d1f3d2af
PE
18700 Check for buffer and string overflow more precisely.
18701 * buffer.h (BUF_BYTES_MAX): New macro.
18702 * lisp.h (STRING_BYTES_MAX): New macro.
18703 * alloc.c (Fmake_string):
18704 * character.c (string_escape_byte8):
18705 * coding.c (coding_alloc_by_realloc):
18706 * doprnt.c (doprnt):
18707 * editfns.c (Fformat):
18708 * eval.c (verror):
18709 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
18710 since they may not be the same number.
18711 * editfns.c (Finsert_char):
18712 * fileio.c (Finsert_file_contents):
18713 Likewise for BUF_BYTES_MAX.
18714
dd52fcea
PE
18715 * image.c: Use ptrdiff_t, not int, for sizes.
18716 (slurp_file): Switch from int to ptrdiff_t.
18717 All uses changed.
18718 (slurp_file): Check that file size fits in both size_t (for
18719 malloc) and ptrdiff_t (for sanity and safety).
18720
7f9bbdbb
PE
18721 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
18722 if b->modtime has its maximal value.
18723
dfe18f82
PE
18724 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
18725
84acfcf0
PE
18726 Don't assume time_t can fit into int.
18727 * buffer.h (struct buffer.modtime): Now time_t, not int.
18728 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
18729 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
18730
ccd9a01a
PE
18731 Minor fixes for signed vs unsigned integers.
18732 * character.h (MAYBE_UNIFY_CHAR):
18733 * charset.c (maybe_unify_char):
18734 * keyboard.c (read_char, reorder_modifiers):
18735 XINT -> XFASTINT, since the integer must be nonnegative.
18736 * ftfont.c (ftfont_spec_pattern):
18737 * keymap.c (access_keymap, silly_event_symbol_error):
18738 XUINT -> XFASTINT, since the integer must be nonnegative.
18739 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
18740 since it makes no difference and we prefer signed.
18741 * keyboard.c (record_char): Use XUINT when all the neighbors do.
18742 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
18743 nonnegative.
18744
d6d100dd
SM
187452011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
18746
18747 * window.h (Fwindow_frame): Declare.
18748
2b6148e4
PE
187492011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18750
18751 * alloc.c: Simplify handling of large-request failures (Bug#8800).
18752 (SPARE_MEMORY): Always define.
18753 (LARGE_REQUEST): Remove.
18754 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
18755
f230ecc9
MR
187562011-06-06 Martin Rudalics <rudalics@gmx.at>
18757
727e958e
MR
18758 * lisp.h: Move EXFUNS for Fframe_root_window,
18759 Fframe_first_window and Fset_frame_selected_window to window.h.
18760
18761 * window.h: Move EXFUNS for Fframe_root_window,
18762 Fframe_first_window and Fset_frame_selected_window here from
18763 lisp.h.
18764
18765 * frame.c (Fwindow_frame, Fframe_first_window)
18766 (Fframe_root_window, Fframe_selected_window)
18767 (Fset_frame_selected_window): Move to window.c.
18768 (Factive_minibuffer_window): Move to minibuf.c.
18769 (Fother_visible_frames_p): New function.
18770
18771 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18772
f230ecc9
MR
18773 * window.c (decode_window, decode_any_window): Move up in code.
18774 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18775 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
18776 (Fwindow_buffer): Move up and rewrite doc-string.
18777 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18778 (Fwindow_prev): New functions.
727e958e
MR
18779 (Fwindow_frame): Move here from frame.c. Accept any window as
18780 argument.
18781 (Fframe_root_window, Fframe_first_window)
18782 (Fframe_selected_window): Move here from frame.c. Accept frame
18783 or arbitrary window as argument. Update doc-strings.
18784 (Fminibuffer_window): Move up in code.
18785 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
18786 (Fset_frame_selected_window): Move here from frame.c.
18787 Marginal rewrite.
727e958e
MR
18788 (Fselected_window, select_window, Fselect_window): Move up in
18789 code. Minor doc-string fixes.
f230ecc9 18790
4d09bcf6
PE
187912011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18792
18793 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18794 Do not assume that spare memory exists; that assumption is valid
18795 only if SYSTEM_MALLOC.
18796 (LARGE_REQUEST): New macro, so that the issue of large requests
18797 is separated from the issue of spare memory.
18798
810928a2
AS
187992011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18800
172418ad
AS
18801 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18802 format. (Bug#8806)
18803
43f862f7
AS
18804 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18805
810928a2
AS
18806 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18807 before statements.
18808
a059fe24
JD
188092011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18810
18811 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18812
18813 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18814
18815 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18816 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18817
989bf368
JB
188182011-06-05 Juanma Barranquero <lekktu@gmail.com>
18819
18820 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18821
4b80f674
CY
188222011-06-04 Chong Yidong <cyd@stupidchicken.com>
18823
18824 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18825 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
18826 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18827 New error handlers.
4b80f674
CY
18828 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18829 Obey Vx_select_enable_clipboard_manager. Catch errors in
18830 x_clipboard_manager_save (Bug#8779).
18831 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 18832 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 18833
99a33b77 188342011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
18835
18836 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
18837
99a33b77 188382011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
18839
18840 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
18841 in the current matrix if keep_current_p is non-zero.
18842
8264569d
EZ
188432011-06-04 Eli Zaretskii <eliz@gnu.org>
18844
18845 * bidi.c (bidi_level_of_next_char): Fix last change.
18846
57f97249
EZ
188472011-06-03 Eli Zaretskii <eliz@gnu.org>
18848
fec2107c 18849 Support bidi reordering of text covered by display properties.
57f97249 18850
fec2107c
EZ
18851 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
18852 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
18853 (bidi_cache_search, bidi_cache_iterator_state)
18854 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
18855 (bidi_level_of_next_char, bidi_move_to_visually_next):
18856 Support character positions inside a run of characters covered by a
fec2107c
EZ
18857 display string.
18858 (bidi_paragraph_init, bidi_resolve_explicit_1)
18859 (bidi_level_of_next_char): Call bidi_fetch_char and
18860 bidi_fetch_char_advance instead of FETCH_CHAR and
18861 FETCH_CHAR_ADVANCE.
18862 (bidi_init_it): Initialize new members.
18863 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
18864 definitions.
18865 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
18866 instead of using explicit *_CHAR codes.
d6d100dd
SM
18867 (bidi_resolve_explicit, bidi_resolve_weak):
18868 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
18869 bidirectional text is supported only in multibyte buffers.
18870 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
18871 it to initialize the frame_window_p member of struct bidi_it.
18872 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
18873 (bidi_resolve_explicit, bidi_resolve_weak)
18874 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
18875 bidi_it->nchars is non-positive.
18876 (bidi_level_of_next_char): Don't try to lookup the cache for the
18877 next/previous character if nothing is cached there yet, or if we
18878 were just reseat()'ed to a new position.
c40e2fb2 18879
0e14fe90
EZ
18880 * xdisp.c (set_cursor_from_row): Set start and stop points
18881 according to the row's direction when priming the loop that looks
18882 for the glyph on which to display cursor.
18883 (single_display_spec_intangible_p): Function deleted.
18884 (display_prop_intangible_p): Reimplement to call
18885 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
18886 Accept 3 additional arguments needed by handle_display_spec.
18887 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
18888 values: lists, `(when COND...)' forms, etc.
18889 (single_display_spec_string_p): Support property values that are
18890 lists with the argument STRING its top-level element.
18891 (display_prop_string_p): Fix the condition for processing a
18892 property that is a list to be consistent with handle_display_spec.
fec2107c 18893 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
18894 last portion of handle_display_prop.
18895 (compute_display_string_pos): Accept additional argument
18896 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
18897 value of a `display' property is a "replacing spec".
18898 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
18899 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
18900 the display property, but just return a value indicating whether
18901 the display property will replace the characters it covers.
18902 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
18903 frame_window_p members of struct bidi_it.
d6d100dd
SM
18904 (compute_display_string_pos, compute_display_string_end):
18905 New functions.
fec2107c
EZ
18906 (push_it): Accept second argument POSITION, where pop_it should
18907 jump to continue iteration.
18908 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 18909
fec2107c
EZ
18910 * keyboard.c (adjust_point_for_property): Adjust the call to
18911 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
18912
18913 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
18914 (bidi_init_it): Update prototypes.
18915 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
18916 (compute_display_string_pos, compute_display_string_end):
18917 Declare prototypes.
fec2107c
EZ
18918 (struct bidi_it): New members nchars and disp_pos. ch_len is now
18919 EMACS_INT.
fc6f18ce 18920
40087514 189212011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 18922
57f53182
PE
18923 Malloc failure behavior now depends on size of allocation.
18924 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
18925 * lisp.h: Change signatures accordingly.
18926 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
18927 All callers changed. (Bug#8762)
18928
18929 * gnutls.c: Use Emacs's memory allocators.
18930 Without this change, the gnutls library would invoke malloc etc.
18931 directly, which causes problems on non-SYNC_INPUT hosts, and which
18932 runs afoul of improving memory_full behavior. (Bug#8761)
18933 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
18934 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
18935 xfree instead of the default malloc, realloc, free.
18936 (Fgnutls_boot): No need to check for memory allocation failure,
18937 since xmalloc does that for us.
18938
ac32cd99 18939 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
18940 * category.c (hash_get_category_set):
18941 * ccl.c (ccl_driver):
18942 * charset.c (Fdefine_charset_internal):
18943 * charset.h (struct charset.hash_index):
18944 * composite.c (get_composition_id, gstring_lookup_cache)
18945 (composition_gstring_put_cache):
18946 * composite.h (struct composition.hash_index):
18947 * dispextern.h (struct image.hash):
18948 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
18949 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
18950 (hashfn_equal, hashfn_user_defined, make_hash_table)
18951 (maybe_resize_hash_table, hash_lookup, hash_put)
18952 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
18953 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
18954 (Fsxhash, Fgethash, Fputhash, Fmaphash):
18955 * image.c (make_image, search_image_cache, lookup_image)
18956 (xpm_put_color_table_h):
18957 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 18958 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 18959 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 18960 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
18961 * alloc.c (allocate_vectorlike):
18962 Check for overflow in vector size calculations.
18963 * ccl.c (ccl_driver):
18964 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
18965 * fns.c, image.c: Remove unnecessary static decls that would otherwise
18966 need to be updated by these changes.
40087514
PE
18967 * fns.c (make_hash_table, maybe_resize_hash_table):
18968 Check for integer overflow with large hash tables.
0de4bb68
PE
18969 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
18970 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
18971 (SXHASH_REDUCE): New macro.
18972 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
18973 Use it instead of discarding useful hash info with large hash values.
18974 (sxhash_float): New function.
18975 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
18976 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
18977 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
18978 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
18979 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
18980 Adjust signatures to match updated version of code.
18981 (consing_since_gc): Now EMACS_INT, since a single hash table can
18982 use more than INT_MAX bytes.
18983
698d32e2
DN
189842011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
18985
18986 Make it possible to build with GCC-4.6+ -O2 -flto.
18987
18988 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
18989
fd6fa53f
SM
189902011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
18991
18992 * minibuf.c (get_minibuffer, read_minibuf_unwind):
18993 Call minibuffer-inactive-mode.
18994
864db017
JB
189952011-05-31 Juanma Barranquero <lekktu@gmail.com>
18996
18997 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
18998 Update dependencies.
18999
2ad0baf4
DN
190002011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19001
19002 * data.c (init_data): Remove code for UTS, this system is not
19003 supported anymore.
19004
4fcc2638
DN
190052011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19006
19007 Don't force ./temacs to start in terminal mode.
19008
19009 * frame.c (make_initial_frame): Initialize faces in all cases, not
19010 only when CANNOT_DUMP is defined.
19011 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19012
c56e0fd5
DN
190132011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19014
19015 * dispnew.c (add_window_display_history): Use const for the string
19016 pointer. Remove declaration, not needed.
19017
333d54da 190182011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 19019
55d4c1b2 19020 Use 'inline', not 'INLINE'.
333d54da 19021 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
19022 * alloc.c, fontset.c (INLINE): Remove.
19023 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19024 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19025 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19026 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19027 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19028
738db178
DN
190292011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19030
19031 Make it possible to run ./temacs.
19032
19033 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19034 syms_of_callproc does the same thing. Remove test for
19035 "initialized", do it in the caller.
19036 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19037
620c53a6
SM
190382011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19039
19040 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19041 (read_minibuf): Use get_minibuffer.
19042 (syms_of_minibuf): Use DEFSYM.
19043 (Qmetadata): New var.
19044 * data.c (Qbuffer): Don't make it static.
19045 (syms_of_data): Use DEFSYM.
19046
e003a292
PE
190472011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19048
19049 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19050 (CCL_CODE_MIN): New macro.
19051
ed008a6d
PE
190522011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19053
3687c2ef
PE
19054 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19055
ed008a6d
PE
19056 * eval.c (Qdebug): Now static.
19057 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19058 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19059 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19060
d66c4c7c
CY
190612011-05-29 Chong Yidong <cyd@stupidchicken.com>
19062
19063 * image.c: Various fixes to ImageMagick code comments.
19064 (Fimagemagick_types): Doc fix.
19065
5fbc2025
PE
190662011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19067
0196f88a
PE
19068 Minor fixes prompted by GCC 4.6.0 warnings.
19069
19070 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19071
5fbc2025
PE
19072 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19073 (x_clipboard_manager_save_all): Move extern decl to ...
19074 * xterm.h: ... here, so that it can be checked for consistency.
19075
1dd3c2d9
CY
190762011-05-29 Chong Yidong <cyd@stupidchicken.com>
19077
19078 * xselect.c (x_clipboard_manager_save_frame)
19079 (x_clipboard_manager_save_all): New functions.
19080 (Fx_clipboard_manager_save): Lisp function deleted.
19081
19082 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19083 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19084
19085 * xterm.h: Update prototype.
19086
5ba6571d
WX
190872011-05-28 William Xu <william.xwl@gmail.com>
19088
19089 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19090 exiting (Bug#8239).
19091
3eaff834
JM
190922011-05-28 Jim Meyering <meyering@redhat.com>
19093
e1900994 19094 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
19095 * fns.c (to_uchar): Define.
19096 (crypto_hash_function): Use it to convert some newly-signed
19097 variables to unsigned, to avoid sign-extension bugs. For example,
19098 without this change, (md5 "truc") would evaluate to
19099 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19100 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 19101 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 19102
0f6990a7
PE
191032011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19104
19105 Integer overflow fixes.
c8a9ca5a 19106
08686060
PE
19107 * dbusbind.c: Serial number integer overflow fixes.
19108 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
19109 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19110 to hold a serial number that is too large for a fixnum.
19111 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19112 Check for serial numbers out of range. Decode any serial number
59568bf0 19113 that was so large that it became a float. (Bug#8722)
08686060 19114
2d1fc3c7
PE
19115 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19116 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19117 Use XFASTINT rather than XUINT when numbers are nonnegative.
19118 (xd_append_arg, Fdbus_method_return_internal):
19119 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19120 arguments, check that Lisp number is nonnegative, rather than
59568bf0 19121 silently wrapping negative numbers around. (Bug#8722)
30217ff0 19122 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 19123 (Bug#8722)
2d1fc3c7 19124
c8a9ca5a
PE
19125 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19126
519e1d69
PE
19127 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19128
6df6ae42 19129 ccl: Add integer overflow checks.
30569699
PE
19130 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19131 (IN_INT_RANGE): New macros.
19132 (ccl_driver): Use them to check for integer overflow when
19133 decoding a CCL program. Many of the new checks are whether XINT (x)
19134 fits in int; it doesn't always, on 64-bit hosts. The new version
19135 doesn't catch all possible integer overflows, but it's an
847044ea 19136 improvement. (Bug#8719)
30569699 19137
c11285dc
PE
19138 * alloc.c (make_event_array): Use XINT, not XUINT.
19139 There's no need for unsigned here.
19140
fdccd48e
PE
19141 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19142 This follows up to the 2011-05-06 change that substituted uintptr_t
19143 for EMACS_INT. This case wasn't caught back then.
19144
37910ab2
PE
19145 Rework Fformat to avoid integer overflow issues.
19146 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19147 now (part of C89). Include <verify.h>.
19148 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19149 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19150 (Fformat): Avoid the prepass trying to compute sizes; it was only
19151 approximate and thus did not catch overflow reliably. Instead, walk
19152 through the format just once, formatting and computing sizes as we go,
19153 checking for integer overflow at every step, and allocating a larger
19154 buffer as needed. Keep track separately whether the format is
19155 multibyte. Keep only the most-recently calculated precision, rather
19156 than them all. Record whether each argument has been converted to
19157 string. Use EMACS_INT, not int, for byte and char and arg counts.
19158 Support field widths and precisions larger than INT_MAX. Avoid
19159 sprintf's undefined behavior with conversion specifications such as %#d
19160 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19161 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19162 formatting out-of-range floating point numbers with int
9173deec 19163 formats. (Bug#8668)
37910ab2 19164
2e6578fb
PE
19165 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19166
0ae6bdee
PE
19167 * data.c: Avoid integer truncation in expressions involving floats.
19168 * data.c: Include <intprops.h>.
19169 (arith_driver): When there's an integer overflow in an expression
19170 involving floating point, convert the integers to floating point
19171 so that the resulting value does not suffer from catastrophic
19172 integer truncation. For example, on a 64-bit host (* 4
19173 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19174 Do not rely on undefined behavior after integer overflow.
19175
de883a70
PE
19176 merge count_size_as_multibyte, parse_str_to_multibyte
19177 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 19178 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
19179 Check for integer overflow.
19180 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19181 since it's now a duplicate of the other. This is more of
19182 a character than a buffer op, so better that it's in character.c.
19183 * fns.c, print.c: Adjust to above changes.
19184
2ff916cb
PE
191852011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19186
19187 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19188
f1b54466
PE
191892011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19190
fb1ac845
PE
19191 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19192 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19193 (x_clipboard_manager_save): Now static.
19194 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19195
f1b54466
PE
19196 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19197 (crypto_hash_function): Now static.
19198 Fix pointer signedness problems. Avoid unnecessary initializations.
19199
a9f737ee
CY
192002011-05-27 Chong Yidong <cyd@stupidchicken.com>
19201
19202 * termhooks.h (Vselection_alist): Make it terminal-local.
19203
19204 * terminal.c (create_terminal): Initialize it.
19205
19206 * xselect.c: Support for clipboard managers.
19207 (Vselection_alist): Move to termhooks.h as terminal-local var.
19208 (LOCAL_SELECTION): New macro.
19209 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19210 (symbol_to_x_atom): Remove gratuitous arg.
19211 (x_handle_selection_request, lisp_data_to_selection_data)
19212 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
19213 (x_own_selection, x_get_local_selection, x_convert_selection):
19214 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
19215 (some_frame_on_display): Delete unused function.
19216 (Fx_own_selection_internal, Fx_get_selection_internal)
19217 (Fx_disown_selection_internal, Fx_selection_owner_p)
19218 (Fx_selection_exists_p): New optional frame arg.
19219 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19220 (x_handle_selection_clear): Don't treat other terminals with the
19221 same keyboard specially. Use the terminal-local Vselection_alist.
19222 (x_clear_frame_selections): Use Frun_hook_with_args.
19223
19224 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19225
19226 * xterm.h: Add support for those atoms.
19227
e067f0c1
CY
192282011-05-26 Chong Yidong <cyd@stupidchicken.com>
19229
19230 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19231 (converted_selections, conversion_fail_tag): New global variables.
19232 (x_selection_request_lisp_error): Free the above.
19233 (x_get_local_selection): Remove unnecessary code.
19234 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
19235 of converted selections stored in converted_selections.
19236 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
19237 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19238 (x_convert_selection): New function.
19239 (x_handle_selection_event): Simplify.
19240 (x_get_foreign_selection): Don't ignore incoming requests while
19241 waiting for an answer; this will fail when we implement
19242 SAVE_TARGETS, and seems unnecessary anyway.
19243 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19244 (Vx_sent_selection_functions): Doc fix.
19245
0f4aebc0
LL
192462011-05-26 Leo Liu <sdl.web@gmail.com>
19247
19248 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19249
e61124cd
YM
192502011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19251
19252 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19253
19254 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19255 for fringe update if it has periodic bitmap.
ac389d0c 19256 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
19257 and fringe_bitmap_periodic_p.
19258
19259 * fringe.c (get_fringe_bitmap_data): New function.
19260 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19261 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19262 row. Mark glyph row for fringe update if periodicity changed.
19263
19264 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19265 for fringe update unless it has periodic bitmap.
19266
f16d9837
KH
192672011-05-25 Kenichi Handa <handa@m17n.org>
19268
19269 * xdisp.c (get_next_display_element): Set correct it->face_id for
19270 a static composition.
19271
e1b90ef6
LL
192722011-05-24 Leo Liu <sdl.web@gmail.com>
19273
19274 * deps.mk (fns.o):
19275 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19276
19277 * fns.c (crypto_hash_function, Fsha1): New function.
19278 (Fmd5): Use crypto_hash_function.
19279 (syms_of_fns): Add Ssha1.
19280
7400048f
PE
192812011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19282
19283 * gnutls.c: Remove unused macros.
19284 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19285 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19286 Remove macros that are defined and never used.
19287 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19288
abb71cf4
CY
192892011-05-22 Chong Yidong <cyd@stupidchicken.com>
19290
19291 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19292 (Fx_get_selection_internal): Minor cleanup.
19293 (Fx_own_selection_internal): Rename arguments for consistency with
19294 select.el.
19295
6307db39
PE
192962011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19297
19298 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19299
f3d4e0a4
CY
193002011-05-22 Chong Yidong <cyd@stupidchicken.com>
19301
19302 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19303
4d8ade89
YM
193042011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19305
19306 * dispnew.c (scrolling_window): Don't exclude the case that the
19307 last enabled row in the desired matrix touches the bottom boundary.
19308
32078c8d
GM
193092011-05-21 Glenn Morris <rgm@gnu.org>
19310
19311 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
19312 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19313 and add some more files.
32078c8d 19314
7285dc67
EZ
193152011-05-20 Eli Zaretskii <eliz@gnu.org>
19316
19317 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19318 report_file_error introduced by the change from 2011-05-07.
19319
89d1bd22
PE
193202011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19321
19322 * systime.h (Time): Define only if emacs is defined.
19323 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19324 where the include path doesn't have X11/X.h by default. See
19325 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19326
cd394be1 193272011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
19328
19329 * composite.c (find_automatic_composition): Fix previous change.
19330
b9704ad9
GM
193312011-05-20 Glenn Morris <rgm@gnu.org>
19332
19333 * lisp.mk: New file, split from Makefile.in.
19334 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19335 (shortlisp): Remove.
19336 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19337
4a720484
GM
193382011-05-19 Glenn Morris <rgm@gnu.org>
19339
19340 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19341 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19342 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19343 (lisp): Set the order to that of loadup.el.
19344 (shortlisp): Make it a copy of $lisp.
19345 (SOME_MACHINE_LISP): Remove.
19346 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19347 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19348
a28d4396
KH
193492011-05-18 Kenichi Handa <handa@m17n.org>
19350
19351 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19352 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19353 (find_automatic_composition): Mostly rewrite for efficiency.
19354
a2b1fa8e
JB
193552011-05-18 Juanma Barranquero <lekktu@gmail.com>
19356
19357 * makefile.w32-in: Update dependencies.
19358
8e1f5610
CS
193592011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19360
19361 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 19362 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 19363
7025ee00 193642011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 19365
cdfa6eab
PE
19366 Fix some integer overflow issues, such as string length overflow.
19367
06d6db33
PE
19368 * insdel.c (count_size_as_multibyte): Check for string overflow.
19369
2b4560a8
PE
19370 * character.c (lisp_string_width): Check for string overflow.
19371 Use EMACS_INT, not int, for string indexes and lengths; in
19372 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19373 the resulting string length overflows an EMACS_INT; instead,
19374 report a string overflow if no precision given. When checking for
19375 precision exhaustion, use a check that cannot possibly have
19376 integer overflow. (Bug#8675)
19377 * character.h (lisp_string_width): Adjust to new signature.
19378
cb93f9be
PE
19379 * alloc.c (string_overflow): New function.
19380 (Fmake_string): Use it. This doesn't change behavior, but saves
19381 a few bytes and will simplify future changes.
19382 * character.c (string_escape_byte8): Likewise.
19383 * lisp.h (string_overflow): New decl.
19384
1a1f3366
PE
19385 Fixups, following up to the user-interface timestamp change.
19386 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19387 for UI timestamps, instead of unsigned long.
9fbd6841
PE
19388 * msdos.c (mouse_get_pos): Likewise.
19389 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
19390 * w32gui.h (Time): Define by including "systime.h" rather than by
19391 declaring it ourselves. (Bug#8664)
19392
d4e3e4d3
PE
19393 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19394 * image.c (clear_image_cache): Likewise.
19395
f6a24d19
PE
19396 * term.c (term_mouse_position): Don't assume time_t wraparound.
19397
08dc5ae6
PE
19398 Be more systematic about user-interface timestamps.
19399 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
19400 and sometimes 'EMACS_UINT', to represent these timestamps.
19401 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
19402 This makes the code easier to follow, and makes it easier to catch
19403 integer overflow bugs such as Bug#8664.
19404 * frame.c (Fmouse_position, Fmouse_pixel_position):
19405 Use Time, not unsigned long, for user-interface timestamps.
19406 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19407 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19408 * keyboard.h (last_event_timestamp): Likewise.
19409 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19410 * menu.h (xmenu_show): Likewise.
19411 * term.c (term_mouse_position): Likewise.
19412 * termhooks.h (struct input_event.timestamp): Likewise.
19413 (struct terminal.mouse_position_hook): Likewise.
19414 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19415 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19416 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19417 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19418 what it was before.
19419 * menu.h, termhooks.h: Include "systime.h", for Time.
19420
8e55734a
PE
19421 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19422 Don't assume that the difference between two unsigned long values
19423 can fit into an integer. At this point, we know button_down_time
19424 <= event->timestamp, so the difference must be nonnegative, so
19425 there's no need to cast the result if double-click-time is
19426 nonnegative, as it should be; check that it's nonnegative, just in
19427 case. This bug is triggered when events are more than 2**31 ms
86db42d2 19428 apart (about 25 days). (Bug#8664)
8e55734a 19429
841f1b75 19430 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 19431 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 19432
3e26f69c
PE
19433 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19434 that always fit in int. Use a sentinel instead of a counter, to
19435 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
19436 * frame.h (struct frame): Use int for menu_bar_items_used
19437 instead of EMACS_INT, since it always fits in int.
3e26f69c 19438
5cc152c0
PE
19439 * menu.c (grow_menu_items): Check for int overflow.
19440
d89eb65e
PE
19441 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19442
5235bd3e
PE
19443 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19444 Before, the code was not consistent. These values cannot exceed
19445 2**31 - 1 so there's no need to make them unsigned.
19446 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19447 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19448 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19449 as modifiers.
19450 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19451
bc827e23
PE
19452 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19453 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19454 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19455 presumably because the widths might not match.
19456
78eb494e
PE
19457 * window.c (size_window): Avoid needless test at loop start.
19458
04f2d78b
CB
194592011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19460
19461 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19462
d2fc7e3d 194632011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
19464
19465 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19466
d2fc7e3d 194672011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
19468
19469 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19470 `width' to `bar_area_x' and `bar_area_width', respectively.
19471 (x_scroll_run): Take account of fringe background extension.
19472
04f2d78b
CB
19473 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19474 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
19475 `bar_area_width', respectively.
19476 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19477 background extension.
19478
79b70037
GM
194792011-05-10 Jim Meyering <meyering@redhat.com>
19480
19481 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19482
2f142cc5
JB
194832011-05-10 Juanma Barranquero <lekktu@gmail.com>
19484
19485 * image.c (Finit_image_library): Return t for built-in image types,
19486 like pbm and xbm. (Bug#8640)
19487
57679c86
AS
194882011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19489
19490 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19491
888c9e86
EZ
194922011-05-07 Eli Zaretskii <eliz@gnu.org>
19493
b0512a1d
EZ
19494 * w32console.c (Fset_screen_color): Doc fix.
19495 (Fget_screen_color): New function.
19496 (syms_of_ntterm): Defsubr it.
19497
7285dc67
EZ
19498 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19499 unlink the temporary file if Fcall_process didn't create it in the
19500 first place.
19501 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19502 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
19503 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19504 cue to call_process_cleanup not to close that handle.
19505
4d3fcc8e
BK
195062011-05-07 Ben Key <bkey76@gmail.com>
19507
19508 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19509 one of two shell specific rules, either bootstrap-temacs-CMD or
19510 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19511 to the previous implementation of the bootstrap-temacs rule.
19512 The bootstrap-temacs-CMD rule is similar to the previous
19513 implementation of the bootstrap-temacs rule except that it
19514 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19515 variable.
19516
19517 These changes, along with some changes to nt/configure.bat,
19518 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19519 earlier fix to add support for --cflags and --ldflags options
19520 that include quotes so that it works whether make uses cmd or
19521 sh as the shell.
19522
b4289b64
MA
195232011-05-06 Michael Albinus <michael.albinus@gmx.de>
19524
19525 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19526 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19527 is a constant.
19528 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19529 a string. Handle both cases.
19530 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19531 (Fdbus_register_method): Use Qinvalid_function.
19532
af4c0e28
JB
195332011-05-06 Juanma Barranquero <lekktu@gmail.com>
19534
19535 * makefile.w32-in: Update dependencies.
19536 (LISP_H): Add inttypes.h and stdin.h.
19537 (PROCESS_H): Add unistd.h.
19538
c51453d9
EZ
195392011-05-06 Eli Zaretskii <eliz@gnu.org>
19540
19541 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19542 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19543
8ff0ac3c 195442011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 19545
4c4b566b
PE
19546 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19547
aab2b9b5
PE
19548 * term.c (vfatal): Remove stray call to va_end.
19549 It's not needed and the C Standard doesn't allow it here anyway.
19550
c378da0b
PE
19551 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19552 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19553
288b08c7
PE
19554 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19555 bytes.
19556
e3601888
PE
19557 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19558
db6c0e74
PE
19559 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19560
dd5963ea
PE
19561 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19562
88c9450f
PE
19563 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19564
2f9442b8
PE
19565 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19566
c032b5f8
PE
19567 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19568 * charset.c (Fdefine_charset_internal): Don't initialize
19569 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 19570 32-bit int (Bug#8600).
a108c10b
PE
19571
19572 * lread.c (read_integer): Be more consistent with string-to-number.
19573 Use string_to_number to do the actual conversion; this avoids
19574 rounding errors and fixes some other screwups. Without this fix,
19575 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19576 (digit_to_number): Move earlier, for benefit of read_integer.
19577 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 19578 not a digit in any supported base. (Bug#8602)
a108c10b 19579
ad5f9eea
PE
19580 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19581
aec1708a
PE
19582 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19583 to match comment at start of function. This also removes a
19584 GCC warning about overflow in a 32+64-bit port.
19585
47be4ab5
PE
19586 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19587
371cac43
PE
19588 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19589 Reported by Stefan Monnier in
19590 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
19591 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19592 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 19593
d01a7826
PE
19594 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19595 (EMACS_UINTPTR): Likewise, with uintptr_t.
19596
7fd47d5c
PE
19597 * lisp.h: Prefer 64-bit EMACS_INT if available.
19598 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19599 on 32-bit hosts that have 64-bit int, so that they can access
19600 large files.
122b0c86
PE
19601 However, temporarily disable this change unless the temporary
19602 symbol WIDE_EMACS_INT is defined.
7fd47d5c 19603
8727937b
PE
19604 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19605
8ac068ac
PE
19606 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19607 This removes an assumption that EMACS_INT and long are the same
19608 width as pointers. The assumption is true for Emacs porting targets
19609 now, but we want to make other targets possible.
19610 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19611 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19612 In the rest of the code, change types of integers that hold casted
19613 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19614 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19615 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19616 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19617 No need to cast type when ORing.
19618 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19619 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19620 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19621 assume EMACS_INT is the same width as char *.
19622 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19623 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19624 Remove no-longer-needed casts.
19625 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19626 (xg_tool_bar_help_callback, xg_make_tool_item):
19627 Use EMACS_INTPTR to hold an integer
19628 that will be cast to void *; this can avoid a GCC warning
19629 if EMACS_INT is not the same width as void *.
19630 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19631 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19632 (current_message_1, set_message_1):
19633 Use a local to convert to proper width without a cast.
19634 * xmenu.c (dialog_selection_callback): Likewise.
19635
ede49d71
PE
19636 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19637 Also, don't assume VALBITS / RAND_BITS is less than 5,
19638 and don't rely on undefined behavior when shifting a 1 left into
19639 the sign bit.
19640 * lisp.h (get_random): Change signature to match.
19641
2f30ecd0
PE
19642 * lread.c (hash_string): Use size_t, not int, for hash computation.
19643 Normally we prefer signed values; but hashing is special, because
19644 it's better to use unsigned division on hash table sizes so that
19645 the remainder is nonnegative. Also, size_t is the natural width
19646 for hashing into memory. The previous code used 'int', which doesn't
19647 retain enough info to hash well into very large tables.
19648 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19649
2a866e7b
PE
19650 * dbusbind.c: Don't possibly lose pointer info when converting.
19651 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19652 Use XPNTR rather than XHASH, so that the high-order bits of
19653 the pointer aren't lost when converting through void *.
19654
51639eac
PE
19655 * eval.c (Fautoload): Don't double-shift a pointer.
19656
92394119
PE
19657 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19658
dbdb9a7c
JB
196592011-05-06 Juanma Barranquero <lekktu@gmail.com>
19660
19661 * gnutls.c (DEF_GNUTLS_FN):
19662 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19663
db7a0b4f
AS
196642011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19665
19666 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19667 marker. (Bug#8610)
19668
cd394be1 196692011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
19670
19671 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19672 New version that can reserve upto 2GB of heap space.
19673
f7ff1b0f 196742011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
19675
19676 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19677
639c109b
TZ
196782011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19679
19680 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19681 `gnutls_certificate_set_x509_key_file'.
19682
d2127135
JB
196832011-05-05 Juanma Barranquero <lekktu@gmail.com>
19684
19685 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19686 Update dependencies.
19687
e968f4f3
JB
196882011-05-04 Juanma Barranquero <lekktu@gmail.com>
19689
19690 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
19691 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
19692 Remove unused parameter `fildes'.
19693 * process.c (read_process_output, send_process): Don't pass it.
19694
84d358f0
JB
196952011-05-04 Juanma Barranquero <lekktu@gmail.com>
19696
19697 Fix previous change: the library cache is defined in w32.c.
19698 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
19699 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
19700
0898ca10
JB
197012011-05-04 Juanma Barranquero <lekktu@gmail.com>
19702
19703 Implement dynamic loading of GnuTLS on Windows.
19704
19705 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
19706 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
19707 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19708 Declare.
19709
19710 * gnutls.c (Qgnutls_dll): Define.
19711 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
19712 (gnutls_*): Declare function pointers.
19713 (init_gnutls_functions): New function to initialize function pointers.
19714 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
19715 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
19716 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19717 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
19718 (emacs_gnutls_write, emacs_gnutls_read)
19719 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
19720 (Fgnutls_available_p): New function.
19721 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
19722 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
19723 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
19724
19725 * image.c: Include w32.h.
19726 (Vimage_type_cache): Delete.
19727 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
19728 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
19729 (w32_delayed_load): Move to w32.c.
19730
19731 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
19732
19733 * w32.c (QCloaded_from, Vlibrary_cache): Define.
19734 (w32_delayed_load): Move from image.c. When loading a library, record
19735 its filename in the :loaded-from property of the library id.
19736 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
19737 Initialize and staticpro them.
19738 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
19739
19740 * process.c: Include lisp.h before w32.h, not after.
19741 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
19742 instead of gnutls_record_check_pending.
19743
19744 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
19745
ff4de4aa
TZ
197462011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
19747
19748 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
19749 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
19750 as passed in.
19751
abe95abb
JD
197522011-05-03 Jan Djärv <jan.h.d@swipnet.se>
19753
19754 * xterm.c (x_set_frame_alpha): Do not set property on anything
19755 else than FRAME_X_OUTER_WINDOW (Bug#8608).
19756
e16e55d4
JB
197572011-05-02 Juanma Barranquero <lekktu@gmail.com>
19758
19759 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
19760
bafcf6a5
JB
197612011-05-02 Juanma Barranquero <lekktu@gmail.com>
19762
19763 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
19764 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
19765 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
19766 (gnutls_global_initialized, Qgnutls_bootprop_priority)
19767 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
19768 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
19769 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
19770 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
19771 (Qgnutls_bootprop_callbacks_verify): Make static.
19772
e7a6747f
AS
197732011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19774
19ed11ba
AS
19775 * callproc.c: Indentation fixup.
19776
e7a6747f 19777 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
19778 (wait_for_termination, interruptible_wait_for_termination):
19779 Move after wait_for_termination_1.
e7a6747f 19780
1ef14cb4
LMI
197812011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19782
19783 * sysdep.c (interruptible_wait_for_termination): New function
19784 which is like wait_for_termination, but allows keyboard
19785 interruptions.
19786
19787 * callproc.c (Fcall_process): Add (:file "file") as an option for
19788 the STDOUT buffer.
19789 (Fcall_process_region): Ditto.
19790
330d880c
EZ
197912011-04-30 Eli Zaretskii <eliz@gnu.org>
19792
8db90b73
EZ
19793 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19794 rather than `XVECTOR (FOO)->size'.
19795
330d880c
EZ
19796 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19797 inttypes.h, as a gnulib replacement is used if it not available in
19798 system headers.
19799
15cbd324
EZ
198002011-04-21 Eli Zaretskii <eliz@gnu.org>
19801
19802 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19803 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19804 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19805
19806 * coding.c (coding_alloc_by_realloc): Error out if destination
19807 will grow beyond MOST_POSITIVE_FIXNUM.
19808 (decode_coding_emacs_mule): Abort if there isn't enough place in
19809 charbuf for the composition carryover bytes. Reserve an extra
19810 space for up to 2 characters produced in a loop.
19811 (decode_coding_iso_2022): Abort if there isn't enough place in
19812 charbuf for the composition carryover bytes.
19813
198142011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 19815
ae940cca
EZ
19816 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19817 aborting when %lld or %lll format is passed.
19818 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19819 %llo or %llx format is passed. (Bug#8545)
19820
03ab8921
EZ
19821 * window.c (window_scroll_line_based): Use a marker instead of
19822 simple variables to record original value of point. (Bug#7952)
19823
afda1437
EZ
19824 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19825 produced by %s or %c overflows available buffer space. (Bug#8545)
19826
f76dee0c
PE
198272011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19828
19829 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 19830 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 19831
fdc5744d
JB
198322011-04-28 Juanma Barranquero <lekktu@gmail.com>
19833
19834 * w32.c (init_environment): Warn about defaulting HOME to C:\.
19835
638f053a
JB
198362011-04-28 Juanma Barranquero <lekktu@gmail.com>
19837
19838 * keyboard.c (Qdelayed_warnings_hook): Define.
19839 (command_loop_1): Run `delayed-warnings-hook'
19840 if Vdelayed_warnings_list is non-nil.
19841 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
19842 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
19843
d178f871
EZ
198442011-04-28 Eli Zaretskii <eliz@gnu.org>
19845
19846 * doprnt.c (doprnt): Don't return value smaller than the buffer
19847 size if the message was truncated. (Bug#8545).
19848
b124fd93
JB
198492011-04-28 Juanma Barranquero <lekktu@gmail.com>
19850
19851 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
19852 (Fx_window_property): #if-0 the whole functions, not just the bodies.
19853
e810457d
PE
198542011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19855
19856 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
19857
ea51cceb
JB
198582011-04-27 Juanma Barranquero <lekktu@gmail.com>
19859
19860 * makefile.w32-in: Update dependencies.
19861
94dcfacf
EZ
198622011-04-27 Eli Zaretskii <eliz@gnu.org>
19863
19864 Improve `doprnt' and its usage. (Bug#8545)
19865 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
19866 `format_end'. Remove support for %l as a conversion specifier.
19867 Don't use xrealloc. Improve diagnostics when the %l size modifier
19868 is used. Update the commentary.
19869
19870 * eval.c (verror): Simplify calculation of size_t.
19871
19872 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
19873 messages.
19874
f61f41d7
PE
198752011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
19876
19877 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
19878 change.
19879
96fb4434
PE
198802011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19881
19882 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
19883 This makes this file independent of the recent pseudovector change.
19884
671875da 198852011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 19886
69e9b5a3
PE
19887 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
19888
b5f869a7 19889 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 19890 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 19891 Remove unused local.
c8926152 19892 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 19893
841a1577 19894 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
19895 GCC 4.6.0 optimizes based on type-based alias analysis.
19896 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
19897 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
19898 != &v->size, and therefore "v->size = 1; b->size = 2; return
19899 v->size;" must therefore return 1. This assumption is incorrect
19900 for Emacs, since it type-puns struct Lisp_Vector * with many other
19901 types. To fix this problem, this patch adds a new type struct
f904488f 19902 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
19903 and pseudovectors, and helps optimizing compilers not get fooled
19904 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
19905 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
19906 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
19907 the size member.
eab3844f
PE
19908 (XSETPVECTYPE): Rewrite in terms of new macro.
19909 (XSETPVECTYPESIZE): New macro, specifying both type and size.
19910 This is a bit clearer, and further avoids the possibility of
19911 undesirable aliasing.
19912 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 19913 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
19914 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
19915 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
19916 (ASIZE): Now uses header.size rather than size.
19917 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
19918 to avoid the hassle of writing XVECTOR (foo)->header.size.
19919 (struct vectorlike_header): New type.
eab3844f
PE
19920 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
19921 object, to help avoid aliasing.
19922 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
19923 (SUBRP): Likewise, since Lisp_Subr is a special case.
19924 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
19925 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
19926 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 19927 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
19928 changed to be "header.size" and "header.next".
19929 * buffer.h (struct buffer): Likewise.
19930 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
19931 * frame.h (struct frame): Likewise.
19932 * process.h (struct Lisp_Process): Likewise.
19933 * termhooks.h (struct terminal): Likewise.
19934 * window.c (struct save_window_data, struct saved_window): Likewise.
19935 * window.h (struct window): Likewise.
19936 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
19937 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
19938 * buffer.c (init_buffer_once): Likewise.
19939 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
19940 special case.
19941 * process.c (Fformat_network_address): Use local var for size,
19942 for brevity.
19943
0df1eac5
PE
19944 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
19945
847ab9d1 19946 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
19947 * data.c (atof): Remove decl; no longer used or needed.
19948 (digit_to_number): Move to lread.c.
19949 (Fstring_to_number): Use new string_to_number function, to be
19950 consistent with how the Lisp reader treats infinities and NaNs.
19951 Do not assume that floating-point numbers represent EMACS_INT
19952 without losing information; this is not true on most 64-bit hosts.
19953 Avoid double-rounding errors, by insisting on integers when
19954 parsing non-base-10 numbers, as the documentation specifies.
19955 * lisp.h (string_to_number): New decl, replacing ...
19956 (isfloat_string): Remove.
bc0a5c13 19957 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 19958 (read1): Do not accept +. and -. as integers; this
452f4150
PE
19959 appears to have been a coding error. Similarly, do not accept
19960 strings like +-1e0 as floating point numbers. Do not report
19961 overflow for integer overflows unless the base is not 10 which
19962 means we have no simple and reliable way to continue.
19963 Break out the floating-point parsing into a new
19964 function string_to_number, so that Fstring_to_number parses
19965 floating point numbers consistently with the Lisp reader.
04f2d78b 19966 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
19967 (E_CHAR, EXP_INT): Remove, replacing with ...
19968 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
19969 (string_to_number): New function, replacing isfloat_string.
19970 This function checks for valid syntax and produces the resulting
19971 Lisp float number too. Rework it so that string-to-number
bc0a5c13 19972 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
19973 so that overflow for non-base-10 numbers is reported only when
19974 there's no portable and simple way to convert to floating point.
452f4150 19975
67769ffc
PE
19976 * textprop.c (set_text_properties_1): Rewrite for clarity,
19977 and to avoid GCC warning about integer overflow.
19978
c20db43f
PE
19979 * intervals.h (struct interval): Use EMACS_INT for members
19980 where EMACS_UINT might cause problems. See
19981 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
19982 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
19983 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
19984 All uses changed.
37aa2f85
PE
19985 (offset_intervals): Tell GCC not to worry about length overflow
19986 when negating a negative length.
c20db43f 19987
2538aa2f
PE
19988 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
19989 (overrun_check_free): Likewise.
19990
f2d3008d
PE
19991 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
19992 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
19993 word size.
19994
ec8df744
PE
19995 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19996 (gnutls_make_error): Rename local to avoid shadowing.
19997 (gnutls_emacs_global_deinit): ifdef out; not used.
19998 (Fgnutls_boot): Use const for pointer to readonly storage.
19999 Comment out unused local. Fix pointer signedness problems.
20000
640ee02d
PE
20001 * lread.c (openp): Don't stuff size_t into an 'int'.
20002 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20003 about possible signed overflow.
20004
6048fb2a
PE
20005 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20006 (GDK_KEY_g): Don't define if already defined.
20007 (xg_prepare_tooltip): Avoid pointer signedness problem.
20008 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20009
fa3c87e1
PE
20010 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20011 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20012
2172544b
PE
20013 * xfns.c (Fx_window_property): Simplify a bit,
20014 to make a bit faster and to avoid GCC 4.6.0 warning.
20015 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20016
9b821a21
PE
20017 * fns.c (internal_equal): Don't assume size_t fits in int.
20018
3c616cfa
PE
20019 * alloc.c (compact_small_strings): Tighten assertion a little.
20020
c2982e87
PE
20021 Replace pEd with more-general pI, and fix some printf arg casts.
20022 * lisp.h (pI): New macro, generalizing old pEd macro to other
20023 conversion specifiers. For example, use "...%"pI"d..." rather
20024 than "...%"pEd"...".
20025 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 20026 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
20027 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20028 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20029 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20030 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20031 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20032 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20033 64-bit hosts.
20034 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20035 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20036 * print.c (safe_debug_print, print_object): Likewise.
20037 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20038 to int.
6f04d126
PE
20039 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20040 avoiding the 0 flag, which is not portable.
c2982e87
PE
20041 * process.c (Fmake_network_process): Use pI to avoid cast.
20042 * region-cache.c (pp_cache): Likewise.
20043 * xdisp.c (decode_mode_spec): Likewise.
20044 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20045 behavior on 64-bit hosts with printf arg.
6f04d126 20046 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
20047 (x_stop_queuing_selection_requests): Likewise.
20048 (x_get_window_property): Don't truncate byte count to an 'int'
20049 when tracing.
0b432f21 20050
5e073ec7
PE
20051 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20052 here, since it parses constructs like leading '-' and spaces,
20053 which are not wanted; and it overflows with large numbers.
20054 Instead, simply match F[0-9]+, which is what is wanted anyway.
20055
36372bf9
PE
20056 * alloc.c: Remove unportable assumptions about struct layout.
20057 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20058 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20059 (allocate_vectorlike, make_pure_vector): Use the new macros,
20060 plus offsetof, to remove unportable assumptions about struct layout.
20061 These assumptions hold on all porting targets that I know of, but
20062 they are not guaranteed, they're easy to remove, and removing them
20063 makes further changes easier.
20064
0b432f21
PE
20065 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20066 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
20067 (string_overrun_cookie): Now const. Use initializers that
20068 don't formally overflow signed char, to avoid warnings.
000098c1
PE
20069 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20070 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
20071 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20072 multiple of sizeof (EMACS_INT); it need not be, if
20073 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 20074 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 20075
895009e1
JB
200762011-04-26 Juanma Barranquero <lekktu@gmail.com>
20077
20078 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20079
6a7a1b0b
TZ
200802011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20081
20082 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 20083 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
20084 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20085
841a1577 200862011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
20087
20088 * lisp.h (Qdebug): List symbol.
895009e1 20089 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
20090 * keyboard.c (debug-on-event): New variable.
20091 (handle_user_signal): Break into debugger when debug-on-event
20092 matches the current signal symbol.
20093
f2d3ba6f
DN
200942011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20095
20096 * alloc.c (check_sblock, check_string_bytes)
20097 (check_string_free_list): Convert to standard C.
20098
42ce4c63
TZ
200992011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20100
20101 * w32.c (emacs_gnutls_push): Fix typo.
20102
825cd63c
EZ
201032011-04-25 Eli Zaretskii <eliz@gnu.org>
20104
fb11d64d
EZ
20105 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20106 "cast to pointer from integer of different size".
20107
825cd63c
EZ
20108 Improve doprnt and its use in verror. (Bug#8545)
20109 * doprnt.c (doprnt): Document the set of format control sequences
20110 supported by the function. Use SAFE_ALLOCA instead of always
20111 using `alloca'.
20112
20113 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20114 is one byte too soon. Don't use xrealloc; instead xfree and
20115 xmalloc anew.
20116
e061a11b
TZ
201172011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20118
20119 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20120 callbacks stage.
20121
20122 * gnutls.c: Renamed global_initialized to
20123 gnutls_global_initialized. Added internals for the
20124 :verify-hostname-error, :verify-error, and :verify-flags
20125 parameters of `gnutls-boot' and documented those parameters in the
20126 docstring. Start callback support.
9173deec
JB
20127 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20128 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20129 on error. Return error code.
e061a11b
TZ
20130 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20131 (emacs_gnutls_read): Likewise.
20132 (Fgnutls_boot): Return handshake error code.
20133 (emacs_gnutls_handle_error): New function.
20134 (wsaerror_to_errno): Likewise.
20135
20136 * w32.h (emacs_gnutls_pull): Add prototype.
20137 (emacs_gnutls_push): Likewise.
20138
20139 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20140 (emacs_gnutls_push): Likewise.
20141
201422011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20143
20144 * process.c (wait_reading_process_output): Check if GnuTLS
20145 buffered some data internally if no FDs are set for TLS
20146 connections.
20147
20148 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20149 (LIBS): Link to USER_LIBS.
20150 ($(BLD)/gnutls.$(0)): New target.
20151
fa6996bc
EZ
201522011-04-24 Eli Zaretskii <eliz@gnu.org>
20153
eb35682e
EZ
20154 * xdisp.c (handle_single_display_spec): Rename the
20155 display_replaced_before_p argument into display_replaced_p, to
20156 make it consistent with the commentary. Fix typos in the
20157 commentary.
20158
e2ad650c
EZ
20159 * textprop.c (syms_of_textprop): Remove dead code.
20160 (copy_text_properties): Delete obsolete commentary about an
20161 interface that was deleted long ago. Fix typos in the description
20162 of arguments.
20163
1b2de274
EZ
20164 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20165 to changes in oldXMenu/XMenu.h from 2011-04-16.
20166 <menu_help_message, prev_menu_help_message>: Constify.
20167 (IT_menu_make_room): menu->help_text is now `const char **';
20168 adjust.
20169
20170 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20171 to changes in oldXMenu/XMenu.h from 2011-04-16.
20172 (struct XMenu): Declare `help_text' `const char **'.
20173
20174 * xfaces.c <Qunspecified>: Make extern again.
20175
20176 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 20177 required by POSIX.
1b2de274 20178
762b15be
EZ
20179 * doc.c (get_doc_string): Improve the format passed to `error'.
20180
20181 * doprnt.c (doprnt): Improve commentary.
20182
20183 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20184
20185 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20186 them with etags.
20187
f1052e5d
EZ
20188 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20189 changes in globals.h immediately force recompilation.
762b15be
EZ
20190 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20191 $(CURDIR)/s/ms-w32.h.
20192 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 20193
fa6996bc
EZ
20194 * character.c (Fchar_direction): Function deleted.
20195 (syms_of_character): Don't defsubr it.
20196 <char-direction-table>: Deleted.
20197
e6c3da20
EZ
201982011-04-23 Eli Zaretskii <eliz@gnu.org>
20199
20200 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20201 * doprnt.c: Include limits.h.
20202 (SIZE_MAX): New macro.
04f2d78b
CB
20203 (doprnt): Return a size_t value. 2nd arg is now size_t.
20204 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
20205 Improve overflow protection. Support `l' modifier for integer
20206 conversions. Support %l conversion. Don't assume an EMACS_INT
20207 argument for integer conversions and for %c.
20208
20209 * lisp.h (doprnt): Restore prototype.
20210
20211 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20212 $(SRC)/character.h.
20213
20214 * Makefile.in (base_obj): Add back doprnt.o.
20215
20216 * deps.mk (doprnt.o): Add back prerequisites.
20217 (callint.o): Depend on character.h.
20218
20219 * eval.c (internal_lisp_condition_case): Include the handler
20220 representation in the error message.
20221 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20222 when breaking from the loop.
20223
20224 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20225
20226 * callint.c (Fcall_interactively): When displaying error message
20227 about invalid control letter, pass the character's codepoint, not
20228 a pointer to its multibyte form. Improve display of the character
20229 in octal and display also its hex code.
20230
20231 * character.c (char_string): Use %x to display the (unsigned)
20232 codepoint of an invalid character, to avoid displaying a bogus
20233 negative value.
20234
20235 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20236 `error', not SYMBOL_NAME itself.
20237
20238 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20239 character arguments to `error'.
20240
20241 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20242 to `error' in error message about FINAL_CHAR argument. Make sure
20243 FINAL_CHAR is a character, and use %c when it is passed as
20244 argument to `error'.
20245
4ffd0d6b 202462011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
20247
20248 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20249
20250 * w32.c: Include <time.h>.
20251 (sys_localtime): New function.
20252
4ffd0d6b 202532011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
20254
20255 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20256
4ffd0d6b 20257 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 20258
4ffd0d6b 202592011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 20260
4ffd0d6b
GM
20261 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20262 zombies (Bug#8467).
aac0c6e3 20263
04c56954
EZ
202642011-04-19 Eli Zaretskii <eliz@gnu.org>
20265
20266 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20267 gl_state.e_property when gl_state.object is Qt.
20268
20269 * insdel.c (make_gap_larger): Remove limitation of buffer size
20270 to <= INT_MAX.
20271
16a43933
CY
202722011-04-18 Chong Yidong <cyd@stupidchicken.com>
20273
20274 * xdisp.c (lookup_glyphless_char_display)
20275 (produce_glyphless_glyph): Handle cons cell entry in
20276 glyphless-char-display.
20277 (Vglyphless_char_display): Document it.
20278
20279 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20280 glyphless-char-display.
20281
4581706e
CY
202822011-04-17 Chong Yidong <cyd@stupidchicken.com>
20283
20284 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20285
20286 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20287
20288 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20289 definition for no-X builds.
20290
4887c6e2 202912011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 20292
fd35b6f9
PE
20293 Static checks with GCC 4.6.0 and non-default toolkits.
20294
5c1ccb01
PE
20295 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20296
006c5daa
PE
20297 * process.c (keyboard_bit_set): Define only if SIGIO.
20298 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20299 (send_process): Repair possible setjmp clobbering.
20300
efc736d3
PE
20301 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20302
4e2fe2e6
PE
20303 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20304
f97334a2
PE
20305 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20306
4e75f29d
PE
20307 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20308 Define only if needed.
20309
90efadd1
PE
20310 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20311 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 20312 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 20313
3c647824
PE
20314 * dispextern.h (struct redisplay_interface): Rename param
20315 to avoid shadowing.
e264f262 20316 * termhooks.h (struct terminal): Likewise.
761383f4 20317 * xterm.c (xembed_send_message): Likewise.
3c647824 20318
b58c5c4a
PE
20319 * insdel.c (make_gap_smaller): Define only if
20320 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20321
cad59032
PE
20322 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20323 it.
20324
c339dc2e
PE
20325 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20326 so that we aren't warned about unused symbols.
20327
91a3e27b
PE
20328 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20329
399c71d3 20330 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 20331
8ffc96f5
PE
20332 * xfns.c (x_real_positions): Mark locals as initialized.
20333
eef9bc79
PE
20334 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20335
098db9dd
PE
20336 * xterm.c: Fix problems found by static analysis with other toolkits.
20337 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
20338 (x_dispatch_event): Declare static if USE_GTK, and
20339 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 20340 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 20341 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
20342 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20343 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 20344
eb18f6cc
PE
20345 * xmenu.c (menu_help_callback): Pointer type fixes.
20346 Use const pointers when pointing at readonly data. Avoid pointer
20347 signedness clashes.
20348 (FALSE): Remove unused macro.
20349 (update_frame_menubar): Remove unused decl.
20350
1fe72bf8
PE
20351 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20352
60d9e1db
PE
20353 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20354 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20355 (single_menu_item): Rename local to avoid shadowing.
20356
39261c26
PE
20357 * keyboard.c (make_lispy_event): Remove unused local var.
20358
018c5e19
PE
20359 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20360 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20361
63d2b86e
PE
20362 * bitmaps: Change bitmaps from unsigned char back to the X11
20363 compatible char. Avoid the old compiler warnings about
20364 out-of-range initializers by using, for example, '\xab' rather
20365 than 0xab.
20366
aefd87e1
PE
20367 * xgselect.c (xgselect_initialize): Check vs interface
20368 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20369
bf501fb9
PE
20370 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20371
e9829fdf
PE
20372 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20373 to read-only memory.
20374
1086c095
PE
20375 * fns.c (vector): Remove; this old hack is no longer needed.
20376
2baccd04 20377 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 20378 Remove unused var.
dde42981 20379 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 20380
72391843 20381 * xrdb.c (x_load_resources): Omit unused local.
3565b346 20382
436c16df 20383 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 20384 (x_window): Rename locals to avoid shadowing.
dc5ddd85 20385 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 20386
92bb796d 20387 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 20388 (x_term_init): Remove local to avoid shadowing.
92bb796d 20389
764430a3 20390 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
20391
20392 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20393 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20394
d1dfb56c
EZ
203952011-04-16 Eli Zaretskii <eliz@gnu.org>
20396
c4354cb4
EZ
20397 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20398
d1dfb56c
EZ
20399 Fix regex.c, syntax.c and friends for buffers > 2GB.
20400 * syntax.h (struct gl_state_s): Declare character position members
20401 EMACS_INT.
20402
20403 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20404
04f2d78b
CB
20405 * textprop.c (verify_interval_modification, interval_of):
20406 Declare arguments EMACS_INT.
d1dfb56c
EZ
20407
20408 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20409 EMACS_INT.
20410
20411 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20412
20413 * indent.c (Fvertical_motion): Local variable it_start is now
20414 EMACS_INT.
20415
20416 * regex.c (re_match, re_match_2, re_match_2_internal)
20417 (bcmp_translate, regcomp, regexec, print_double_string)
20418 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20419 (re_compile_pattern, re_exec): Declare arguments and local
20420 variables `size_t' and `ssize_t' and return values `regoff_t', as
20421 appropriate.
20422 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20423 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20424 <compile_stack_type>: `size' and `avail' are now `size_t'.
20425
20426 * regex.h <regoff_t>: Use ssize_t, not int.
20427 (re_search, re_search_2, re_match, re_match_2): Arguments that
20428 specify buffer/string position and length are now ssize_t and
20429 size_t. Return type is regoff_t.
20430
613052cd
BK
204312011-04-16 Ben Key <bkey76@gmail.com>
20432
20433 * nsfont.m: Fixed bugs in ns_get_family and
20434 ns_descriptor_to_entity that were caused by using free to
20435 deallocate memory blocks that were allocated by xmalloc (via
20436 xstrdup). This caused Emacs to crash when compiled with
20437 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20438 --enable-checking=xmallocoverrun). xfree is now used to
20439 deallocate these memory blocks.
20440
4170f62f 204412011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 20442
71b41406
PE
20443 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20444
9587a89d
PE
20445 emacs_write: Accept and return EMACS_INT for sizes.
20446 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20447 et seq.
20448 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20449 Accept and return EMACS_INT.
20450 (emacs_gnutls_write): Return the number of bytes written on
20451 partial writes.
20452 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
20453 (emacs_read, emacs_write): Remove check for negative size, as the
20454 Emacs source code has been audited now.
9587a89d
PE
20455 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20456 (emacs_read, emacs_write): Use it.
273a5f82
PE
20457 * process.c (send_process): Adjust to the new signatures of
20458 emacs_write and emacs_gnutls_write. Do not attempt to store
20459 a byte offset into an 'int'; it might overflow.
9587a89d 20460 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 20461
3e047f51
PE
20462 * sound.c: Don't assume sizes fit in 'int'.
20463 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 20464 Return EMACS_INT, not int.
3e047f51 20465 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
20466 Accept EMACS_INT, not int.
20467 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
20468 record read return values.
20469
cc39a9db
BK
204702011-04-15 Ben Key <bkey76@gmail.com>
20471
c9d0ec6d
JB
20472 * keyboard.c (Qundefined): Don't declare static since it is used
20473 in nsfns.m.
20474 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20475 static since they are used in nsfont.m.
cc39a9db 20476
6c60eb9f
SM
204772011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20478
20479 * process.c (Qprocessp): Don't declare static.
20480 * lisp.h (Qprocessp): Declare again.
20481
7990b61a
JB
204822011-04-15 Juanma Barranquero <lekktu@gmail.com>
20483
20484 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20485
5d4cb038
PE
204862011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20487
8bd7b830 20488 Improve C-level modularity by making more things 'static'.
cd64ea1d 20489
e3b27b31
PE
20490 Don't publish debugger-only interfaces to other modules.
20491 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20492 (verify_bytepos, count_markers): Move decls to the only modules
20493 that need them.
20494 * region-cache.h (pp_cache): Likewise.
20495 * window.h (check_all_windows): Likewise.
20496 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20497
5d4cb038
PE
20498 * sysdep.c (croak): Now static, if
20499 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20500 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
20501
20502 * alloc.c (refill_memory_reserve): Now static if
20503 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20504 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 20505
e87b6180
PE
20506 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20507 Define only if USE_LUCID.
20508
ac64929e
PE
20509 * xrdb.c (x_customization_string, x_rm_string): Now static.
20510
6f37259d
PE
20511 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20512 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20513
1683e3ab
PE
20514 * xdisp.c (draw_row_with_mouse_face): Now static.
20515 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20516
de9c2632
PE
20517 * window.h (check_all_windows): Mark externally visible.
20518
2b96acb7
PE
20519 * window.c (window_deletion_count): Now static.
20520
20521 * undo.c: Make symbols static if they're not exported.
20522 (last_undo_buffer, last_boundary_position, pending_boundary):
20523 Now static.
20524
50436f33
PE
20525 * textprop.c (interval_insert_behind_hooks): Now static.
20526 (interval_insert_in_front_hooks): Likewise.
20527
64520e5c
PE
20528 * term.c: Make symbols static if they're not exported.
20529 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20530 (max_frame_lines, tty_set_terminal_modes):
20531 (tty_reset_terminal_modes, tty_turn_off_highlight):
20532 (get_tty_terminal): Now static.
20533 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20534 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 20535 HAVE_WINDOW_SYSTEM.
64520e5c
PE
20536 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20537 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20538
1fa53021
PE
20539 * sysdep.c: Make symbols static if they're not exported.
20540 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20541 Now static.
20542 (sigprocmask_set, full_mask): Remove; unused.
20543 (wait_debugging): Mark as visible.
20544 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20545 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20546
d4b43b22
PE
20547 * syntax.c (syntax_temp): Define only if !__GNUC__.
20548
b7c513d0
PE
20549 * sound.c (current_sound_device, current_sound): Now static.
20550
989b29ad
PE
20551 * search.c (searchbufs, searchbuf_head): Now static.
20552
13a55a78
PE
20553 * scroll.c (scroll_cost): Remove; unused.
20554 * dispextern.h (scroll_cost): Remove decl.
20555
de68a1fc
PE
20556 * region-cache.h (pp_cache): Mark as externally visible.
20557
40ccffa6
PE
20558 * process.c: Make symbols static if they're not exported.
20559 (process_tick, update_tick, create_process, chan_process):
20560 (Vprocess_alist, proc_buffered_char, datagram_access):
20561 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20562 (deactivate_process): Mark defn as static, as well as decl.
20563 * lisp.h (create_process): Remove decl.
20564 * process.h (chan_process, Vprocess_alist): Remove decls.
20565
ad64fc97
PE
20566 * print.c: Make symbols static if they're not exported.
20567 (print_depth, new_backquote_output, being_printed, print_buffer):
20568 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20569 (print_interval, print_number_index, initial_stderr_stream):
20570 Now static.
20571 * lisp.h (Fprinc): Remove decl.
20572 (debug_output_compilation_hack): Mark as externally visible.
20573
adddb265
PE
20574 * sysdep.c (croak): Move decl from here to syssignal.h.
20575 * syssignal.h (croak): Put it here, so the API can be checked when
20576 'croak' is called from dissociate_if_controlling_tty.
20577
1717ede2
PE
20578 * minibuf.c: Make symbols static if they're not exported.
20579 (minibuf_save_list, choose_minibuf_frame): Now static.
20580 * lisp.h (choose_minibuf_frame): Remove decl.
20581
fa5fb2bc
PE
20582 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20583
1e3890d1
PE
20584 * lread.c: Make symbols static if they're not exported.
20585 (read_objects, initial_obarray, oblookup_last_bucket_number):
20586 Now static.
20587 (make_symbol): Remove; unused.
20588 * lisp.h (initial_obarray, make_symbol): Remove decls.
20589
8a1414fa
PE
20590 * keyboard.c: Make symbols static if they're not exported.
20591 (single_kboard, recent_keys_index, total_keys, recent_keys):
20592 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20593 (this_single_command_key_start, echoing, last_auto_save):
20594 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20595 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20596 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20597 (Vlispy_mouse_stem, double_click_count):
20598 Now static.
20599 (force_auto_save_soon): Define only if SIGDANGER.
20600 (ignore_mouse_drag_p): Now static if
20601 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20602 (print_help): Remove; unused.
20603 (stop_character, last_timer_event): Mark as externally visible.
20604 * keyboard.h (ignore_mouse_drag_p): Declare only if
20605 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20606 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20607 * lisp.h (echoing): Remove decl.
20608 (force_auto_save_soon): Declare only if SIGDANGER.
20609 * xdisp.c (redisplay_window): Simplify code, to make it more
20610 obvious that ignore_mouse_drag_p is not accessed if !defined
20611 USE_GTK && !defined HAVE_NS.
20612
93ea6e8f
PE
20613 * intervals.c: Make symbols static if they're not exported.
20614 (merge_properties_sticky, merge_interval_right, delete_interval):
20615 Now static.
20616 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20617
77382fcc
PE
20618 * insdel.c: Make symbols static if they're not exported.
20619 However, leave prepare_to_modify_buffer alone. It's never
20620 called from outside this function, but that appears to be a bug.
20621 (combine_after_change_list, combine_after_change_buffer):
4889fc82 20622 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
20623 (adjust_after_replace_noundo): Remove; unused.
20624 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 20625 (signal_before_change): Remove decls.
77382fcc 20626
9306c32e
PE
20627 * indent.c (val_compute_motion, val_vmotion): Now static.
20628
cd44d2eb
PE
20629 * image.c: Make symbols static if they're not exported.
20630 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20631 if USE_GTK.
20632 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20633 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20634
ad9a7a06
PE
20635 * fringe.c (standard_bitmaps): Now static.
20636 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20637
81626931
PE
20638 * frame.c: Make symbols static if they're not exported.
20639 (x_report_frame_params, make_terminal_frame): Now static.
20640 (get_frame_param): Now static, unless HAVE_NS.
20641 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20642 (x_get_resource_string): Remove; not used.
20643 * frame.h (make_terminal_frame, x_report_frame_params):
20644 (x_get_resource_string); Remove decls.
20645 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20646 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20647
239f9db9
PE
20648 * font.c, fontset.c: Make symbols static if they're not exported.
20649 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20650 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20651 * font.c (font_close_object): Now static.
20652 * font.h (font_close_object): Remove.
20653 * fontset.c (FONTSET_OBJLIST): Remove.
20654 (free_realized_fontset) #if-0 the body, which does nothing.
20655 (face_suitable_for_char_p): #if-0, as it's never called.
20656 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
20657 * xfaces.c (face_at_string_position):
20658 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
20659 since 0 is always ASCII.
20660
dfcf3579
PE
20661 * fns.c (weak_hash_tables): Now static.
20662
5045092b
PE
20663 * fileio.c: Make symbols static if they're not exported.
20664 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20665 (Vwrite_region_annotation_buffers): Now static.
20666
57a96f5c
PE
20667 * eval.c: Make symbols static if they're not exported.
20668 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20669 * lisp.h (backtrace_list): Remove decl.
20670
35f08c38
PE
20671 * emacs.c: Make symbols static if they're not exported.
20672 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20673 (fatal_error_code, fatal_error_signal_hook, standard_args):
20674 Now static.
20675 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20676 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20677 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20678 * lisp.h (fatal_error_signal_hook): Remove decl.
20679 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20680
f44bd759
PE
20681 * editfns.c: Move a (normally-unused) function to its only use.
20682 * editfns.c, lisp.h (get_operating_system_release): Remove.
20683 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20684 worth the hassle of breaking this out.
20685
b532497d
PE
20686 * xterm.c: Make symbols static if they're not exported.
20687 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
20688 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
20689 (x_destroy_window, x_delete_display):
20690 Now static.
20691 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
20692 (x_mouse_leave): Remove; unused.
20693 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
20694 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
20695 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
20696 Remove decls.
20697 (x_mouse_leave): Declare only if WINDOWSNT.
20698 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
20699 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
20700 USE_X_TOOLKIT.
20701
1675728f
PE
20702 * ftxfont.c: Make symbols static if they're not exported.
20703 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
20704 HAVE_FREETYPE.
20705 * font.h (ftxfont_driver): Likewise.
20706
e4cebfca
PE
20707 * xfns.c: Make symbols static if they're not exported.
20708 (x_last_font_name, x_display_info_for_name):
20709 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
20710 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
20711 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
20712 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
20713 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
20714 (last_show_tip_args): Now static.
20715 (xic_defaut_fontset, xic_create_fontsetname): Define only if
20716 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
20717 (x_screen_planes): Remove; unused.
20718 * dispextern.h (x_screen_planes): Remove decl.
20719
5bf46f05
PE
20720 * dispnew.c: Make symbols static if they're not exported.
20721 * dispextern.h (redraw_garbaged_frames, scrolling):
20722 (increment_row_positions): Remove.
20723 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
20724 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
20725 Now static.
20726 (redraw_garbaged_frames): Remove; unused.
20727
435f4c28
PE
20728 * xfaces.c: Make symbols static if they're not exported.
20729 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
20730 Remove decls.
20731 * xterm.h (defined_color): Remove decls.
20732 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
20733 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
20734 (menu_face_changed_default, defined_color, free_realized_face):
20735 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
20736 (ascii_face_of_lisp_face): Remove; unused.
20737
8524aef3
PE
20738 * xdisp.c: Make symbols static if they're not exported.
20739 * dispextern.h (scratch_glyph_row, window_box_edges):
20740 (glyph_to_pixel_coords, set_cursor_from_row):
20741 (get_next_display_element, set_iterator_to_next):
20742 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
20743 (show_mouse_face): Remove decls
20744 * frame.h (message_buf_print): Likewise.
20745 * lisp.h (pop_message, set_message, check_point_in_composition):
20746 Likewise.
20747 * xterm.h (set_vertical_scroll_bar): Likewise.
20748 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
20749 (message_buf_print, scratch_glyph_row, displayed_buffer):
20750 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
20751 (get_next_display_element, show_mouse_face, window_box_edges):
20752 (frame_to_window_pixel_xy, check_point_in_composition):
20753 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
20754 (glyph_to_pixel_coords): Remove; unused.
20755
16390cd2
PE
20756 * dired.c (file_name_completion): Now static.
20757
20758 * dbusbind.c (xd_in_read_queued_messages): Now static.
20759
a25f4dfa
PE
20760 * lisp.h (circular_list_error, FOREACH): Remove; unused.
20761 * data.c (circular_list_error): Remove.
20762
14a9c8df
PE
20763 * commands.h (last_point_position, last_point_position_buffer):
20764 (last_point_position_window): Remove decls.
20765 * keyboard.c: Make these variables static.
20766
04f2d78b
CB
20767 * coding.h (coding, code_convert_region, encode_coding_gap):
20768 Remove decls.
74ab6df5
PE
20769 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
20770 (iso_code_class, detect_coding, code_convert_region): Now static.
20771 (encode_coding_gap): Remove; unused.
20772
38dfbee1
PE
20773 * chartab.c (chartab_chars, chartab_bits): Now static.
20774
a2cb4e63
PE
20775 * charset.h (charset_iso_8859_1): Remove decl.
20776 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20777 Now static.
20778
127198fd
PE
20779 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20780 * ccl.c (Vccl_program_table): Now static.
20781 (check_ccl_update): Remove; unused.
20782
d85b608f
PE
20783 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20784 * category.h: ... from here.
20785 * category.c (check_category_table, set_category_set): Now static.
20786
31cd66f3
PE
20787 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20788 * lisp.h: Remove these decls.
20789
c358e587
PE
20790 * buffer.c (buffer_count): Remove unused var.
20791
e78aecca
PE
20792 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20793 so that it's not optimized away.
20794 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20795 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20796 exported only to the debugger.
20797
e192d7d3 20798 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 20799 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 20800
92470028
PE
20801 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20802 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20803 was inaccessible from Lisp.
20804 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20805 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20806
244ed907
PE
20807 alloc.c: Import and export fewer symbols, and remove unused items.
20808 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20809 is defined.
20810 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20811 it's not optimized away by whole-program optimization.
20812 (message_enable_multibyte, free_misc): Remove.
20813 (catchlist, handlerlist, mark_backtrace):
20814 Declare only if BYTE_MARK_STACK.
20815 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20816 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20817 (message_enable_multibyte): Remove decl.
20818 (free_misc, interval_free_list, float_block, float_block_index):
20819 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20820 (cons_free_list, last_marked_index):
20821 Now static.
20822 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20823 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20824 (mark_backtrace): Define only if BYTE_MARK_STACK.
20825 * xdisp.c (message_enable_multibyte): Now static.
20826
61c2b50e 20827 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
20828 This makes it easier for human readers (and static analyzers)
20829 to see whether these variables are used from other modules.
20830 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
20831 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
20832 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
20833 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
20834 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
20835 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
20836 * xmenu.c, xselect.c:
20837 Declare Q* vars static if they are not used in other modules.
20838 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
20839 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
20840 Remove decls of unexported vars.
20841 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
20842
95c82688
PE
20843 * lisp.h (DEFINE_FUNC): Make sname 'static'.
20844
16a97296
PE
20845 Make Emacs functions such as Fatom 'static' by default.
20846 This makes it easier for human readers (and static analyzers)
20847 to see whether these functions can be called from other modules.
20848 DEFUN now defines a static function. To make the function external
20849 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
20850 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
20851 (Finit_image_library):
16a97296
PE
20852 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
20853 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
20854 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
20855 Remove decls, since these functions are now static.
20856 (Funintern, Fget_internal_run_time): New decls, since these functions
20857 were already external.
95c82688 20858
16a97296
PE
20859 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
20860 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
20861 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
20862 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
20863 * keyboard.c, keymap.c, lread.c:
20864 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
20865 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
20866 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
20867 Mark functions with DEFUE instead of DEFUN,
20868 if they are used in other modules.
20869 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
20870 decls for now-static functions.
20871 * buffer.h (Fdelete_overlay): Remove decl.
20872 * callproc.c (Fgetenv_internal): Mark as internal.
20873 * composite.c (Fremove_list_of_text_properties): Remove decl.
20874 (Fcomposition_get_gstring): New forward static decl.
20875 * composite.h (Fcomposite_get_gstring): Remove decl.
20876 * dired.c (Ffile_attributes): New forward static decl.
20877 * doc.c (Fdocumntation_property): New forward static decl.
20878 * eval.c (Ffetch_bytecode): New forward static decl.
20879 (Funintern): Remove extern decl; now in .h file where it belongs.
20880 * fileio.c (Fmake_symbolic_link): New forward static decl.
20881 * image.c (Finit_image_library): New forward static decl.
20882 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
20883 * intervals.h (Fprevious_property_change):
20884 (Fremove_list_of_text_properties): Remove decls.
20885 * keyboard.c (Fthis_command_keys): Remove decl.
20886 (Fcommand_execute): New forward static decl.
20887 * keymap.c (Flookup_key): New forward static decl.
20888 (Fcopy_keymap): Now static.
20889 * keymap.h (Flookup_key): Remove decl.
20890 * process.c (Fget_process): New forward static decl.
20891 (Fprocess_datagram_address): Mark as internal.
20892 * syntax.c (Fsyntax_table_p): New forward static decl.
20893 (skip_chars): Remove duplicate decl.
20894 * textprop.c (Fprevious_property_change): New forward static decl.
20895 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
20896 Now internal.
20897 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
20898 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
20899
785bbd42
PE
20900 * editfns.c (Fformat): Remove unreachable code.
20901
8b913b57
AS
209022011-04-14 Andreas Schwab <schwab@linux-m68k.org>
20903
20904 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
20905 change. (Bug#8496)
20906
a6744a35
EZ
209072011-04-13 Eli Zaretskii <eliz@gnu.org>
20908
20909 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
20910 when at ZV. (Bug#8487)
20911
e7974947
AS
209122011-04-12 Andreas Schwab <schwab@linux-m68k.org>
20913
baad03f0
AS
20914 * charset.c (Fclear_charset_maps): Use xfree instead of free.
20915 (Bug#8437)
20916 * keyboard.c (parse_tool_bar_item): Likewise.
20917 * sound.c (sound_cleanup, alsa_close): Likewise.
20918 * termcap.c (tgetent): Likewise.
20919 * xfns.c (x_default_font_parameter): Likewise.
20920 * xsettings.c (read_and_apply_settings): Likewise.
20921
e7974947
AS
20922 * alloc.c (overrun_check_malloc, overrun_check_realloc)
20923 (overrun_check_free): Protoize.
20924
28272684
PE
209252011-04-12 Paul Eggert <eggert@cs.ucla.edu>
20926
20927 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
20928 since callers should never pass a negative size.
20929 Change the signature to match that of plain 'read' and 'write'; see
20930 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
20931 * lisp.h: Update prototypes of emacs_write and emacs_read.
20932
11997c76
EZ
209332011-04-11 Eli Zaretskii <eliz@gnu.org>
20934
20935 * xdisp.c (redisplay_window): Don't try to determine the character
20936 position of the scroll margin if the window start point w->startp
e896f03c 20937 is outside the buffer's accessible region. (Bug#8468)
11997c76 20938
8a2cbd72
EZ
209392011-04-10 Eli Zaretskii <eliz@gnu.org>
20940
20941 Fix write-region and its subroutines for buffers > 2GB.
20942 * fileio.c (a_write, e_write): Modify declaration of arguments and
20943 local variables to support buffers larger than 2GB.
20944 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
20945
20946 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
20947 argument, local variables, and return value.
20948
20949 * lisp.h: Update prototypes of emacs_write and emacs_read.
20950
20951 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
20952
4073e537 209532011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 20954
1ebfdcb6
PE
20955 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
20956
b2ded58d
PE
20957 Fix more problems found by GCC 4.6.0's static checks.
20958
7d66342c
PE
20959 * xdisp.c (vmessage): Use a better test for character truncation.
20960
bbf47d44
PE
20961 * charset.c (load_charset_map): <, not <=, for optimization,
20962 and to avoid potential problems with integer overflow.
9248994d 20963 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 20964 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 20965 * editfns.c (Fformat): Likewise.
1e69125e 20966 * syntax.c (skip_chars): Likewise.
3befa583 20967
e3019616
PE
20968 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
20969 This also lets GCC 4.6.0 generate slightly better loop code.
20970
becfa255
PE
20971 * callint.c (Fcall_interactively): <, not <=, for optimization.
20972 (Fcall_interactively): Count the number of arguments produced,
20973 not the number of arguments given. This is simpler and lets GCC
20974 4.6.0 generate slightly better code.
20975
dae0cd48
PE
20976 * ftfont.c: Distingish more carefully between FcChar8 and char.
20977 The previous code passed unsigned char * to a functions like
20978 strlen and xstrcasecmp that expect char *, which does not
20979 conform to the C standard.
20980 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
20981 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
20982 char * when the C standard requires it.
20983
76032d70
PE
20984 * keyboard.c (read_char): Remove unused var.
20985
eb3f1cc8
PE
20986 * eval.c: Port to Windows vsnprintf (Bug#8435).
20987 Include <limits.h>.
20988 (SIZE_MAX): Define if the headers do not.
20989 (verror): Do not give up if vsnprintf returns a negative count.
20990 Instead, grow the buffer. This ports to Windows vsnprintf, which
20991 does not conform to C99. Problem reported by Eli Zaretskii.
20992 Also, simplify the allocation scheme, by avoiding the need for
20993 calling realloc, and removing the ALLOCATED variable.
20994
70476b54
PE
20995 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
20996
12020a9e
PE
20997 Remove invocations of doprnt, as Emacs now uses vsnprintf.
20998 But keep the doprint source code for now, as we might revamp it
20999 and use it again (Bug#8435).
ea6c7ae6
PE
21000 * lisp.h (doprnt): Remove.
21001 * Makefile.in (base_obj): Remove doprnt.o.
21002 * deps.mk (doprnt.o): Remove.
21003
5fdb398c
PE
21004 error: Print 32- and 64-bit integers portably (Bug#8435).
21005 Without this change, on typical 64-bit hosts error ("...%d...", N)
21006 was used to print both 32- and 64-bit integers N, which relied on
21007 undefined behavior.
61bdb816 21008 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
21009 * lisp.h (error, verror): Mark as printf-like functions.
21010 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21011 Report overflow in size calculations when allocating printf buffer.
21012 Do not truncate output string at its first null byte.
21013 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21014 Truncate the output at a character boundary, since vsnprintf does not
21015 do that.
21016 * charset.c (check_iso_charset_parameter): Convert internal
21017 character to string before calling 'error', since %c now has the
21018 printf meaning.
21019 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21020 overflow when computing char to be passed to 'error'. Do not
21021 pass Lisp_Object to 'error'; pass the integer instead.
21022 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21023 formatted with plain %d.
21024
b189fa66
PE
21025 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21026
bff87ef0
PE
21027 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21028
7e2cac20
PE
21029 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21030
ce4d90b5
PE
21031 * xterm.c (x_catch_errors): Remove duplicate declaration.
21032
266c9547
PE
21033 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21034
79c49ad2
PE
21035 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21036
368f4090
JM
210372011-04-10 Jim Meyering <meyering@redhat.com>
21038
21039 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21040 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21041 return ssize_t not "int", and use size_t as the buffer length.
21042 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21043 * gnutls.h: Update declarations.
21044 * process.c (read_process_output): Use ssize_t, to match.
21045 (send_process): Likewise.
21046
a32d4040
CY
210472011-04-09 Chong Yidong <cyd@stupidchicken.com>
21048
21049 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21050
8546720e 210512011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 21052
04f2d78b
CB
21053 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21054 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 21055
8546720e
GM
21056 * xterm.c (handle_one_xevent):
21057 * xmenu.c (create_and_show_popup_menu):
21058 * xselect.c (x_decline_selection_request)
21059 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 21060
0a2f5c1a 210612011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
21062
21063 Fix some uses of `int' instead of EMACS_INT.
21064 * search.c (string_match_1, fast_string_match)
21065 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21066 (scan_buffer, find_next_newline_no_quit)
21067 (find_before_next_newline, search_command, Freplace_match)
21068 (Fmatch_data): Make some `int' variables be EMACS_INT.
21069
21070 * xdisp.c (display_count_lines): 3rd argument and return value now
21071 EMACS_INT. All callers changed.
21072 (pint2hrstr): Last argument is now EMACS_INT.
21073
21074 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21075 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21076 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21077 (decode_coding_utf_16, decode_coding_emacs_mule)
21078 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21079 (decode_coding_ccl, decode_coding_charset)
21080 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21081 (decode_coding_iso_2022, decode_coding_emacs_mule)
21082 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21083 <char_offset, last_offset>: Declare EMACS_INT.
21084 (encode_coding_utf_8, encode_coding_utf_16)
21085 (encode_coding_emacs_mule, encode_invocation_designation)
21086 (encode_designation_at_bol, encode_coding_iso_2022)
21087 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21088 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21089 Declare EMACS_INT.
21090 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21091 (encode_invocation_designation): Last argument P_NCHARS is now
21092 EMACS_INT.
21093 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21094 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21095
21096 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21097 All users changed.
21098
21099 * ccl.c (Fccl_execute_on_string): Declare some variables
21100 EMACS_INT.
21101
8546720e 211022011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
21103
21104 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21105
4e19a977
CS
211062011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21107
21108 * process.c (Fformat_network_address): Doc fix.
21109
87302331
R
211102011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21111
ee7683eb 21112 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 21113
cbb59342
CY
211142011-04-08 Chong Yidong <cyd@stupidchicken.com>
21115
21116 * keyboard.c (read_char): Call Lisp function help-form-show,
21117 instead of using internal_with_output_to_temp_buffer.
21118 (Qhelp_form_show): New var.
e0d38eeb 21119 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
21120
21121 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21122
21123 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21124
e67a13ab
CY
211252011-04-06 Chong Yidong <cyd@stupidchicken.com>
21126
04f2d78b
CB
21127 * process.c (Flist_processes): Remove to Lisp.
21128 (list_processes_1): Delete.
e67a13ab 21129
973f782d
EZ
211302011-04-06 Eli Zaretskii <eliz@gnu.org>
21131
7c106b1e
EZ
21132 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21133
973f782d
EZ
21134 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21135
41cf7d1a 211362011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 21137
ca23cc88
PE
21138 Fix more problems found by GCC 4.6.0's static checks.
21139
f390e2d5
PE
21140 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21141
42eea0d0
PE
21142 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21143
b69769da 21144 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 21145
f9541e84
PE
21146 * xdisp.c (vmessage): Mark as a printf-like function.
21147
13841b55
PE
21148 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21149
c136c10f
PE
21150 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21151
5e2d4a30
PE
21152 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21153 printf-like functions.
21154 (tiff_load): Add casts to remove these marks before passing them
21155 to system-supplied API.
21156
583f48b9
PE
21157 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21158
b25d760e
PE
21159 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21160 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
21161 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21162 directly, rather than having caller test rule sign. This avoids
21163 some unnecessary tests.
21164 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21165 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21166 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 21167
bc7b6697 21168 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 21169 (xfont_open): Avoid unnecessary tests.
bc7b6697 21170
27ccc379
PE
21171 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21172
dcd5c89a
PE
21173 * composite.h, composite.c (composition_gstring_put_cache):
21174 Use EMACS_INT, not int, for length.
21175
b13a45c6
PE
21176 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21177 breaking out part of COMPOSITION_DECODE_RULE.
21178 (COMPOSITION_DECODE_RULE): Use it.
21179 * composite.c (get_composition_id): Remove unused local vars,
21180 by using the new macro.
21181
1e792e4d
PE
21182 * textprop.c (set_text_properties_1): Change while to do-while,
21183 since the condition is always true at first.
21184
dc6c6455 21185 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
21186 (interval_deletion_adjustment): Return unsigned value.
21187 All uses changed.
dc6c6455 21188
aba7731a
PE
21189 * process.c (list_processes_1, create_pty, read_process_output):
21190 (exec_sentinel): Remove vars that were set but not used.
afd4052b 21191 (create_pty): Remove unnecessary "volatile"s.
bc57d757 21192 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 21193 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 21194 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 21195
fdfc4bf3
PE
21196 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21197
fca8fe46 21198 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 21199 (update_syntax_table): Use unsigned instead of int.
fca8fe46 21200
06a0259a 21201 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 21202 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 21203 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 21204
e7b9e80f
PE
21205 * print.c (print_error_message): Avoid int overflow.
21206
56201685
PE
21207 * font.c (font_list_entities): Redo for clarity,
21208 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21209
78834453 21210 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 21211 (font_score): Avoid potential overflow in diff calculation.
78834453 21212
0bc0b309 21213 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 21214 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 21215
e610eaca
PE
21216 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21217
b895abce
PE
21218 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21219 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21220 can always succeed if overflow has undefined behavior.
21221
1f1d9321 21222 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 21223 (wordify): Omit three unnecessary tests.
1f1d9321 21224
c59478bc
PE
21225 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21226 All callers changed. This avoids the need for an unused var.
21227
79b73827
PE
21228 * casefiddle.c (casify_region): Remove var that is set but not used.
21229
a4db5dfe
PE
21230 * dired.c (file_name_completion): Remove var that is set but not used.
21231
43aae36e
PE
21232 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21233
2a47c44d 21234 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 21235 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 21236
a37c69bf
PE
21237 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21238 Check for integer overflow on size calculations.
21239
328ab8e7
PE
21240 * buffer.c (Fprevious_overlay_change): Remove var that is set
21241 but not used.
21242
e5a2a5cb
PE
21243 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21244 Remove vars that are set but not used.
8d84a6eb 21245 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 21246 (timer_check_2): Mark vars as initialized.
e5a2a5cb 21247
a60e5f68
PE
21248 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21249
f661cb61 21250 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 21251 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 21252
f0397f5a
PE
21253 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21254 that are set but not used.
21255
8664db06 21256 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 21257 if XCreateBitmapFromData fails (Bug#8410).
8664db06 21258
6abdaa4a
PE
21259 * xselect.c (x_get_local_selection, x_handle_property_notify):
21260 Remove vars that are set but not used.
21261
0ce7538d 21262 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 21263 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 21264
9ae848fc
PE
21265 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21266 Remove var that is set but not used.
0b918413
PE
21267 (scroll_bar_windows_size): Now size_t, not int.
21268 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21269 Check for overflow.
9ae848fc 21270
a5a62657
PE
21271 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21272 (map_tty_color) [!defined MSDOS]: Likewise.
21273
5c5cdd39
PE
21274 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21275
66ebf983
PE
21276 * coding.c: Remove vars that are set but not used.
21277 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21278 All callers changed.
21279 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21280 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21281 (decode_coding_charset): Remove vars that are set but not used.
21282
1be4d761
PE
21283 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21284 that is set but not used.
21285
47553fa8
PE
21286 * print.c (print_object): Remove var that is set but not used.
21287
1f7196bf 21288 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
21289 The gnulib version avoids calling malloc in the usual case,
21290 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21291 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21292 * filelock.c (current_lock_owner): Likewise.
21293 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21294 * sysdep.c: Include allocator.h, careadlinkat.h.
21295 (emacs_no_realloc_allocator): New static constant.
21296 (emacs_readlink): New function.
fdb61804
PE
21297 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21298 ../lib/careadlinkat.h.
d1fdcab7 21299
f84c17c7
SM
213002011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21301
21302 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21303 first non-nil return value).
21304
ef3862ad
JD
213052011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21306
21307 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21308 if not defined (Bug#8403).
21309
376a7006
JB
213102011-04-02 Juanma Barranquero <lekktu@gmail.com>
21311
21312 * xdisp.c (display_count_lines): Remove parameter `start',
21313 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21314 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21315 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21316 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21317 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21318 and thereabouts. All callers changed.
21319 (get_per_char_metric): Remove parameter `f', unused since
21320 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21321
6ca3801d
JM
213222011-04-02 Jim Meyering <meyering@redhat.com>
21323
21324 do not dereference NULL upon failed strdup
21325 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21326 (ns_get_family): Likewise.
21327
d8e2b5ba
JB
213282011-04-02 Juanma Barranquero <lekktu@gmail.com>
21329
21330 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21331
8c74fcbd
JD
213322011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21333
21334 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21335 later (Bug#8403).
21336
7200d79c
SM
213372011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21338
03408648 21339 Add lexical binding.
7200d79c 21340
03408648
SM
21341 * window.c (Ftemp_output_buffer_show): New fun.
21342 (Fsave_window_excursion):
21343 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21344
21345 * lread.c (lisp_file_lexically_bound_p): New function.
21346 (Fload): Bind Qlexical_binding.
21347 (readevalloop): Remove `evalfun' arg.
21348 Bind Qinternal_interpreter_environment.
21349 (Feval_buffer): Bind Qlexical_binding.
21350 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21351 Mark as dynamic.
21352 (syms_of_lread): Declare `lexical-binding'.
21353
21354 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21355
21356 * keyboard.c (eval_dyn): New fun.
21357 (menu_item_eval_property): Use it.
ca105506
SM
21358
21359 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 21360
03408648
SM
21361 * fns.c (concat, mapcar1): Accept byte-code-functions.
21362
21363 * eval.c (Fsetq): Handle lexical vars.
21364 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21365 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21366 (FletX, Flet): Obey lexical binding.
21367 (Fcommandp): Handle closures.
21368 (Feval): New `lexical' arg.
21369 (eval_sub): New function extracted from Feval. Use it almost
21370 everywhere where Feval was used. Look up vars in lexical env.
21371 Handle closures.
21372 (Ffunctionp): Move from subr.el.
21373 (Ffuncall): Handle closures.
21374 (apply_lambda): Remove `eval_flags'.
21375 (funcall_lambda): Handle closures and new byte-code-functions.
21376 (Fspecial_variable_p): New function.
21377 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21378 but without exporting it to Lisp.
23aba0ea 21379
23aba0ea 21380 * doc.c (Fdocumentation, store_function_docstring):
03408648 21381 * data.c (Finteractive_form): Handle closures.
23aba0ea 21382
03408648
SM
21383 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21384 interactive spec.
ba83908c 21385
04f2d78b
CB
21386 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21387 New byte-codes.
03408648
SM
21388 (exec_byte_code): New function extracted from Fbyte_code to handle new
21389 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 21390
03408648 21391 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 21392
03408648 21393 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 21394
e2abce01
JB
213952011-03-31 Juanma Barranquero <lekktu@gmail.com>
21396
21397 * xdisp.c (redisplay_internal): Fix prototype.
21398
63696a73 213992011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 21400
63696a73 21401 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
21402 (try_scrolling): Use it when setting scroll_limit.
21403 Limit scrolling to 100 screen lines.
63696a73
EZ
21404 (redisplay_window): Even when falling back on "recentering",
21405 position point in the window according to scroll-conservatively,
21406 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21407
21408 (try_scrolling): When point is above the window, allow searching
21409 as far as scroll_max, or one screenful, to compute vertical
21410 distance from PT to the scroll margin position. This prevents
21411 try_scrolling from unnecessarily failing when
21412 scroll-conservatively is set to a value slightly larger than the
21413 window height. Clean up the case of PT below the margin at bottom
21414 of window: scroll_max can no longer be INT_MAX. When aggressive
21415 scrolling is in use, don't let point enter the opposite scroll
21416 margin as result of the scroll.
21417 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
21418 threshold of 100 lines for never-recentering scrolling.
21419
e4cc2dfc
JB
214202011-03-31 Juanma Barranquero <lekktu@gmail.com>
21421
21422 * dispextern.h (move_it_by_lines):
21423 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21424 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21425 (message_log_check_duplicate): Remove parameters `prev_bol' and
21426 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21427 (redisplay_internal): Remove parameter `preserve_echo_area',
21428 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21429
21430 * indent.c (Fvertical_motion):
21431 * window.c (window_scroll_pixel_based, Frecenter):
21432 Don't pass `need_y_p' to `move_it_by_lines'.
21433
1c470562
SM
214342011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21435
44f230aa
SM
21436 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21437 steal a few bits to be more compact.
21438 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21439 Remove unneeded casts.
21440
1c470562
SM
21441 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21442
888adce9
ZK
214432011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21444
21445 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21446 binding" message (bug#7967).
21447
f838ed7b
PE
214482011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21449
77861b95
PE
21450 Fix more problems found by GCC 4.6.0's static checks.
21451
de6dbc14
PE
21452 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21453 Remove unused local var.
21454
f838ed7b
PE
21455 * editfns.c (Fmessage_box): Remove unused local var.
21456
792c7b2b
PE
21457 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21458 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21459 Omit unused local vars.
c499e557 21460 * window.c (shrink_windows): Omit unused local var.
b01a1c29 21461 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
21462 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21463 Omit unused local var.
21464
ba0165e1
PE
21465 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21466 Don't assume string length fits in int.
32ad8845 21467 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 21468 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 21469
3c59b4c9
PE
21470 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21471 instead of alloca (Bug#8344).
21472
a3eed478 21473 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 21474 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 21475
eb4d412d
PE
21476 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21477
1658b401
PE
21478 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21479 concerns.
21480
21481 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21482
21483 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 21484
9a2c6e05
PE
21485 * keyboard.c (syms_of_keyboard): Use the same style as later
21486 in this function when indexing through an array. This also
21487 works around GCC bug 48267.
21488
03d0a109
PE
21489 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21490
44f730c8
PE
21491 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21492
fe75f926
PE
21493 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21494 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21495
ffa8c828
PE
21496 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21497 This avoids undefined behavior on integer overflow, and is a bit
21498 more convenient anyway since it is compared to a size_t variable.
21499
c5101a77
PE
21500 Variadic C functions now count arguments with size_t, not int.
21501 This avoids an unnecessary limitation on 64-bit machines, which
21502 caused (substring ...) to crash on large vectors (Bug#8344).
21503 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21504 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 21505 All variadic functions and their callers changed accordingly.
c5101a77
PE
21506 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21507 * data.c (arith_driver, float_arith_driver): Likewise.
21508 * editfns.c (general_insert_function): Likewise.
21509 * eval.c (struct backtrace.nargs, interactive_p)
21510 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21511 (funcall_lambda, mark_backtrace): Likewise.
21512 * fns.c (concat): Likewise.
21513 * frame.c (x_set_frame_parameters): Likewise.
21514 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21515 0 if not found, not -1. All callers changed.
21516
dd3f25f7
PE
21517 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21518 (stack_copy_size): Now size_t, not int.
21519 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21520
461c2ab9
JB
215212011-03-28 Juanma Barranquero <lekktu@gmail.com>
21522
21523 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21524 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21525 All callers changed.
21526
21527 * lisp.h (multibyte_char_to_unibyte):
21528 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21529 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21530 * character.h (CHAR_TO_BYTE8):
21531 * cmds.c (internal_self_insert):
21532 * editfns.c (general_insert_function):
21533 * keymap.c (push_key_description):
21534 * search.c (Freplace_match):
21535 * xdisp.c (message_dolog, set_message_1): All callers changed.
21536
f6d62986
SM
215372011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21538
21539 * keyboard.c (safe_run_hook_funcall): New function.
21540 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21541 don't set the hook to nil, but remove the offending function instead.
21542 (Qcommand_hook_internal): Remove, unused.
21543 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21544 Vcommand_hook_internal.
21545
21546 * eval.c (enum run_hooks_condition): Remove.
21547 (funcall_nil, funcall_not): New functions.
21548 (run_hook_with_args): Call each function through a `funcall' argument.
21549 Remove `cond' argument, now redundant.
21550 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21551 (Frun_hook_with_args_until_failure): Adjust accordingly.
21552 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21553
1db5b1ad
JB
215542011-03-28 Juanma Barranquero <lekktu@gmail.com>
21555
21556 * dispextern.h (string_buffer_position): Remove declaration.
21557
21558 * print.c (strout): Remove parameter `multibyte', unused since
21559 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21560
21561 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21562 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21563 All callers changed.
21564
21565 * w32.c (_wsa_errlist): Use braces for struct initializers.
21566
21567 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21568 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21569 All callers changed.
21570 (string_buffer_position): Likewise. Also, make static (it's never
21571 used outside xdisp.c).
21572 (cursor_row_p): Remove parameter `w', unused since
21573 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21574 (decode_mode_spec): Remove parameter `precision', introduced during
21575 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21576 All callers changed.
21577
5ffb62aa
JD
215782011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21579
21580 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21581
461c2ab9 215822011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
21583
21584 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21585 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21586 (ns_update_auto_hide_menu_bar): New functions.
21587 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21588 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21589 ns_constrain_all_frames.
21590 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21591 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21592
5c380ffb
JD
215932011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21594
21595 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21596
9af30bdf
GM
215972011-03-27 Glenn Morris <rgm@gnu.org>
21598
21599 * syssignal.h: Replace RETSIGTYPE with void.
21600 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21601 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21602 Replace SIGTYPE with void everywhere.
21603 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21604 * s/template.h (SIGTYPE): Remove commented out definition.
21605
e2abce01
JB
216062011-03-26 Eli Zaretskii <eliz@gnu.org>
21607
21608 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21609 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21610
f868cd8a
JB
216112011-03-26 Juanma Barranquero <lekktu@gmail.com>
21612
59eb0929
JB
21613 * w32.c (read_unc_volume): Use parameter `henum', instead of
21614 global variable `wget_enum_handle'.
21615
21616 * keymap.c (describe_vector): Remove parameters `indices' and
21617 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21618 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21619
f868cd8a
JB
21620 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21621
21622 * keyboard.c (timer_check): Remove parameter `do_it_now',
21623 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21624 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21625 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21626
21627 * keyboard.c (read_char):
21628 * w32menu.c (w32_menu_display_help):
21629 * xmenu.c (show_help_event, menu_help_callback):
21630 Adjust calls to `show_help_echo'.
21631
21632 * gtkutil.c (xg_maybe_add_timer):
21633 * keyboard.c (readable_events):
21634 * process.c (wait_reading_process_output):
21635 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21636
21637 * insdel.c (adjust_markers_gap_motion):
21638 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21639 (gap_left, gap_right): Don't call it.
21640
2ecf6fdb
CY
216412011-03-25 Chong Yidong <cyd@stupidchicken.com>
21642
21643 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21644 incurred during fontification.
21645
6b1f9ba4
JB
216462011-03-25 Juanma Barranquero <lekktu@gmail.com>
21647
21648 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21649 (DEFVAR_PER_BUFFER): Don't pass it.
21650
21651 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21652 (scrolling_window): Don't pass it.
21653
0f4a96b5
JB
216542011-03-25 Juanma Barranquero <lekktu@gmail.com>
21655
21656 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21657
21658 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21659 and `suffix'.
21660 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21661 of variables specific to SELinux and computation of `encoded_absname'.
21662
21663 * image.c (XPutPixel): Remove unused variable `height'.
21664
21665 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21666
21667 * unexw32.c (get_section_info): Remove unused variable `section'.
21668
21669 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21670 (system_process_attributes): Remove unused variable `sess'.
21671 (sys_read): Remove unused variable `err'.
21672
21673 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21674 (w32_wnd_proc): Remove unused variable `isdead'.
21675 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21676 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21677 (x_create_tip_frame): Remove unused variable `tem'.
21678
21679 * w32inevt.c (w32_console_read_socket):
21680 Remove unused variable `no_events'.
21681
21682 * w32term.c (x_draw_composite_glyph_string_foreground):
21683 Remove unused variable `width'.
21684
1149507c
JB
216852011-03-24 Juanma Barranquero <lekktu@gmail.com>
21686
21687 * w32term.c (x_set_glyph_string_clipping):
21688 Don't pass uninitialized region to CombineRgn.
21689
9c88f339
JB
216902011-03-23 Juanma Barranquero <lekktu@gmail.com>
21691
21692 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
21693 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
21694 (Fx_close_connection): Remove unused variable `i'.
21695
21696 * w32font.c (w32font_draw): Return number of glyphs.
21697 (w32font_open_internal): Remove unused variable `i'.
21698 (w32font_driver): Add missing initializer.
21699
21700 * w32menu.c (utf8to16): Remove unused variable `utf16'.
21701 (fill_in_menu): Remove unused variable `items_added'.
21702
21703 * w32term.c (last_mouse_press_frame): Remove static global variable.
21704 (w32_clip_to_row): Remove unused variable `f'.
21705 (x_delete_terminal): Remove unused variable `i'.
21706
21707 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
21708 (NOTHING): Remove unused static global variable.
21709 (uniscribe_check_otf): Remove unused variable `table'.
21710 (uniscribe_font_driver): Add missing initializers.
21711
dee091a3
JD
217122011-03-23 Julien Danjou <julien@danjou.info>
21713
21714 * term.c (Fsuspend_tty, Fresume_tty):
21715 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
21716 * window.c (temp_output_buffer_show):
21717 * insdel.c (signal_before_change):
21718 * frame.c (Fhandle_switch_frame):
21719 * fileio.c (Fdo_auto_save):
21720 * emacs.c (Fkill_emacs):
21721 * editfns.c (save_excursion_restore):
21722 * cmds.c (internal_self_insert):
21723 * callint.c (Fcall_interactively):
21724 * buffer.c (Fkill_all_local_variables):
21725 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
21726 Use Frun_hooks.
0f4a96b5 21727 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 21728 unconditionally since it does the check itself.
dee091a3 21729
2c520ab5 217302011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 21731
c9c49752
PE
21732 Fix more problems found by GCC 4.5.2's static checks.
21733
8abc3f12
PE
21734 * coding.c (encode_coding_raw_text): Avoid unnecessary test
21735 the first time through the loop, since we know p0 < p1 then.
21736 This also avoids a gcc -Wstrict-overflow warning.
21737
a2d26660
PE
21738 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
21739 leading to a memory leak, possible in functions like
21740 load_charset_map_from_file that can allocate an unbounded number
b12ef411 21741 of objects (Bug#8318).
a2d26660 21742
916c72e9
PE
21743 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
21744 that could (at least in theory) be that large.
21745
19ab8a18
PE
21746 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
21747 This is less likely to overflow, and avoids undefined behavior if
21748 overflow does occur. All callers changed. Use strtoul to scan
21749 for the unsigned long integer.
b7cbbd6f
PE
21750 (pint2hrstr): Simplify and tune code slightly.
21751 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 21752
f0641eff
PE
21753 * scroll.c (do_scrolling): Work around GCC bug 48228.
21754 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
21755
7f650bb9
PE
21756 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
21757 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
21758 (validate_x_resource_name): Simplify count usage.
21759 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 21760
37dd57d1
PE
21761 * fileio.c (Fcopy_file): Report error if fchown or fchmod
21762 fail (Bug#8306).
81e56e61 21763
699979fc 21764 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 21765
401bf9b4
PE
21766 * process.c (Fmake_network_process): Use socklen_t, not int,
21767 where POSIX says socklen_t is required in portable programs.
21768 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 21769 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
21770 (Fmake_network_process, server_accept_connection):
21771 (wait_reading_process_output, read_process_output):
21772 Likewise.
21773
b93aacde
PE
21774 * process.c: Rename or move locals to avoid shadowing.
21775 (list_processes_1, Fmake_network_process):
21776 (read_process_output_error_handler, exec_sentinel_error_handler):
21777 Rename or move locals.
4dc343ee 21778 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 21779 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 21780 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 21781 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 21782 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 21783
af8a867c 21784 Make tparam.h and terminfo.c consistent.
44f230aa
SM
21785 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21786 Include tparam.h instead, since it declares them.
af8a867c
PE
21787 * cm.h (PC): Remove extern decl; tparam.h now does this.
21788 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21789 * terminfo.c: Include tparam.h, to check interfaces.
21790 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21791 (tparam): Adjust signature to match interface in tparam.h;
21792 this removes some undefined behavior. Check that outstring and len
21793 are zero, which they always are with Emacs.
21794 * tparam.h (PC, BC, UP): New extern decls.
21795
0248044d 21796 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 21797 (xftfont_open): Rename locals to avoid shadowing.
0248044d 21798
8ff096c1 21799 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
21800 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21801 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 21802 (ftfont_list): Remove unused local.
49eaafba
PE
21803 (get_adstyle_property, ftfont_pattern_entity):
21804 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21805 Rename locals to avoid shadowing.
8ff096c1 21806
e2be39f6
PE
21807 * xfont.c (xfont_list_family): Mark var as initialized.
21808
c9735e30
PE
21809 * xml.c (make_dom): Now static.
21810
8f5201ae
PE
21811 * composite.c (composition_compute_stop_pos): Rename local to
21812 avoid shadowing.
b246f932
PE
21813 (composition_reseat_it): Remove unused locals.
21814 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 21815 (composition_update_it): Mark var as initialized.
11b61122
PE
21816 (find_automatic_composition): Mark vars as initialized,
21817 with a FIXME (Bug#8290).
8f5201ae 21818
760fbc2c
PE
21819 character.h: Rename locals to avoid shadowing.
21820 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21821 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21822 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21823 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21824 to avoid shadowing.
21825
ff08eb85
PE
21826 * textprop.c (property_change_between_p): Remove; unused.
21827
fc7bf025
PE
21828 * intervals.c (interval_start_pos): Now static.
21829
235d7abc
PE
21830 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
21831
44f230aa
SM
21832 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
21833 Rename locals to avoid shadowing.
3e7d6594 21834
50060332
PE
21835 * sound.c (wav_play, au_play, Fplay_sound_internal):
21836 Fix pointer signedness.
d01f234b 21837 (alsa_choose_format): Remove unused local var.
c83b8872
PE
21838 (wav_play): Initialize a variable to 0, to prevent undefined
21839 behavior (Bug#8278).
50060332 21840
c4fc4e30
PE
21841 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
21842
918436ed
PE
21843 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
21844
c939f91b
PE
21845 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
21846 clobbering (Bug#8298).
b9c7f648
PE
21847 * sysdep.c (sys_subshell): Likewise.
21848 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 21849
6bd8c144
PE
21850 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
21851 This should get cleaned up, so that child_setup has the
21852 same signature on all platforms.
21853
7710357c 21854 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 21855 (relocate_fd): Rename locals to avoid shadowing.
7710357c 21856
c59da222
CY
218572011-03-22 Chong Yidong <cyd@stupidchicken.com>
21858
21859 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
21860 not to be necessary, and produces flickering.
21861
66b87493
GM
218622011-03-20 Glenn Morris <rgm@gnu.org>
21863
21864 * config.in: Remove file.
21865
45b6f6d5
JB
218662011-03-20 Juanma Barranquero <lekktu@gmail.com>
21867
21868 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
21869 are now in src/globals.h.
21870 (syms_of_minibuf): Remove spurious & from previous change.
21871
cd394be1 218722011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
21873
21874 * minibuf.c (completing-read-function): New variable.
21875 (completing-read-default): Rename from completing-read.
21876 (completing-read): Call completing-read-function.
21877
b14e3e21
CY
218782011-03-19 Juanma Barranquero <lekktu@gmail.com>
21879
21880 * xfaces.c (Fx_load_color_file):
21881 Read color file from absolute filename (bug#8250).
21882
f2b726e6
JB
218832011-03-19 Juanma Barranquero <lekktu@gmail.com>
21884
21885 * makefile.w32-in: Update dependencies.
21886
09f6ff02
EZ
218872011-03-17 Eli Zaretskii <eliz@gnu.org>
21888
21889 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
21890
29a6015a
PE
218912011-03-17 Paul Eggert <eggert@cs.ucla.edu>
21892
a3a6c54e
PE
21893 Fix more problems found by GCC 4.5.2's static checks.
21894
b766f867
PE
21895 * process.c (make_serial_process_unwind, send_process_trap):
21896 (sigchld_handler): Now static.
21897
be02381c
PE
21898 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
21899 That way, the code declares only the vars that it needs.
21900 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
21901 * s/cygwin.h (PTY_ITERATION): Likewise.
21902 * s/darwin.h (PTY_ITERATION): Likewise.
21903 * s/gnu-linux.h (PTY_ITERATION): Likewise.
21904
57048744
PE
21905 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
21906 * process.c (allocate_pty): Don't declare stb unless it's needed.
21907
7914961c 21908 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
21909 (CONSTANTLIM): Remove; unused.
21910 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
21911 Define only if needed.
7914961c 21912
b3967b18
PE
21913 * unexelf.c (unexec): Name an expression,
21914 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
21915 Use a different way to cause a compilation error if anyone uses
21916 n rather than nn, a way that does not involve shadowing.
73366a00 21917 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 21918
29a6015a
PE
21919 * deps.mk (unexalpha.o): Remove; unused.
21920
43cfc33e 21921 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 21922 * unexec.h: New file.
ce701a33
PE
21923 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
21924 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
21925 Depend on unexec.h.
21926 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
21927 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
21928 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 21929 Change as necessary to match prototype in unexec.h.
ce701a33 21930
01f44d5a
PE
21931 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
21932 shadowing.
4f63c6bb 21933 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 21934
a6670b0b
PE
21935 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
21936 Rename locals to avoid shadowing.
21937
cef2010d 21938 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 21939 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 21940
d4d7173a
PE
21941 * print.c (Fredirect_debugging_output): Fix pointer signedess.
21942
f08b802a
PE
21943 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
21944 warning when compiling print.c.
21945
3ddb0639
PE
21946 * font.c (font_unparse_fcname): Abort in an "impossible" situation
21947 instead of using an uninitialized var.
5ad03b97 21948 (font_sort_entities): Mark var as initialized.
3ddb0639 21949
170a2692
PE
21950 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
21951
e663c700
PE
21952 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
21953 pointers to constants.
89bc529a 21954 (font_parse_fcname): Remove unused vars.
7b81e2d0 21955 (font_delete_unmatched): Now static.
ea838e10 21956 (font_get_spec): Remove; unused.
13a547c6
PE
21957 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
21958 (font_update_drivers, Ffont_get_glyphs, font_add_log):
21959 Rename or move locals to avoid shadowing.
e663c700 21960
2a80c887 21961 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 21962 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 21963
1384fa33 21964 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 21965 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 21966
8b2c52e9
PE
21967 * alloc.c (mark_backtrace): Move decl from here ...
21968 * lisp.h: ... to here, so that it can be checked.
21969
475545b5 21970 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 21971 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
21972 (lisp_indirect_variable): Name an expression,
21973 to avoid gcc -Wbad-function-cast warning.
1faed8ae 21974 (Fdefvar): Rename locals to avoid shadowing.
475545b5 21975
b1349114 21976 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 21977 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 21978 Use const pointer when appropriate.
b1349114 21979
a2928364
PE
21980 * lisp.h (get_system_name, get_operating_system_release):
21981 Move decls here, to check interfaces.
21982 * process.c (get_operating_system_release): Move decl to lisp.h.
21983 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
21984 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
21985 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
21986 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
21987 (Fformat_time_string, Fencode_time, Finsert_char):
21988 (Ftranslate_region_internal, Fformat):
21989 Rename or remove local vars to avoid shadowing.
9710023e 21990 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 21991
a415e694
PE
21992 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
21993 avoid shadowing.
21994
8ef4622d
PE
21995 * lisp.h (eassert): Check that the argument compiles, even if
21996 ENABLE_CHECKING is not defined.
21997
946f9a5b
PE
21998 * data.c (Findirect_variable): Name an expression, to avoid
21999 gcc -Wbad-function-cast warning.
112396d6 22000 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 22001 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
22002 (Fmake_variable_buffer_local, Fmake_local_variable):
22003 Mark variables as initialized.
52746918 22004 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 22005
e5aab7e7 22006 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
22007 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22008 Rename locals to avoid shadowing.
dff45157
PE
22009 (mark_stack): Move local variables into the #ifdef region where
22010 they're used.
7bc26fdb
PE
22011 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22012 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22013 needed otherwise.
22014 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22015 (GC_STRING_CHARS): Remove; not used.
d40d4be1 22016 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 22017
e5aab7e7
PE
22018 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22019 avoids undefined behavior in theory.
22020
4da60324
PE
22021 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22022
88043301
PE
22023 Use functions, not macros, for up- and down-casing (Bug#8254).
22024 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22025 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22026 to use the following functions instead of these macros.
22027 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22028 EMACS_INT, since callers assume the returned value fits in int.
22029 (upcase1): Likewise, for UPCASE_TABLE.
22030 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 22031 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 22032 the race-condition problem in the old DOWNCASE.
88043301 22033
19ed5445
PE
22034 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22035 Rename locals to avoid shadowing.
22036 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
22037 (regex_compile, re_search_2, re_match_2_internal):
22038 Remove unused local vars.
952db0d7
PE
22039 (FREE_VAR): Rewrite so as not to use empty "else",
22040 which gcc can warn about.
da053e48 22041 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
22042 (RETALLOC_IF): Define only if needed.
22043 (WORDCHAR_P): Likewise. This one is never needed, but is used
22044 only in a comment talking about a compiler bug, so put inside
22045 the #if 0 of that comment.
22046 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22047 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22048 Remove; unused.
19ed5445 22049
1f3561e4 22050 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
22051 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22052 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 22053
ded6f8f7
PE
22054 * search.c (simple_search): Remove unused var.
22055
dbd37a95
PE
22056 * dired.c (compile_pattern): Move decl from here ...
22057 * lisp.h: ... to here, so that it can be checked.
22058 (struct re_registers): New forward decl.
22059
7e47afad
PE
22060 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22061
85f24f61
PE
22062 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22063 All uses changed.
22064 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22065 Rename locals to avoid shadowing.
5671df8f 22066 (Fvertical_motion): Mark locals as initialized.
85f24f61 22067
181aa2be 22068 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 22069 (casify_region): Mark local as initialized.
181aa2be 22070
930d429c
PE
22071 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22072
7082eac6
PE
22073 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22074 New macros, so that the caller can use some names other than
22075 gcpro1, gcpro2, etc.
22076 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22077 of the new macros.
22078 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22079 argument, for consistency with GCPRO2_VAR, etc: it is now the
22080 prefix of the variable, not the variable itself. All uses
22081 changed.
38b2c076
PE
22082 * dired.c (directory_files_internal, file_name_completion):
22083 Rename locals to avoid shadowing.
22084
15206ed9
PE
22085 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22086 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22087 dired.c's scmp function, had undefined behavior.
22088 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22089 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22090 * buffer.h: ... to here, because these macros use current_buffer,
22091 and the new implementation with inline functions needs to have
22092 current_buffer in scope now, rather than later when the macros
22093 are used.
22094 (downcase, upcase1): New static inline functions.
22095 (DOWNCASE, UPCASE1): Reimplement using these functions.
22096 This avoids undefined behavior in expressions like
22097 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22098 from race conditions in accessing the global variables
22099 case_temp1 and case_temp2.
22100 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22101 * lisp.h (case_temp1, case_temp2): Remove their decls.
22102 * character.h (ASCII_CHAR_P): Move from here ...
22103 * lisp.h: ... to here, so that the inline functions mentioned
22104 above can use them.
22105
4a6bea26
PE
22106 * dired.c (directory_files_internal_unwind): Now static.
22107
f14b7e14
PE
22108 * fileio.c (file_name_as_directory, directory_file_name):
22109 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22110 Now static.
2893f146
PE
22111 (file_name_as_directory): Use const pointers when appropriate.
22112 (Fexpand_file_name): Likewise. In particular, newdir might
22113 point at constant storage, so make it a const pointer.
fd4ead52 22114 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
22115 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22116 signedness issues.
f839df0c
PE
22117 (Fset_file_times, Finsert_file_contents, auto_save_error):
22118 Rename locals to avoid shadowing.
f14b7e14 22119
5716756e 22120 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
22121 (Ftry_completion, Fall_completions): Rename or remove locals
22122 to avoid shadowing.
5716756e 22123
b4c3046a
PE
22124 * marker.c (bytepos_to_charpos): Remove; unused.
22125
b45db522
PE
22126 * lisp.h (verify_bytepos, count_markers): New decls,
22127 so that gcc does not warn that these functions aren't declared.
22128
85876d07
PE
22129 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22130 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 22131 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 22132 (copy_text): Remove unused local var.
85876d07 22133
03d78a21 22134 * filelock.c (within_one_second): Now static.
b3dd38ab 22135 (lock_file_1): Rename local to avoid shadowing.
03d78a21 22136
5df8f01b
PE
22137 * buffer.c (fix_overlays_before): Mark locals as initialized.
22138 (fix_start_end_in_overlays): Likewise. This function should be
22139 simplified by using pointers-to-pointers, but that's a different
22140 matter.
b1d876f1 22141 (switch_to_buffer_1): Now static.
8f54f30a
PE
22142 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22143 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 22144
a70072c9 22145 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 22146 Fix pointer signedness issue.
edced198
PE
22147 (sys_subshell): Mark local as volatile if checking for lint,
22148 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 22149 (MAXPATHLEN): Define only if needed.
a70072c9 22150
a0977c44
PE
22151 * process.c (serial_open, serial_configure): Move decls from here ...
22152 * systty.h: ... to here, so that they can be checked.
22153
a884fdcc
PE
22154 * fns.c (get_random, seed_random): Move extern decls from here ...
22155 * lisp.h: ... to here, so that they can be checked.
22156
604efe86 22157 * sysdep.c (reset_io): Now static.
b8950c94 22158 (wait_for_termination_signal): Remove; unused.
604efe86 22159
38fc62d9
PE
22160 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22161 (copy_keymap_item, append_key, push_text_char_description):
22162 Now static.
1004a21a 22163 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 22164 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
22165 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22166 (describe_map_tree):
22167 Rename locals to avoid shadowing.
38fc62d9 22168
2f2650da
PE
22169 * keyboard.c: Declare functions static if they are not used elsewhere.
22170 (echo_char, echo_dash, cmd_error, top_level_2):
22171 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
22172 (read_char, kbd_buffer_get_event, make_lispy_position):
22173 (make_lispy_event, make_lispy_movement, apply_modifiers):
22174 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22175 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22176 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 22177 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 22178 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 22179
a053e86c 22180 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
22181 (mark_kboards): Move decl here ...
22182 * alloc.c (mark_kboards): ... from here.
a053e86c 22183
4752793e
PE
22184 * lisp.h (force_auto_save_soon): New decl.
22185
74f10ca7 22186 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
22187 (DEFINE_DUMMY_FUNCTION): New macro.
22188 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22189 Use it.
c03cd23f
PE
22190 (main): Add casts to avoid warnings
22191 if GCC considers string literals to be constants.
74f10ca7 22192
022e70d4
PE
22193 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22194
59d6fe83
PE
22195 * dbusbind.c: Pointer signedness fixes.
22196 (xd_signature, xd_append_arg, xd_initialize):
22197 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22198 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22199 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22200 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22201
78320123
PE
22202 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22203 if GCC considers string literals to be constants.
49cebcca 22204 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 22205
35ac2a97
SM
222062011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22207
fb103ca9
SM
22208 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22209 (print_preprocess, print_object): New macro to fix last change.
22210
35ac2a97
SM
22211 * print.c (print_preprocess): Don't forget font objects.
22212
62973b41
JB
222132011-03-16 Juanma Barranquero <lekktu@gmail.com>
22214
22215 * emacs.c (USAGE3): Doc fixes.
22216
0e48bb22
AS
222172011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22218
22219 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22220 structure.
22221
7684e57b
JB
222222011-03-14 Juanma Barranquero <lekktu@gmail.com>
22223
22224 * lisp.h (VWindow_system, Qfile_name_history):
22225 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22226 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22227 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22228
22229 * w32select.c: Don't #include "keyboard.h".
c96bbc66 22230 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
22231
22232 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22233 * w32console.c (detect_input_pending, read_input_pending)
22234 (encode_terminal_code):
22235 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22236 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22237 (w32_system_caret_y, Qfile_name_history):
22238 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22239 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22240 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22241 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22242 * w32proc.c (Qlocal, report_file_error):
22243 * w32term.c (Vwindow_system, updating_frame):
22244 * w32uniscribe.c (initialized, uniscribe_font_driver):
22245 Remove unneeded extern declarations.
22246
2aa46d6c
CY
222472011-03-14 Chong Yidong <cyd@stupidchicken.com>
22248
c96bbc66 22249 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 22250
cffc6f3b
CY
222512011-03-13 Chong Yidong <cyd@stupidchicken.com>
22252
22253 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22254 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22255 These macros can no longer be used for assignment.
22256
44f230aa
SM
22257 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22258 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
22259 (record_buffer_markers, fetch_buffer_markers): New functions for
22260 recording and fetching special buffer markers.
22261 (set_buffer_internal_1, set_buffer_temp): Use them.
22262
22263 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22264
22265 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22266
22267 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22268 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22269
22270 * xdisp.c (hscroll_window_tree):
22271 (reconsider_clip_changes): Use PT instead of BUF_PT.
22272
d251f04b
EZ
222732011-03-13 Eli Zaretskii <eliz@gnu.org>
22274
22275 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22276 $(EMACS_ROOT)/lib/intprops.h.
22277
f0c77cd1
PE
222782011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22279
3eca4629
PE
22280 Fix more problems found by GCC 4.5.2's static checks.
22281
7c86ee98
PE
22282 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22283 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
22284 (xg_free_frame_widgets): Make it clear that a local variable is
22285 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
22286 (gdk_window_get_screen): Make it clear that this macro is needed
22287 only if USE_GTK_TOOLTIP.
1e5524e7
PE
22288 (int_gtk_range_get_value): New function, which avoids a diagnostic
22289 from gcc -Wbad-function-cast.
22290 (xg_set_toolkit_scroll_bar_thumb): Use it.
22291 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22292 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
22293 (get_utf8_string, xg_get_file_with_chooser):
22294 Rename locals to avoid shadowing.
22295 (create_dialog): Move locals to avoid shadowing.
7c86ee98 22296
41729b81
PE
22297 * xgselect.c (xg_select): Remove unused var.
22298
f0c77cd1
PE
22299 * image.c (four_corners_best): Mark locals as initialized.
22300 (gif_load): Initialize transparent_p to zero (Bug#8238).
22301 Mark another local as initialized.
ec6cf4c6 22302 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 22303
ce0ad53d 22304 * image.c (clear_image_cache): Now static.
d5d5a617 22305 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 22306 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
22307 (x_edge_detection): Remove unnecessary cast that
22308 gcc -Wbad-function-cast diagnoses.
2037898d 22309 (gif_load): Fix pointer signedness.
6ae141d6
PE
22310 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22311 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 22312
33383987 223132011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 22314
d32df629
PE
22315 Improve quality of tests for time stamp overflow.
22316 For example, without this patch (encode-time 0 0 0 1 1
22317 1152921504606846976) returns the obviously-bogus value (-948597
22318 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22319 reports time overflow. See
22320 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
22321 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22322 * editfns.c: Include limits.h and intprops.h.
22323 (TIME_T_MIN, TIME_T_MAX): New macros.
22324 (time_overflow): Move earlier, to before first use.
22325 (hi_time, lo_time): New functions, for an accurate test for
22326 out-of-range times.
22327 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22328 (Fget_internal_run_time): Don't assume time_t fits in int.
22329 (make_time): Use list2 instead of Fcons twice.
22330 (Fdecode_time): More accurate test for out-of-range times.
22331 (check_tm_member): New function.
22332 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
22333 (lisp_time_argument): Don't rely on undefined left-shift and
22334 right-shift behavior when checking for time stamp overflow.
8be6f318 22335
fe31d94c
PE
22336 * editfns.c (time_overflow): New function, refactoring common code.
22337 (Fformat_time_string, Fdecode_time, Fencode_time):
22338 (Fcurrent_time_string): Use it.
22339
8be6f318
PE
22340 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22341 * dired.c (make_time): Move to ...
22342 * editfns.c (make_time): ... here.
22343 * systime.h: Note the move.
22344
09d9db2c 223452011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 22346
126bc0dc
YM
22347 * fringe.c (update_window_fringes): Remove unused variables.
22348
c47cbdfd
YM
22349 * unexmacosx.c (copy_data_segment): Also copy __got section.
22350 (Bug#8223)
22351
7ac80be9
EZ
223522011-03-12 Eli Zaretskii <eliz@gnu.org>
22353
c96bbc66 22354 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
22355 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22356 Constify `char *' arguments and their references according to
22357 prototypes in tparam.h.
22358
ecb0f94d 22359 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 22360
7ac80be9
EZ
22361 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22362 Adapt all references accordingly.
22363
22364 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22365
ef1fd07e
TT
223662011-03-11 Tom Tromey <tromey@redhat.com>
22367
22368 * buffer.c (syms_of_buffer): Remove obsolete comment.
22369
7ef4b50c
EZ
223702011-03-11 Eli Zaretskii <eliz@gnu.org>
22371
22372 * termhooks.h (encode_terminal_code): Declare prototype.
22373
22374 * msdos.c (encode_terminal_code): Don't declare prototype.
22375
22376 * term.c (encode_terminal_code): Now external again, used by
22377 w32console.c and msdos.c.
22378
44f230aa
SM
22379 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22380 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 22381
4b1ec863 223822011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 22383
1714f52b 22384 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 22385
4b1ec863
PE
22386 * fringe.c (update_window_fringes): Mark locals as initialized
22387 (Bug#8227).
22388 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 22389
524c7aa6
PE
22390 * alloc.c (mark_fringe_data): Move decl from here ...
22391 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22392 to check its interface.
22393 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22394
a5c0af81 22395 * fontset.c (free_realized_fontset): Now static.
7519b8cd 22396 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 22397 (fontset_font): Mark local as initialized.
a9a06e0b 22398 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 22399
b4716021
PE
22400 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22401
811e9bac 22402 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 22403 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
22404 (x_own_selection, Fx_disown_selection_internal): Rename locals
22405 to avoid shadowing.
22406 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 22407
7e3ab302
PE
22408 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22409 so that the caller can use some name other than gcpro1.
22410 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
22411 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22412 (Fx_backspace_delete_keys_p):
22413 Use them to avoid shadowing, and rename vars to avoid shadowing.
22414 (x_decode_color, x_set_name, x_window): Now static.
6b437900 22415 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 22416 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
22417 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22418 Remove unused locals.
7e3ab302
PE
22419 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22420 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22421 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22422 macros.
f78faa98 22423
e2b13473
PE
22424 * xterm.h (x_mouse_leave): New decl.
22425
77f23912
PE
22426 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22427 Remove unused functions.
cdf4ba58
PE
22428 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22429 (x_calc_absolute_position): Now static.
7411c686 22430 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 22431 Don't declare local "event" unless it's used.
ed7bf3a5
PE
22432 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22433 unless they are used.
38d0b34a
PE
22434 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22435 (x_fatal_error_signal): Remove; not used.
a6067996
PE
22436 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22437 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22438 (x_error_catcher, x_connection_closed, x_error_handler):
22439 (x_error_quitter, xembed_send_message, x_iconify_frame):
22440 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 22441 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 22442 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 22443
44f230aa
SM
22444 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22445 Rename or move locals to avoid shadowing.
6b463e58 22446 (tty_defined_color, merge_face_heights): Now static.
5967d051 22447 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
22448 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22449 does not deduce is never used uninitialized.
73719eba
PE
22450 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22451 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 22452
426994c3 22453 * terminal.c (store_terminal_param): Now static.
5489860b 22454
032f1620 22455 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 22456 (set_frame_menubar): Remove unused local.
d4323972 22457 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
22458 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22459 since they might point to immutable storage.
281585b0
PE
22460 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22461 since it's unused otherwise.
032f1620 22462
367c19e5 22463 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 22464 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
22465 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22466 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 22467 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
22468 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22469 does not deduce are never used uninitialized.
70739cbe 22470
07b48fa9
PE
22471 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22472
8868a238 22473 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
22474 * window.c (window_loop, size_window):
22475 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 22476
7e5cf297 22477 * window.c (display_buffer): Now static.
d6550a9f
PE
22478 (size_window): Mark variables that gcc -Wuninitialized
22479 does not deduce are never used uninitialized.
a586633d
PE
22480 * window.h (check_all_windows): New decl, to forestall
22481 gcc -Wmissing-prototypes diagnostic.
5b555da1 22482 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 22483
f6095868
PE
22484 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22485 shadowing.
22486 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
22487 Include <limits.h>.
22488 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22489 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
22490 (load_charset_map): Mark variables that gcc -Wuninitialized
22491 does not deduce are never used uninitialized.
53df7c11 22492 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 22493
f38b440c
PE
22494 * coding.c (coding_set_source, coding_set_destination):
22495 Use "else { /* comment */ }" rather than "else /* comment */;"
22496 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
22497 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22498 a block, when the outer 'i' will do.
22499 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22500 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22501 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22502 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22503 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22504 Rename locals to avoid shadowing.
22505 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
22506 * coding.c (emacs_mule_char, encode_invocation_designation):
22507 Now static, since they're not used elsewhere.
413bb2db 22508 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 22509 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
22510 (decode_coding_emacs_mule): Mark variables that gcc
22511 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
22512 (detect_coding_iso_2022): Initialize a local variable that might
22513 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 22514 this initialization is needed. (Bug#8211)
5f58e762
PE
22515 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22516 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22517 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22518 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22519 Remove unused macros.
f38b440c 22520
232b38b9 22521 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 22522 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 22523 * character.c (string_count_byte8): Likewise.
232b38b9 22524
fb90da1b
PE
22525 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22526 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22527
fb93dbc2
PE
22528 * chartab.c (copy_sub_char_table): Now static, since it's not used
22529 elsewhere.
5c156ace
PE
22530 (sub_char_table_ref_and_range, char_table_ref_and_range):
22531 Rename locals to avoid shadowing.
bbcd0949 22532 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 22533
7d3b3862 22534 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 22535 (BIDI_BOB): Remove unused macro.
7d3b3862 22536
6be7d3da
PE
22537 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22538 deduce are never used uninitialized.
c2ed9c8b 22539 * term.c (encode_terminal_code): Likewise.
6be7d3da 22540
75f8807f 22541 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 22542
50938595
PE
22543 * tparam.h: New file.
22544 * term.c, tparam.h: Include it.
22545 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22546 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22547 Move these decls to tparam.h, and make them agree with what
22548 is actually in tparam.c. The previous trick of using incompatible
22549 decls in different modules does not conform to the C standard.
22550 All callers of tparam changed to use tparam's actual API.
22551 * tparam.c (tparam1, tparam, tgoto):
22552 Use const pointers where appropriate.
22553
fbceeba2
PE
22554 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22555 * cm.h (struct cm): Likewise.
22556 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22557 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22558 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22559 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22560 (turn_on_face, init_tty): Likewise.
22561 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 22562
7f3f1250
PE
22563 * term.c (term_mouse_position): Rename local to avoid shadowing.
22564
e6ca6543
PE
22565 * alloc.c (mark_ttys): Move decl from here ...
22566 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22567
c40f8d15
AS
225682011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22569
22570 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22571
cfe0661d
JB
225722011-03-09 Juanma Barranquero <lekktu@gmail.com>
22573
22574 * search.c (compile_pattern_1): Remove argument regp, unused since
22575 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22576 (compile_pattern): Don't pass it.
22577
0afb4571
J
225782011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22579
22580 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22581 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22582 for ! HAVE_GTK3.
22583 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22584
22585 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22586
22587 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22588 gdk_window_get_screen, gdk_window_get_geometry,
22589 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22590 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22591 (xg_get_pixbuf_from_pixmap): New function.
22592 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22593 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22594 Call xg_get_pixbuf_from_pixmap instead of
22595 gdk_pixbuf_get_from_drawable.
22596 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22597 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22598 (xg_check_special_colors): Use GtkStyleContext and its functions
22599 for HAVE_GTK3.
22600 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22601 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22602 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
22603 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22604 Call gtk_widget_get_preferred_size.
0afb4571
J
22605 (xg_frame_resized): gdk_window_get_geometry only takes 5
22606 parameters.
44f230aa
SM
22607 (xg_win_to_widget, xg_event_is_for_menubar):
22608 Call gdk_x11_window_lookup_for_display.
0afb4571
J
22609 (xg_set_widget_bg): New function.
22610 (delete_cb): New function.
895009e1 22611 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 22612 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
22613 (xg_set_background_color): Call xg_set_widget_bg.
22614 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22615 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22616 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22617 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22618 if ! HAVE_GTK3.
22619 (update_frame_tool_bar): Call gtk_widget_hide.
22620 (xg_initialize): Use GDK_KEY_g.
22621
22622 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22623 if ! HAVE_GTK3
22624 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22625
22626 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22627 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22628 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22629
1c2cc4ef
JB
226302011-03-08 Juanma Barranquero <lekktu@gmail.com>
22631
22632 * w32xfns.c (select_palette): Check success of RealizePalette against
22633 GDI_ERROR, not zero.
22634
33383987 22635See ChangeLog.11 for earlier changes.
aac0c6e3
MR
22636
22637;; Local Variables:
22638;; coding: utf-8
aac0c6e3
MR
22639;; End:
22640
ab422c4d 22641 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
22642
22643 This file is part of GNU Emacs.
22644
22645 GNU Emacs is free software: you can redistribute it and/or modify
22646 it under the terms of the GNU General Public License as published by
22647 the Free Software Foundation, either version 3 of the License, or
22648 (at your option) any later version.
22649
22650 GNU Emacs is distributed in the hope that it will be useful,
22651 but WITHOUT ANY WARRANTY; without even the implied warranty of
22652 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22653 GNU General Public License for more details.
22654
22655 You should have received a copy of the GNU General Public License
22656 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.