]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Avoid calls to CHAR_TO_BYTE if byte position is known.
[gnu-emacs] / src / ChangeLog
1 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Avoid calls to CHAR_TO_BYTE if byte position is known.
4 * editfns.c (make_buffer_string_both): Use move_gap_both.
5 (Fbuffer_string): Use make_buffer_string_both.
6 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
7 Adjust comment.
8 (buf_bytepos_to_charpos): Likewise.
9 (charpos_to_bytepos): Remove.
10 * fileio.c (Finsert_file_contents): Use move_gap_both.
11 * search.c (Freplace_match): Likewise.
12 * process.c (process_send_region): Likewise. Use convenient
13 names for byte positions.
14 * lisp.h (charpos_to_bytepos): Remove prototype.
15 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
16 * insdel.c (move_gap): Likewise.
17
18 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
19
20 * xdisp.c (redisplay_internal): Remove now-unused local.
21
22 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
23
24 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
25 (redisplay_internal): Don't bother selecting the frame to get the
26 proper value of frame-local variables.
27
28 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
29
30 * textprop.c (set_text_properties_1): Do not allow NULL interval.
31 Rename 4th argument since it may be buffer or string. Adjust comment.
32 * intervals.c (graft_intervals_info_buffer): Find an interval here.
33
34 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
35
36 * coding.c (Fdetect_coding_region): Do not check start and end with
37 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
38 (code_convert_region): Likewise.
39
40 2012-12-18 Eli Zaretskii <eliz@gnu.org>
41
42 * w32.c (acl_get_file, acl_set_file): Run the file name through
43 map_w32_filename, and resolve any symlinks in the file name, like
44 Posix platforms do.
45 (acl_set_file): Call revert_to_self, if any privileges were
46 enabled.
47
48 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
49
50 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
51 ($(BLD)/w32.$(O)): Update dependencies.
52
53 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
54
55 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
56 propagate redisplay's scrolling (if any) to the right window.
57 (redisplay_internal): Use ensure_selected_frame.
58 (display_mode_lines): Complete last fix.
59 * window.c (select_window_1): New func, extracted from select_window.
60 (select_window): Use it.
61 * window.h (select_window_1): Declare.
62
63 2012-12-17 Eli Zaretskii <eliz@gnu.org>
64
65 Emulate Posix ACL APIs on MS-Windows.
66 * w32.c: Include sddl.h and sys/acl.h.
67 (SDDL_REVISION_1): Define if not already defined.
68 (g_b_init_get_security_descriptor_dacl)
69 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
70 (g_b_init_is_valid_security_descriptor)
71 (g_b_init_set_file_security): New static flags.
72 (globals_of_w32): Initialize them to zero.
73 (SetFileSecurity_Name): New string constant.
74 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
75 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
76 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
77 (IsValidSecurityDescriptor_Proc): New typedefs.
78 (get_file_security, get_security_descriptor_owner)
79 (get_security_descriptor_group): Set errno to ENOTSUP.
80 (set_file_security, get_security_descriptor_dacl)
81 (is_valid_security_descriptor, convert_sd_to_sddl)
82 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
83 (acl_free, acl_get_file, acl_set_file): New functions.
84
85 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
86
87 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
88
89 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
90 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
91 for some of that bug's symptoms can now cause Emacs to abort.
92 Remove the workaround.
93 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
94 The bug that caused SIGCHLD to get lost has been fixed, and the
95 workaround for it can now cause Emacs to abort.
96
97 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
98
99 * sysdep.c (emacs_abort): Bump backtrace size to 40.
100 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
101 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
102
103 2012-12-16 Romain Francoise <romain@orebokech.com>
104
105 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
106 (Fcopy_file): Change last arg to `preserve_extended_attributes'
107 and copy ACL entries of file in addition to SELinux context if set.
108 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
109
110 * Makefile.in (LIBACL_LIBS): New macro.
111 (LIBES): Use it.
112
113 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
114
115 * fileio.c (internal_delete_file): Use bool for boolean.
116
117 2012-12-15 Eli Zaretskii <eliz@gnu.org>
118
119 Fix bug #13079 on MS-Windows with temp files not being deleted.
120 * w32.h (_child_process): New members input_file and
121 pending_deletion.
122 (register_child): First argument is now pid_t.
123 (record_infile, record_pending_deletion): New prototypes.
124
125 * w32proc.c (new_child): Initialize input_file and
126 pending_deletion members of the child.
127 (delete_child): Delete the child's temporary input file, if any,
128 that is pending deletion.
129 (register_child): First argument is now pid_t.
130 (record_infile, record_pending_deletion): New functions.
131 (reap_subprocess): Fix a typo in DebPrint string.
132 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
133
134 * fileio.c (internal_delete_file): Return an int again: non-zero
135 if delete-file succeeds, zero otherwise.
136
137 * lisp.h (internal_delete_file): Adjust prototype.
138
139 * callproc.c (Fcall_process): Don't overwrite infile with result
140 of DECODE_FILE.
141 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
142 asynchronous subprocess, record the name of the input file name,
143 if any.
144 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
145 delete the file, record it as pending deletion when the subprocess
146 exits.
147
148 2012-12-14 Eli Zaretskii <eliz@gnu.org>
149
150 * editfns.c [HAVE_PWD_H]: Include grp.h.
151
152 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
153
154 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
155
156 Fix permissions bugs with setgid directories etc. (Bug#13125)
157 * dired.c (Ffile_attributes): Return t as the 9th attribute,
158 to mark it as a placeholder. The old value was often wrong.
159 The only user of this attribute has been changed to use
160 file-ownership-preserved-p instead, with its new group arg.
161 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
162
163 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
164
165 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
166 Keep selected_window and selected_frame in sync.
167
168 2012-12-14 Eli Zaretskii <eliz@gnu.org>
169
170 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
171 try to get accurate owner and group information from NT file
172 security APIs. This is to make most callers of 'stat' and
173 'lstat', which don't need that information, much faster.
174
175 * dired.c (Ffile_attributes) [WINDOWSNT]:
176 Set w32_stat_get_owner_group to a non-zero value, to request accurate
177 owner and group information from 'lstat'.
178
179 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
180
181 * fileio.c (Finsert_file_contents): Don't put tail into head area,
182 as that confuses set-auto-coding, so insist on the head-read
183 returning the full 1024 bytes. Let lseek compute the tail offset;
184 less work for us. Do not ignore I/O errors when reading the tail.
185
186 * xdisp.c: Minor style fixes.
187 (init_iterator): Hoist assignment out of if-expression.
188 (markpos_of_region): Callers now test for sign, not for -1.
189
190 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
191
192 Minor redisplay optimization when the region length is zero.
193 * xdisp.c (markpos_of_region): New function.
194 (init_iterator): Do not highlight the region of zero length.
195 (redisplay_window): Check whether the region is of non-zero length.
196 (try_cursor_movement): Allow if the region length is zero.
197 (try_window_reusing_current_matrix, try_window_id): Likewise.
198
199 2012-12-13 Eli Zaretskii <eliz@gnu.org>
200
201 * search.c (search_buffer): Check the inverse translations of each
202 character in pattern when the buffer being searched is unibyte.
203 (Bug#13084)
204
205 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
206
207 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
208 files, fixing a regression from 24.2.
209 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
210
211 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
212
213 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
214 fstat shouldn't fail, and if it does fail copy-file should not proceed.
215 Remove unnecessary S_ISLNK test, as (contra the comments) this
216 function can't copy symlinks. Improve quality of error message
217 when attempting to copy files that are neither regular files nor
218 directories.
219
220 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
221
222 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
223 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
224 * window.c (Frecenter):
225 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
226 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
227
228 2012-12-12 Daniel Colascione <dancol@dancol.org>
229
230 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
231 the dumped Emacs is not a sparse file, greatly improving Cygwin
232 "make bootstrap" performance.
233
234 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
235
236 * inotify.c (inotify_callback): Generate an Emacs event for every
237 incoming inotify event.
238
239 2012-12-11 Eli Zaretskii <eliz@gnu.org>
240
241 * xdisp.c (handle_face_prop): Fix logic of computing
242 it->start_of_box_run_p.
243 (append_space_for_newline): If the glyph row is R2L, reset the
244 iterator's end_of_box_run_p flag before prepending the space glyph.
245 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
246 iterator's start_of_box_run_p flag before prepending the stretch.
247 (append_glyph, produce_image_glyph, append_composite_glyph)
248 (append_stretch_glyph, append_glyphless_glyph): Reverse the
249 left_box_line_p and right_box_line_p flags of the glyph for R2L
250 glyph rows. (Bug#13011)
251
252 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
253
254 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
255 if changed buffer is not shown in a window.
256 * insdel.c (prepare_to_modify_buffer): Likewise.
257 * window.c (replace_buffer_in_windows_safely): Do nothing
258 if buffer is not shown in a window.
259 (Fforce_window_update): Likewise if string or buffer argument
260 is passed.
261
262 2012-12-11 Eli Zaretskii <eliz@gnu.org>
263
264 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
265 encoded_file_name, which is what it is.
266
267 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
268
269 Consistently use marker_position and marker_byte_position.
270 * fringe.c (Ffringe_bitmaps_at_pos):
271 * indent.c (Fvertical_motion):
272 * insdel.c (prepare_to_modify_buffer):
273 * keyboard.c (make_lispy_position):
274 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
275 (window_scroll_pixel_based, displayed_window_lines)
276 (Fset_window_configuration):
277 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
278 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
279 Replace direct access to marker fields with calls
280 to marker_position and/or marker_byte_position.
281
282 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
283
284 * makefile.w32-in (SIG2STR_H): New macro.
285 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
286 ($(BLD)/w32notify.$(O)): Update dependencies.
287
288 2012-12-10 Daniel Colascione <dancol@dancol.org>
289
290 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
291 Windows file notification functionality unless WINDOWSNT.
292
293 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
294 declarations.
295
296 * w32fns.c (cache_system_info): Initialize the global hinst
297 variable here so various initialization calls DTRT.
298
299 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
300 (hinst): Remove unneeded extern declaration.
301 (_start): Remove initialization of above variables; remove
302 initialization of hinst, as cache_system_info now does that.
303
304 * emacs.c (main): Call cache_system_info early in startup; we
305 previously weren't calling it in Cygwin builds.
306
307 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
308 Teach the autoconf build system how to compile a Windows resource file
309 and link it to Emacs.
310
311 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
312
313 Per-buffer window counters.
314 * buffer.h (struct buffer): New member window_count.
315 (buffer_window_count): New function.
316 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
317 Initialize window_count.
318 (Fkill_buffer): Verify window_count for the buffer being killed.
319 (modify_overlay): Do not force redisplay if buffer is not shown
320 in any window.
321 (init_buffer_once): Initialize window_count for buffer_defaults
322 and buffer_local_symbols.
323 * window.h (buffer_shared): Remove declaration.
324 (wset_buffer): Convert from inline ...
325 * window.c (wset_buffer): ... to an ordinary function.
326 (adjust_window_count): New function.
327 (make_parent_window): Use it.
328 * xdisp.c (buffer_shared): Remove.
329 (redisplay_internal, redisplay_window): Adjust users.
330 (buffer_shared_and_changed): Use per-buffer window counter.
331
332 2012-12-10 Eli Zaretskii <eliz@gnu.org>
333
334 Support for filesystem notifications on MS-Windows.
335 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
336 and this is a TTY frame, signal the caller that keyboard input is
337 available.
338
339 * w32xfns.c (drain_message_queue): Now returns an int: an
340 indication whether any WM_EMACS_FILENOTIFY messages were found in
341 the queue.
342
343 * w32inevt.c (handle_file_notifications): New function.
344 (w32_console_read_socket): Call it to process file notifications.
345
346 * w32console.c (initialize_w32_display): Record the main thread ID
347 in dwMainThreadId.
348
349 * deps.mk (inotify.o): New dependency list.
350
351 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
352
353 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
354 (WM_EMACS_END): Bump value by 1.
355 (notification_buffer_in_use, file_notifications)
356 (notifications_size, notifications_desc): Declare.
357 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
358 Add prototypes.
359
360 * w32term.c (lispy_file_action, queue_notifications): New functions.
361 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
362 <Qrenamed_to>: New symbols.
363 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
364
365 * w32notify.c: New file, implements file event notifications for
366 MS-Windows.
367
368 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
369 by posting it to the w32_read_socket queue.
370
371 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
372
373 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
374 (GLOBAL_SOURCES): Add w32notify.c
375 ($(BLD)/w32notify.$(O)): New set of dependencies.
376
377 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
378
379 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
380 Handle FILE_NOTIFY_EVENT.
381 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
382 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
383 w32notify-handle-event by default.
384
385 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
386 syms_of_w32notify.
387
388 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
389
390 Support for filesystem notifications on GNU/Linux via inotify.
391 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
392
393 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
394
395 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
396 (syms_of_keyboard): DEFSYM it.
397 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
398 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
399 Qfile_inotify events.
400 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
401 special-event-map to inotify-handle-event.
402
403 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
404
405 * Makefile.in (base_obj): Add inotify.o.
406
407 * inotify.c: New file.
408
409 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
410
411 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
412
413 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
414
415 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
416 DWORD_PTR, for compatibility with 64-bit builds.
417
418 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
419 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
420 (system_process_attributes): Use SIZE_T rather than DWORD, for
421 compatibility with 64-bit builds.
422
423 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
424
425 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
426
427 2012-12-10 Eli Zaretskii <eliz@gnu.org>
428
429 * indent.c (Fvertical_motion): If a display string will be
430 displayed on the left or the right margin, don't consider it as a
431 factor in cursor positioning. (Bug#13108)
432
433 2012-12-10 Martin Rudalics <rudalics@gmx.at>
434
435 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
436
437 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
438
439 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
440 for string length.
441
442 2012-12-08 Eli Zaretskii <eliz@gnu.org>
443
444 * w32.c (unsetenv): Return 0 if the input string is too long.
445
446 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
447
448 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
449 * alloc.c (xputenv): New function.
450 * dbusbind.c (Fdbus_init_bus):
451 * emacs.c (main):
452 * xterm.c (x_term_init):
453 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
454 * editfns.c (initial_tz): Move static var decl up.
455 (tzvalbuf_in_environ): New static var.
456 (init_editfns): Initialize these two static vars.
457 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
458 Save old TZ value on stack, if it's small.
459 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
460 instead, use xputenv+unsetenv to set and restore TZ.
461 (environbuf): Remove static var. All uses removed.
462 (Fset_time_zone_rule): Do not save TZ and environ;
463 no longer needed here.
464 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
465 Move to inside set_time_zone_rule; they don't need file scope any more.
466 (set_time_zone_rule): Maintain the TZ=value string separately.
467 (syms_of_editfns): Don't initialize initial_tz;
468 init_editfns now does it.
469 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
470 * lisp.h (xputenv): New decl.
471
472 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
473
474 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
475
476 2012-12-08 Eli Zaretskii <eliz@gnu.org>
477
478 * w32.c (unsetenv, sys_putenv): New functions.
479
480 2012-12-08 Chong Yidong <cyd@gnu.org>
481
482 * editfns.c (Finsert_char): Make the error message more
483 informative (Bug#12992).
484
485 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
486
487 Simplify get_lim_data.
488 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
489 Remove USG and vlimit methods; no longer used these days.
490 Add #error catchall just in case.
491
492 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
493 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
494 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
495 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
496 (deleted_pid_list, Fdelete_process, create_process)
497 (record_child_status_change, handle_child_signal, deliver_child_signal)
498 (init_process_emacs, syms_of_process):
499 Assume SIGCHLD is defined.
500 (parse_signal): Remove. All uses removed.
501 (abbr_to_signal): New static function.
502 (Fsignal_process): Use it to convert signal names to ints.
503 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
504 kill (getpgrp (), ...).
505 (emacs_sigaction_init): Assume SIGCHLD is defined.
506 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
507 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
508 * syssignal.h (EMACS_KILLPG): Remove.
509 All uses replaced by 'kill' with a negative pid.
510 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
511 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
512
513 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
514
515 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
516 This will cause a production Emacs to dump core instead of
517 infinite-looping.
518
519 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
520
521 * frame.c (make_frame): Do not set window's buffer to t.
522 * window.c (Fsplit_window_internal): Likewise. Previously it was
523 used to indicate that the window is being set up. Now we use
524 set_window_buffer for all new windows, so the condition in ...
525 (Fset_window_buffer): ... is always true and can be removed.
526
527 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
528
529 Convenient macro to check whether the buffer is hidden.
530 * buffer.h (BUFFER_HIDDEN_P): New macro.
531 * frame.c (make_frame): Use it. Adjust comment.
532 * buffer.c (candidate_buffer): New function.
533 (Fother_buffer, other_buffer_safely): Use it.
534
535 2012-12-06 Eli Zaretskii <eliz@gnu.org>
536
537 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
538 if the child process is still running. Instead, exit the wait
539 loop and return zero. (Bug#13086)
540
541 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
542
543 * frame.h (x_char_width, x_char_height): Remove prototypes.
544 * w32term.h (x_char_width, x_char_height): Likewise.
545 * xfns.c (x_char_width, x_char_height): Remove.
546 * w32fns.c (x_char_width, x_char_height): Likewise.
547 * nsfns.c (x_char_width, x_char_height): Likewise.
548 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
549 all window frames.
550 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
551 * keyboard.c (command_loop_1): Remove prototype.
552 (command_loop_2, top_level_1): Add static to match prototype.
553
554 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
555
556 Fix a recently-introduced delete-process race condition.
557 * callproc.c, process.h (record_kill_process):
558 New function, containing part of the old call_process_kill.
559 (call_process_kill): Use it.
560 This does not change call_process_kill's behavior.
561 * process.c (Fdelete_process): Use record_kill_process to fix a
562 race condition that could cause Emacs to lose track of a child.
563
564 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
565
566 Avoid code duplication between prev_frame and next_frame.
567 * frame.c (candidate_frame): New function. Add comment.
568 (prev_frame, next_frame): Use it. Adjust comment.
569
570 2012-12-06 Eli Zaretskii <eliz@gnu.org>
571
572 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
573 fails, signal an error instead of continuing with an empty
574 string. (Bug#13079)
575 Encode expanded temp file pattern before passing it to mkstemp or
576 mktemp.
577
578 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
579 Encode the file name before passing it to dostounix_filename, in
580 case it will downcase it (under w32-downcase-file-names).
581 (Bug#12933)
582
583 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
584
585 Minor call-process cleanups.
586 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
587 at the same time as other platforms, to simplify analysis.
588 No need for fd0_volatile since we have synch_process_fd.
589 Avoid needless emacs_close; arg is always negative.
590
591 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
592
593 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
594 processes.
595
596 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
597
598 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
599 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
600 and mouse_face_hidden members to a bitfields.
601 * frame.h (struct frame): Remove set-but-not-used space_width member.
602 (FRAME_SPACE_WIDTH): Remove.
603 * nsterm.m, w32term.c, xterm.c: Adjust users.
604 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
605 member. Adjust users. Convert term_initted, delete_in_insert_mode,
606 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
607 members to a bitfields.
608
609 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
610
611 Don't let call-process be a zombie factory (Bug#12980).
612 Fixing this bug required some cleanup of the signal-handling code.
613 As a side effect, this change also fixes a longstanding rare race
614 condition whereby Emacs could mistakenly kill unrelated processes,
615 and it fixes a bug where a second C-g does not kill a recalcitrant
616 synchronous process in GNU/Linux and similar platforms.
617 The patch should also fix the last vestiges of Bug#9488,
618 a bug which has mostly been fixed on the trunk by other changes.
619 * callproc.c, process.h (synch_process_alive, synch_process_death)
620 (synch_process_termsig, sync_process_retcode):
621 Remove. All uses removed, to simplify analysis and so that
622 less consing is done inside critical sections.
623 * callproc.c (call_process_exited): Remove. All uses replaced
624 with !synch_process_pid.
625 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
626 These take the role of what used to be in unwind-protect arg.
627 All uses changed.
628 (block_child_signal, unblock_child_signal):
629 New functions, to avoid races that could kill innocent-victim processes.
630 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
631 (call_process_kill): Record killed processes as deleted, so that
632 zombies do not clutter up the system. Do this inside a critical
633 section, to avoid a race that would allow the clutter.
634 (call_process_cleanup): Fix code so that the second C-g works again
635 on common platforms such as GNU/Linux.
636 (Fcall_process): Create the child process in a critical section,
637 to fix a race condition. If creating an asynchronous process,
638 record it as deleted so that zombies do not clutter up the system.
639 Do unwind-protect for WINDOWSNT too, as that's simpler in the
640 light of these changes. Omit unnecessary call to emacs_close
641 before failure, as the unwind-protect code does that.
642 * callproc.c (call_process_cleanup):
643 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
644 * process.c (record_deleted_pid): New function, containing
645 code refactored out of Fdelete_process.
646 (Fdelete_process): Use it.
647 (process_status_retrieved): Remove. All callers changed to use
648 child_status_change.
649 (record_child_status_change): Remove, folding its contents into ...
650 (handle_child_signal): ... this signal handler. Now, this
651 function is purely a handler for SIGCHLD, and is not called after
652 a synchronous waitpid returns; the synchronous code is moved to
653 wait_for_termination. There is no need to worry about reaping
654 more than one child now.
655 * sysdep.c (get_child_status, child_status_changed): New functions.
656 (wait_for_termination): Now takes int * status and bool
657 interruptible arguments, too. Do not record child status change;
658 that's now the caller's responsibility. All callers changed.
659 Reimplement in terms of get_child_status.
660 (wait_for_termination_1, interruptible_wait_for_termination):
661 Remove. All callers changed to use wait_for_termination.
662 * syswait.h: Include <stdbool.h>, for bool.
663 (record_child_status_change, interruptible_wait_for_termination):
664 Remove decls.
665 (record_deleted_pid, child_status_changed): New decls.
666 (wait_for_termination): Adjust to API changes noted above.
667
668 * bytecode.c, lisp.h (Qbytecode): Remove.
669 No longer needed after 2012-11-20 interactive-p changes.
670
671 2012-12-03 Eli Zaretskii <eliz@gnu.org>
672
673 * xdisp.c (redisplay_window): If the cursor is visible, but inside
674 the scroll margin, move point outside the margin. (Bug#13055)
675
676 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
677
678 * gtkutil.c (my_log_handler): New function.
679 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
680
681 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
682
683 * lisp.h (modify_region): Rename to...
684 (modify_region_1): ...new prototype.
685 * textprop.c (modify_region): Now static. Adjust users.
686 * insdel.c (modify_region): Rename to...
687 (modify_region_1): ...new function to work with current buffer.
688 Adjust comment and users. Use true and false for booleans.
689
690 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
691
692 * alloc.c (free_save_value): New function.
693 (safe_alloca_unwind): Use it.
694 * lisp.h (free_save_value): New prototype.
695 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
696 Add comment.
697 (save_excursion_restore): Adjust to match saved data structure.
698 Use free_save_value to offload some work from GC. Drop obsolete
699 #if 0 code.
700
701 2012-12-03 Chong Yidong <cyd@gnu.org>
702
703 * fileio.c (Vauto_save_list_file_name): Doc fix.
704
705 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
706
707 * w32fns.c: Remove prototype of atof.
708 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
709 builds.
710 (file_dialog_callback): Make it UINT_PTR.
711
712 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
713 with 64-bit builds.
714
715 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
716 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
717 defined.
718
719 2012-12-03 Glenn Morris <rgm@gnu.org>
720
721 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
722
723 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
724
725 Fix xpalloc confusion after memory is exhausted.
726 * alloc.c (xpalloc): Comment fix.
727 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
728 and signals an error, do not clear charset_table_size, as
729 charset_table is still valid.
730 * doprnt.c (evxprintf): Clear *BUF after freeing it.
731
732 Use execve to avoid need to munge environ (Bug#13054).
733 * callproc.c (Fcall_process):
734 * process.c (create_process):
735 Don't save and restore environ; no longer needed.
736 * callproc.c (child_setup):
737 Use execve, not execvp, to preserve environ.
738
739 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
740
741 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
742
743 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
744
745 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
746 display for sliced images (Bug#10500).
747
748 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
749
750 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
751
752 * doc.c (Fdocumentation): Re-add handling of function-documentation,
753 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
754
755 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
756
757 * xdisp.c (window_outdated): Remove eassert since it hits
758 some suspicious corner cases (see Bug#13007 and Bug#13012).
759 (mode_line_update_needed): New function.
760 (redisplay_internal, redisplay_window): Use it.
761 (ensure_selected_frame): New function.
762 (redisplay_internal, unwind_redisplay): Use it.
763 (redisplay_internal): Move comment about buffer_shared...
764 (buffer_shared_and_changed): ...near to its real use.
765
766 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
767
768 * callproc.c (Fcall_process): Don't misreport vfork failure.
769
770 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
771
772 * callproc.c (Fcall_process): Fix vfork portability problems.
773 Do not assume that fd[0], count, filefd, and save_environ survive
774 vfork. Fix bug whereby wrong errno value could be reported for
775 pipe failure. Some minor cleanups, too, as follows. Move buf and
776 bufsize to the context where they're needed. Change new_argv to
777 be of type char **, as this is more convenient and avoids casts.
778 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
779 Now local constants, not macros.
780
781 2012-11-18 Kenichi Handa <handa@gnu.org>
782
783 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
784 for the variable "f".
785
786 2012-11-13 Kenichi Handa <handa@gnu.org>
787
788 * font.c (font_unparse_xlfd): Exclude special characters from the
789 generating XLFD name.
790
791 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
792
793 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
794 * dired.c (stat_uname, stat_gname):
795 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
796
797 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
798 * dired.c (directory_files_internal, file_name_completion):
799 Assume EAGAIN and EINTR are defined.
800
801 * fileio.c (Fcopy_file): Assume EISDIR is defined.
802 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
803 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
804 * lread.c (readbyte_from_file): Assume EINTR is defined.
805 * process.c (wait_reading_process_output, send_process) [subprocesses]:
806 Assume EIO and EAGAIN are defined.
807 * unexcoff.c (write_segment): Assume EFAULT is defined.
808
809 2012-11-27 Eli Zaretskii <eliz@gnu.org>
810
811 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
812 (Bug#11964)
813
814 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
815 highlighting on the frame was cleared. Prevents assertion
816 violations when repeatedly clicking on the "Top" link of the
817 "bread-crumbs" in Info buffers.
818
819 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
820
821 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
822
823 2012-11-24 Ken Brown <kbrown@cornell.edu>
824
825 * keyboard.c (HAVE_MOUSE):
826 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
827 were always defined.
828
829 2012-11-24 Eli Zaretskii <eliz@gnu.org>
830
831 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
832 between bpos_covered and bpos_max. This fixes cursor display when
833 several display strings follow each other.
834
835 * .gdbinit (pgx): If the glyph's object is a string, display the
836 pointer to string data, rather than the value of the string object
837 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
838
839 * indent.c (Fvertical_motion): If the starting position is covered
840 by a display string, return to one position before that, to avoid
841 overshooting it inside move_it_to. (Bug#12930)
842
843 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
844
845 * frame.h (struct frame): Remove display_preempted member
846 since all users are dead long ago.
847 * nsterm.h (struct x_output): Use the only dummy member.
848 * w32menu.c (pending_menu_activation): Remove since not
849 really used.
850 (set_frame_menubar): Adjust user.
851 * w32term.h (struct x_output): Drop outdated #if 0 code.
852 (struct w32_output): Use bitfields for explicit_parent,
853 asked_for_visible and menubar_active members.
854 Drop unused pending_menu_activation member.
855 * xterm.h (struct x_output): Drop outdated #if 0 code.
856 Use bitfields for explicit_parent, asked_for_visible,
857 has_been_visible and net_wm_state_hidden_seen members.
858
859 2012-11-23 Eli Zaretskii <eliz@gnu.org>
860
861 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
862 of a literal "/". (Bug#12955)
863 (gl-stamp): Invoke fc.exe directly, not through cmd.
864
865 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
866
867 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
868 * dired.c: Assume HAVE_DIRENT_H.
869 (NAMLEN): Remove, replacing with ...
870 (dirent_namelen): New function. All uses changed. Use the GNU macro
871 _D_EXACT_NAMELEN if available, as it's faster than strlen.
872 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
873 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
874 * makefile.w32-in (DIR_H): Remove. All uses replaced with
875 $(NT_INC)/dirent.h.
876 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
877 * ndir.h: Rename to ../nt/inc/dirent.h.
878 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
879 Do not include <dirent.h>; no longer needed.
880 * w32.c: Include <dirent.h> rather than "ndir.h".
881
882 2012-11-23 Chong Yidong <cyd@gnu.org>
883
884 * xftfont.c (xftfont_open): Remove duplicate assignment.
885
886 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
887
888 * alloc.c (Fgarbage_collect): Unblock input after clearing
889 gc_in_progress to avoid note_mouse_highlight glitch with GC.
890 * frame.h (FRAME_MOUSE_UPDATE): New macro.
891 * msdos.c (IT_frame_up_to_date): Use it here...
892 * w32term.c (w32_frame_up_to_date): ...here...
893 * xterm.c (XTframe_up_to_date): ...and here...
894 * nsterm.m (ns_frame_up_to_date): ...but not here.
895 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
896 Adjust users.
897 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
898 Do not check whether GC is in progress.
899
900 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
901
902 * xdisp.c (window_buffer_changed): New function.
903 (update_menu_bar, update_tool_bar): Use it to
904 simplify large 'if' statements.
905 (redisplay_internal): Generalize commonly used
906 'tail' and 'frame' local variables.
907
908 2012-11-22 Eli Zaretskii <eliz@gnu.org>
909
910 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
911 with Windows system header.
912
913 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
914
915 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
916 * alloc.c: Assume unistd.h exists.
917 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
918 * sysdep.c (get_current_dir_name): Assume getcwd exists.
919 (getwd) [USG]: Remove; no longer needed.
920 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
921 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
922 * w32.h (getcwd): Remove decl.
923
924 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
925
926 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
927 Make it set selected_window as well.
928 (update_tool_bar): Use it.
929
930 2012-11-21 Ken Brown <kbrown@cornell.edu>
931
932 * emacs.c (main): Set the G_SLICE environment variable for all
933 Cygwin builds, not just GTK builds. See
934 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
935
936 2012-11-21 Eli Zaretskii <eliz@gnu.org>
937
938 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
939 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
940 Define for the MSVC compiler.
941
942 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
943
944 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
945 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
946 dostounix_filename. Prevents crashes down the road, because
947 dostounix_filename assumes it gets a unibyte string.
948 Reported by Michel de Ruiter <michel@sentient.nl>, see
949 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
950
951 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
952
953 Conflate Qnil and Qunbound for `symbol-function'.
954 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
955 * lread.c (init_obarray): Set `function' fields to Qnil.
956 * eval.c (Fcommandp): Ignore Qunbound.
957 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
958 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
959 Test NILP rather than Qunbound.
960 (Ffmakunbound): Set to Qnil.
961 (Fsymbol_function): Never signal an error.
962 (Finteractive_form): Ignore Qunbound.
963
964 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
965
966 * eval.c (interactive_p): Remove no-longer-used decl.
967
968 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
969
970 * xdisp.c (buffer_shared): Adjust comment.
971 (buffer_shared_and_changed): New function.
972 (prepare_menu_bars, redisplay_internal): Use it to
973 decide whether all windows or frames should be updated.
974 (window_outdated): New function.
975 (text_outside_line_unchanged_p, redisplay_window): Use it.
976 (redisplay_internal): Likewise. Fix indentation.
977
978 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
979
980 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
981 (syms_of_eval): Remove corresponding defsubr.
982 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
983
984 2012-11-19 Daniel Colascione <dancol@dancol.org>
985
986 * w32fns.c (Fx_file_dialog):
987 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
988 cygwin_convert_file_name*.
989
990 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
991 Rename cygwin_convert_path* to cygwin_convert_file_name*.
992
993 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
994
995 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
996
997 2012-11-18 Eli Zaretskii <eliz@gnu.org>
998
999 * w32select.c: Include w32common.h before w32term.h, so that
1000 windows.h gets included before w32term.h uses some of its
1001 features, see below.
1002
1003 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
1004 New typedefs.
1005 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
1006 New prototypes.
1007 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
1008
1009 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
1010
1011 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
1012 (ns_select): Return at once if events are held (Bug#12834).
1013
1014 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
1015
1016 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
1017 Needed following 2012-10-20 change. (Bug#12902)
1018
1019 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
1020
1021 * w32proc.c (waitpid): Remove unused label get_result.
1022
1023 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
1024
1025 * makefile.w32-in (SYSWAIT_H): New macro.
1026 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
1027 ($(BLD)/sysdep.$(O)): Update dependencies.
1028
1029 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1030
1031 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
1032 * callproc.c (relocate_fd): Assume F_DUPFD.
1033 * emacs.c, term.c (O_RDWR): Remove.
1034 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
1035 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
1036 * nsterm.m: Assume <fcntl.h> exists.
1037 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
1038 (create_pty, Fmake_network_process, server_accept_connection)
1039 (wait_reading_process_output, init_process_emacs):
1040 Assume O_NONBLOCK.
1041 (wait_reading_process_output): Put in a special case for WINDOWSNT
1042 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
1043 It's not clear this is needed, but it's a more-conservative change.
1044 (create_process): Assume FD_CLOEXEC.
1045 (create_process, create_pty): Assume O_NOCTTY.
1046 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
1047 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
1048 Omit if not DOS_NT, since F_GETFL is not defined there.
1049 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
1050 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
1051 (O_NOCTTY): Remove.
1052 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
1053 lack it, since gnulib guarantees this.
1054 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
1055
1056 2012-11-17 Eli Zaretskii <eliz@gnu.org>
1057
1058 * w32.c (faccessat): Pretend that directories have the execute bit
1059 set. Emacs expects that, e.g., in files.el:cd-absolute.
1060
1061 * w32proc.c (create_child): Don't clip the PID of the child
1062 process to fit into an Emacs integer, as this is no longer a
1063 restriction.
1064 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
1065 reaping only the process specified by PID argument, if that is
1066 positive. Use PID instead of dead_child to know which process to
1067 reap. Wait for the child to die only if WNOHANG is not in
1068 OPTIONS.
1069 (sys_select): Don't set dead_child.
1070
1071 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
1072 as it is no longer needed.
1073
1074 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
1075 no longer needed.
1076 (record_child_status_change): Remove the setting of
1077 record_at_most_one_child for the !WNOHANG case.
1078
1079 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1080
1081 Fix problems in ns port found by static checking.
1082 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
1083 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
1084 not to process group.
1085 (ns_select): Use emacs_write, not write, as that's more robust
1086 in the presence of signals.
1087 (fd_handler:): Check for read errors.
1088
1089 2012-11-16 Glenn Morris <rgm@gnu.org>
1090
1091 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
1092
1093 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
1094
1095 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
1096
1097 2012-11-16 Eli Zaretskii <eliz@gnu.org>
1098
1099 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
1100 use the same value of thread handle.
1101 (start_timer_thread): If the timer thread exited (due to error),
1102 clean up by closing the two handles it used. Duplicate the caller
1103 thread's handle here, so it gets duplicated only once, when
1104 launching the timer thread. Set priority of the timer thread, not
1105 the caller thread.
1106 (getitimer): Don't duplicate the caller thread's handle here.
1107 (Bug#12832)
1108
1109 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
1110
1111 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
1112 called (Bug#12834).
1113
1114 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
1115
1116 Remove no-longer-used pty_max_bytes variable.
1117 * process.c (pty_max_bytes): Remove; unused.
1118 (send_process): Do not set it.
1119
1120 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
1121
1122 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
1123 Update dependencies.
1124
1125 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
1126
1127 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
1128 This follows up on the 2012-09-29 patch that removed indirection
1129 for the 'function' field. Reported by Sergey Vinokurov in
1130 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
1131
1132 2012-11-14 Eli Zaretskii <eliz@gnu.org>
1133
1134 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
1135 different name, as the MS runtime does not have such a function,
1136 and probably never will.) All callers changed. Ignore DIRFD
1137 value if PATH is an absolute file name, to match Posix spec
1138 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
1139 symlinks.
1140
1141 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
1142
1143 * xdisp.c (echo_area_display, redisplay_internal):
1144 Omit redundant check whether frame_garbaged is set.
1145
1146 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
1147
1148 Use faccessat, not access, when checking file permissions (Bug#12632).
1149 This fixes a bug that has been present in Emacs since its creation.
1150 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
1151 which must set some sort of record. (Torek's bug report was against
1152 a predecessor of GNU Emacs, but GNU Emacs happened to have the
1153 same common flaw.) See Torek's Usenet posting
1154 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
1155 Posted: Fri Apr 8 14:18:56 1983.
1156 * Makefile.in (LIB_EACCESS): New macro.
1157 (LIBES): Use it.
1158 * callproc.c (init_callproc):
1159 * charset.c (init_charset):
1160 * fileio.c (check_existing, check_executable, check_writable)
1161 (Ffile_readable_p):
1162 * lread.c (openp, load_path_check):
1163 * process.c (allocate_pty):
1164 * xrdb.c (file_p):
1165 Use effective UID when checking permissions, not real UID.
1166 * callproc.c (init_callproc):
1167 * charset.c (init_charset):
1168 * lread.c (load_path_check, init_lread):
1169 Test whether directories are accessible, not merely whether they exist.
1170 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
1171 * fileio.c (check_existing, check_executable, check_writable)
1172 (Ffile_readable_p):
1173 Use symbolic names instead of integers for the flags, as they're
1174 portable now.
1175 (check_writable): New arg AMODE. All uses changed.
1176 Set errno on failure.
1177 (Ffile_readable_p): Use faccessat, not stat + open + close.
1178 (Ffile_writable_p): No need to call check_existing + check_writable.
1179 Just call check_writable and then look at errno. This saves a syscall.
1180 dir should never be nil; replace an unnecessary runtime check
1181 with an eassert. When checking the parent directory of a nonexistent
1182 file, check that the directory is searchable as well as writable, as
1183 we can't create files in unsearchable directories.
1184 (file_directory_p): New function, which uses 'stat' on most platforms
1185 but faccessat with D_OK (for efficiency) if WINDOWSNT.
1186 (Ffile_directory_p, Fset_file_times): Use it.
1187 (file_accessible_directory_p): New function, which uses a single
1188 syscall for efficiency.
1189 (Ffile_accessible_directory_p): Use it.
1190 * xrdb.c (file_p): Use file_directory_p.
1191 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
1192 * lread.c (openp): When opening a file, use fstat rather than
1193 stat, as that avoids a permissions race. When not opening a file,
1194 use file_directory_p rather than stat.
1195 (dir_warning): First arg is now a usage string, not a format.
1196 Use errno. All uses changed.
1197 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
1198 that merely introduced a race.
1199 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
1200 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
1201 and similarly for the other O_* flags.
1202 * w32.c (sys_faccessat): Rename from sys_access and switch to
1203 faccessat's API. All uses changed.
1204 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
1205 (magic_db): Rename from magic_file_p.
1206 (magic_db, search_magic_path): Return an XrmDatabase rather than a
1207 char *, so that we don't have to test for file existence
1208 separately from opening the file for reading. This removes a race
1209 fixes a permission-checking problem, and simplifies the code.
1210 All uses changed.
1211 (file_p): Remove; no longer needed.
1212
1213 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
1214
1215 Omit glyphs initialization at startup.
1216 * dispnew.c (glyphs_initialized_initially_p): Remove.
1217 (adjust_frame_glyphs_initially): Likewise. Adjust users.
1218 (Fredraw_frame): Move actual code from here...
1219 (redraw_frame): ...to here. Add eassert. Adjust comment.
1220 (Fredraw_display): Use redraw_frame.
1221 * xdisp.c (clear_garbaged_frames): Likewise.
1222
1223 2012-11-13 Eli Zaretskii <eliz@gnu.org>
1224
1225 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
1226 passed to pint2str and pint2hrstr to be at most the size of the
1227 frame's decode_mode_spec_buffer. This avoids crashes with very
1228 large values of FIELD_WIDTH argument to decode_mode_spec.
1229 (Bug#12867)
1230
1231 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
1232
1233 Fix a race with verify-visited-file-modtime (Bug#12863).
1234 Since at least 1991 Emacs has ignored an mtime difference of no
1235 more than one second, but my guess is that this was to work around
1236 file system bugs that were fixed long ago. Since the race is
1237 causing problems now, let's remove that code.
1238 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
1239 whose time stamp is off by no more than a second. Insist that the
1240 file time stamps match exactly.
1241
1242 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1243
1244 * frame.h (struct frame): Convert external_tool_bar member to
1245 1-bit unsigned bitfield.
1246 * termhooks.h (struct terminal): Remove mouse_moved member since
1247 all users are long dead. Adjust comment on mouse_position_hook.
1248
1249 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1250
1251 Simplify by using FOR_EACH_FRAME here and there.
1252 * frame.c (next_frame, prev_frame, other_visible_frames)
1253 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
1254 * w32term.c (x_window_to_scroll_bar): Likewise.
1255 * window.c (window_list): Likewise.
1256 * xdisp.c (x_consider_frame_title): Likewise.
1257 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
1258 * xfns.c (x_window_to_frame, x_any_window_to_frame)
1259 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
1260 * xmenu.c (menubar_id_to_frame): Likewise.
1261 * xselect.c (frame_for_x_selection): Likewise.
1262 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
1263 (x_window_to_menu_bar): Likewise.
1264 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
1265
1266 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
1267
1268 * data.c (Qdefalias_fset_function): Now static.
1269
1270 Another tweak to vectorlike_header change.
1271 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
1272 Remove, and replace all uses with ...
1273 (next_in_free_list, set_next_in_free_list):
1274 New functions, which respect C's aliasing rules better.
1275
1276 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
1277
1278 * window.c (list4i): Rename from 'quad'. All uses changed.
1279 Needed because <sys/types.h> defines 'quad' on Solaris 10.
1280
1281 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
1282
1283 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
1284 warning about mixing declarations and code in ISO C90.
1285
1286 2012-11-10 Martin Rudalics <rudalics@gmx.at>
1287
1288 * window.c (Fsplit_window_internal): Set combination limit of
1289 new parent window to t iff Vwindow_combination_limit is t;
1290 fixing a regression introduced with the change from 2012-09-22.
1291 (Fset_window_combination_limit): Fix doc-string.
1292
1293 2012-11-10 Eli Zaretskii <eliz@gnu.org>
1294
1295 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
1296 amount when the scroll margins are too large. When scrolling
1297 backwards in the buffer, give up if cannot reach point or the
1298 scroll margin within a reasonable number of screen lines.
1299 Fixes point position in window under scroll-up/down-aggressively when
1300 point is positioned many lines beyond the window top/bottom.
1301 (Bug#12811)
1302
1303 * ralloc.c (relinquish): If real_morecore fails to return memory
1304 to the system, don't crash; instead, leave the last heap
1305 unchanged and return. (Bug#12774)
1306
1307 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1308
1309 * lisp.h (AUTOLOADP): New macro.
1310 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
1311 * data.c (Ffset): Remove special ad-advice-info handling.
1312 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
1313 (Fsubr_arity): CSE.
1314 (Finteractive_form): Simplify.
1315 (Fquo): Don't insist on having at least 2 arguments.
1316 (Qdefalias_fset_function): New var.
1317
1318 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1319
1320 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
1321
1322 * nsfont.m (Qcondensed, Qexpanded): New variables.
1323 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
1324 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
1325
1326 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1327
1328 Fix recently introduced crash on MS-Windows (Bug#12839).
1329 * w32term.h (struct scroll_bar): Use convenient header.
1330 (SCROLL_BAR_VEC_SIZE): Remove.
1331 * w32term.c (x_scroll_bar_create): Use VECSIZE.
1332
1333 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1334
1335 Tweak last vectorlike_header change.
1336 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
1337 vectorlike object on the free list. This is introduced to avoid
1338 some (but not all) pointer casting and aliasing problems, see
1339 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
1340 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
1341 objects.
1342 (xvectype, xvecsize): Use them to examine Lisp_Object values.
1343
1344 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1345
1346 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
1347 been removed, so remove them here also.
1348
1349 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1350
1351 * doc.c (Fdocumentation): Handle new property
1352 dynamic-docstring-function to replace the old ad-advice-info.
1353
1354 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
1355
1356 * fns.c (Qeql, hashtest_eq): Now static.
1357
1358 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1359
1360 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
1361 * fns.c (hashfn_eq, hashfn_eql, sxhash):
1362 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
1363 * buffer.c (compare_overlays): Use XLI rather than XHASH.
1364
1365 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
1366
1367 Use same hash function for hashfn_profiler as for hash_string etc.
1368 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
1369 * lisp.h (sxhash_combine): New inline function, with the contents
1370 of the old SXHASH_COMBINE.
1371 * profiler.c (hashfn_profiler): Use it, instead of having a
1372 special hash function containing a comparison that always yields 1.
1373
1374 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1375
1376 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
1377 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
1378 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
1379 Remove unused vars.
1380
1381 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
1382
1383 * image.c (xpm_make_color_table_h): Fix compiler error because
1384 make_hash_table changed.
1385
1386 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
1387
1388 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
1389
1390 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1391
1392 Use ad-hoc comparison function for the profiler's hash-tables.
1393 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
1394 (make_log): Use them.
1395 (handle_profiler_signal): Don't inhibit quit any longer since we don't
1396 call Fequal any more.
1397 (Ffunction_equal): New function.
1398 (cmpfn_profiler, hashfn_profiler): New functions.
1399 (syms_of_profiler): Initialize them.
1400 * lisp.h (struct hash_table_test): New struct.
1401 (struct Lisp_Hash_Table): Use it.
1402 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
1403 * fns.c (make_hash_table): Take a struct to describe the test.
1404 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1405 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
1406 (hash_lookup, hash_remove_from_table): Move assertion checking of
1407 hashfn result here. Check hash-equality before calling cmpfn.
1408 (Fmake_hash_table): Adjust call to make_hash_table.
1409 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
1410 (syms_of_fns): Initialize them.
1411 * emacs.c (main): Move syms_of_fns earlier.
1412 * xterm.c (syms_of_xterm):
1413 * category.c (hash_get_category_set): Adjust call to make_hash_table.
1414 * print.c (print_object): Adjust to new hash-table struct.
1415 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
1416
1417 2012-11-08 Eli Zaretskii <eliz@gnu.org>
1418
1419 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
1420 value of w32-scroll-lock-modifier is neither nil nor one of the
1421 known key modifiers. (Bug#12806)
1422
1423 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1424
1425 Shrink struct vectorlike_header to the only size field.
1426 * lisp.h (enum pvec_type): Avoid explicit enum member values.
1427 Adjust comment.
1428 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
1429 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
1430 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
1431 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
1432 information from the vector header. Adjust comment.
1433 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
1434 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
1435 layout.
1436 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
1437 (struct vectorlike_header): Remove next member. Adjust comment.
1438 (struct Lisp_Subr): Add convenient header. Adjust comment.
1439 (allocate_pseudovector): Adjust prototype.
1440 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1441 (sweep_string, lisp_malloc): Remove useless prototypes.
1442 (enum mem_type): Adjust comment.
1443 (NEXT_IN_FREE_LIST): New macro.
1444 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1445 (Fmake_bool_vector): Likewise.
1446 (struct large_vector): New type to represent allocation unit for
1447 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1448 (large_vectors): Change type to struct large_vector.
1449 (allocate_vector_from_block): Simplify.
1450 (PSEUDOVECTOR_NBYTES): Replace with...
1451 (vector_nbytes): ...new function. Adjust users.
1452 (sweep_vectors): Adjust processing of large vectors.
1453 (allocate_vectorlike): Likewise.
1454 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1455 Add easserts. Adjust XSETPVECTYPESIZE usage.
1456 (allocate_buffer): Use BUFFER_PVEC_INIT.
1457 (live_vector_p): Adjust to match large vector.
1458 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1459 * buffer.h (struct buffer): Add next member.
1460 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1461 New macros.
1462 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1463 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1464 (copy_hash_table): Adjust to match vector header change.
1465 * lread.c (defsubr): Use XSETPVECTYPE.
1466 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1467 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1468 (xvecsize): New command.
1469
1470 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1471
1472 * keyboard.c (event_to_kboard): Do not dereference
1473 frame_or_window field of SELECTION_REQUEST_EVENT
1474 and SELECTION_CLEAR_EVENT events (Bug#12814).
1475 * xterm.h (struct selection_input_event): Adjust comment.
1476
1477 2012-11-07 Eli Zaretskii <eliz@gnu.org>
1478
1479 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1480 such as Scroll Lock, if the respective keys are treated as
1481 function keys, not as modifiers. This avoids destroying non-ASCII
1482 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
1483
1484 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1485
1486 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1487
1488 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1489
1490 Restore some duplicate definitions (Bug#12814).
1491 This undoes part of the 2012-11-03 changes. Some people build
1492 with plain -g rather than with -g3, and they need the duplicate
1493 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1494 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1495 Define as macros, as well as as enums or as constants.
1496
1497 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1498
1499 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1500 to keypad keys (Bug#12816).
1501
1502 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1503
1504 Minor adjustments of recently-changed frame functions.
1505 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1506 known to be a frame (we're in the FRAMEP branch).
1507 * lisp.h (Qframep): Remove decl. frame.h declares this.
1508 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1509 since they're meant for Lisp fixnum values.
1510
1511 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1512
1513 * window.c (Fwindow_combination_limit): Revert to the only
1514 required argument and adjust docstring as suggested in
1515 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1516 by Martin Rudalics <rudalics@gmx.at>.
1517
1518 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1519
1520 Widely used frame validity and checking functions.
1521 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1522 * frame.c (decode_live_frame, decode_any_frame): New functions.
1523 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1524 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1525 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1526 (Fframe_pointer_visible_p): Use decode_any_frame.
1527 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1528 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1529 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1530 (Fframe_focus): Likewise. Allow zero number of arguments.
1531 Adjust docstring.
1532 (frame_buffer_list, frame_buffer_predicate): Remove.
1533 * lisp.h (frame_buffer_predicate): Remove prototype.
1534 * buffer.c (Fother_buffer): Use decode_any_frame.
1535 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1536 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1537 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1538 (Fclose_font, Ffont_info): Use decode_live_frame.
1539 * fontset.c (check_fontset_name): Likewise.
1540 * terminal.c (Fframe_terminal): Likewise.
1541 * w32fns.c (check_x_frame): Likewise.
1542 * window.c (Fminibuffer_window, Fwindow_at)
1543 (Fcurrent_window_configuration): Likewise.
1544 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1545 Likewise. Allow zero number of arguments. Adjust docstring.
1546 * dispnew.c (Fredraw_frame): Likewise.
1547 * xfaces.c (frame_or_selected_frame): Remove.
1548 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1549 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1550 (Fframe_face_alist): Use decode_live_frame.
1551 * xfns.c (check_x_frame): Likewise.
1552
1553 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1554
1555 * window.c (quad): New function.
1556 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1557 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1558 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1559 (Fwindow_line_height): Use it.
1560 (Fwindow_fringes): Use list3.
1561 (Fwindow_scroll_bars): Use list4.
1562 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1563 (Fwindow_combination_limit): Allow zero number of arguments.
1564
1565 2012-11-05 Eli Zaretskii <eliz@gnu.org>
1566
1567 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1568
1569 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
1570 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
1571 file descriptor 2 for standard error. (Bug#12805)
1572
1573 2012-11-05 Chong Yidong <cyd@gnu.org>
1574
1575 * process.c (wait_reading_process_output): Revert previous change.
1576
1577 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1578
1579 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1580 This removes code that has been obsolete since around 1990.
1581 * callproc.c (Fcall_process):
1582 * emacs.c (main):
1583 * process.c (create_process):
1584 * term.c (dissociate_if_controlling_tty):
1585 Assume setsid exists.
1586 * callproc.c (child_setup): Assume setpgid exists and behaves as
1587 per POSIX.1-1988 or later.
1588 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1589 * emacs.c (shut_down_emacs):
1590 * sysdep.c (sys_suspend, init_foreground_group):
1591 Assume getpgrp behaves as per POSIX.1-1998 or later.
1592 * msdos.c (setpgrp): Remove.
1593 (tcgetpgrp, setpgid, setsid): New functions.
1594 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1595 * term.c (no_controlling_tty): Remove; unused.
1596 * w32proc.c (setpgrp): Remove.
1597 (setsid, tcgetpgrp): New functions.
1598
1599 Simplify by assuming __fpending.
1600 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1601 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1602 Do not assume that __fpending's result fits in int.
1603
1604 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1605
1606 Remove EMACS_OUTQSIZE+sleep hack.
1607 * dispnew.c (update_frame_1): Remove hack for terminals slower
1608 than 2400 bps, which throttled Emacs by having it sleep.
1609 This code hasn't worked since at least 2007, when the multi-tty stuff
1610 was added, and anyway those old terminals are long dead.
1611 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1612 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1613
1614 Fix data-loss with --version (Bug#9574).
1615 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1616 as we can't assume that emacs_strerror is initialized, and strerror
1617 is good enough here.
1618 (main): Invoke atexit earlier, to catch earlier instances of
1619 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1620
1621 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1622
1623 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1624 (keyDown): Remap keypad keys to X11 virtual key codes.
1625
1626 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1627
1628 Fix data-loss with --batch (Bug#9574).
1629 * emacs.c: Include <close-stream.h>.
1630 (close_output_streams): New function.
1631 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1632 and handles errors appropriately.
1633 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1634 does that now.
1635
1636 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1637 The symptom is a diagnostic "GLib-WARNING **: In call to
1638 g_spawn_sync(), exit status of a child process was requested but
1639 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1640 waitpid(), so exit status can't be returned." The diagnostic
1641 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1642 The real bug is a race condition between Emacs and glib: Emacs
1643 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1644 so that glib can't find it. Work around the bug by invoking
1645 waitpid only on subprocesses that Emacs itself creates.
1646 * process.c (create_process, record_child_status_change):
1647 Don't use special value -1 in pid field, as the caller now must
1648 know the pid rather than having the callee infer it.
1649 The inference was sometimes incorrect anyway, due to another race.
1650 (create_process): Set new 'alive' member if child is created.
1651 (process_status_retrieved): New function.
1652 (record_child_status_change): Use it.
1653 Accept negative 1st argument, which means to wait for the
1654 processes that Emacs already knows about. Move special-case code
1655 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1656 processes that have already been waited for, by testing and
1657 clearing new 'alive' member.
1658 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1659 now does this internally.
1660 (handle_child_signal): Let record_child_status_change do all
1661 the work, since we do not want to reap all exited child processes,
1662 only the child processes that Emacs itself created.
1663 * process.h (Lisp_Process): New boolean member 'alive'.
1664
1665 Omit duplicate definitions no longer needed with gcc -g3.
1666 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1667 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1668 Define only as macros. There's no longer any need to also define
1669 these symbols as enums or as constants, since we now assume
1670 gcc -g3 when debugging.
1671
1672 2012-11-03 Eli Zaretskii <eliz@gnu.org>
1673
1674 * lisp.mk: Adjust comments to the fact that term/internal is now
1675 loaded from loadup.el.
1676
1677 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1678 (msdos_fatal_signal): New function.
1679 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1680 its argument list.
1681
1682 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1683 for GCC versions before 4.
1684 (emacs_raise): Define to call msdos_fatal_signal.
1685
1686 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1687 iterator when starting in the middle of a display or overlay
1688 string. (Bug#12745)
1689
1690 2012-11-03 Chong Yidong <cyd@gnu.org>
1691
1692 * process.c (wait_reading_process_output): Clean up the last
1693 change.
1694
1695 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1696
1697 * process.c (wait_reading_process_output): Avoid a race condition
1698 with SIGIO delivery (Bug#11536).
1699
1700 2012-11-03 Chong Yidong <cyd@gnu.org>
1701
1702 * buffer.c (cursor_type): Untabify docstring.
1703
1704 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1705
1706 * frame.h (struct frame): Drop can_have_scroll_bars member
1707 which is meaningless for a long time. Adjust comments.
1708 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1709 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1710
1711 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1712
1713 * window.c (decode_next_window_args): Update window arg after
1714 calling decode_live_window and so fix crash reported at
1715 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1716 by Juanma Barranquero <lekktu@gmail.com>.
1717 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1718 * font.c (Ffont_at): Likewise.
1719
1720 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1721
1722 * widget.c (resize_cb): New function.
1723 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1724 (EmacsFrameResize): Check if all is up to date before changing frame
1725 size.
1726
1727 2012-11-02 Eli Zaretskii <eliz@gnu.org>
1728
1729 Implement backtrace output for fatal errors on MS-Windows.
1730 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1731 (BACKTRACE_LIMIT_MAX): New macro.
1732 (w32_backtrace): New function.
1733 (emacs_abort): Use w32_backtrace when the user chooses not to
1734 attach a debugger. Update the text of the abort dialog.
1735
1736 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1737
1738 Window-related stuff cleanup here and there.
1739 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1740 Use decode_any_window.
1741 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1742 * xdisp.c (Fformat_mode_line): Likewise.
1743 * font.c (Ffont_at): Use decode_live_window.
1744 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1745 * window.c (decode_next_window_args): Likewise.
1746 (decode_any_window): Remove static.
1747 * window.h (decode_any_window): Add prototype.
1748 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1749 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1750 respectively.
1751
1752 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1753
1754 Remove pad from struct input_event.
1755 * termhooks.h (struct input_event): Remove padding field.
1756 Adjust comment.
1757 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1758 member is never cons for a long time. Adjust comment.
1759 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1760 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1761 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1762 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1763
1764 2012-11-01 Eli Zaretskii <eliz@gnu.org>
1765
1766 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1767
1768 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1769
1770 Fix crash when using Emacs as commit editor for git (Bug#12697).
1771 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1772 and it is configured in conf_post.h.
1773 (Fcall_process): Don't invoke both setsid and setpgid; the former
1774 is enough, if it exists.
1775 * callproc.c (Fcall_process, child_setup):
1776 * process.c (create_process): Use setpgid.
1777 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1778 for the real thing.
1779 * dispnew.c (init_display): Initialize the foreground group
1780 if we are running a tty display.
1781 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1782 * lisp.h (init_foreground_group): New decl.
1783 * sysdep.c (inherited_pgroup): New static var.
1784 (init_foreground_group, tcsetpgrp_without_stopping)
1785 (narrow_foreground_group, widen_foreground_group): New functions.
1786 (init_sys_modes): Narrow foreground group.
1787 (reset_sys_modes): Widen foreground group.
1788
1789 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
1790
1791 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1792
1793 2012-10-31 Martin Rudalics <rudalics@gmx.at>
1794
1795 * minibuf.c (read_minibuf): Restore current buffer since
1796 choose_minibuf_frame calling Fset_frame_selected_window may
1797 change it (Bug#12766).
1798
1799 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1800
1801 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1802
1803 2012-10-30 Kenichi Handa <handa@gnu.org>
1804
1805 * font.c (Ffont_at): If WINDOW is specified and it is not
1806 displaying the current buffer, signal an error.
1807
1808 2012-10-29 Daniel Colascione <dancol@dancol.org>
1809
1810 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1811 In preparation for fixing bug#12739, move these functions from
1812 here...
1813
1814 * coding.h, coding.c: ... to here, and compile them only when
1815 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1816 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1817
1818 2012-10-28 Eli Zaretskii <eliz@gnu.org>
1819
1820 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1821 (timer_loop, getitimer, setitimer): Use it instead of
1822 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1823 'clock'.
1824 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1825 literal 10000.
1826
1827 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1828
1829 * nsterm.m (NO_APPDEFINED_DATA): New define.
1830 (last_appdefined_event_data): New variable
1831 (last_appdefined_event): Remove.
1832 (ns_select): Initialize t from last_appdefined_event_data instead
1833 of [last_appdefined_event data1].
1834 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1835 remove last_appdefined_event (Bug#12698).
1836
1837 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1838
1839 * frame.c (x_set_font): Catch internal error.
1840
1841 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1842
1843 Avoid overflow in w32 implementation of interval timers.
1844 When possible, for ITIMER_PROF count only times the main thread
1845 actually executes.
1846 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1847 'volatile ULONGLONG' types. All the other data which was
1848 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1849 (GetThreadTimes_Proc): New typedef.
1850 (w32_get_timer_time): New function, returns a suitable time value
1851 for the timer.
1852 (timer_loop): Enter critical section when accessing ULONGLONG
1853 values of the itimer_data struct, as these accesses are no longer
1854 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1855 Remove unused variable.
1856 (init_timers): Initialize s_pfn_Get_Thread_Times.
1857 (start_timer_thread): Don't assign itimer->caller_thread here.
1858 (getitimer): Assign itimer->caller_thread here.
1859 (setitimer): Always call getitimer to get the value of ticks_now.
1860 (sys_spawnve): Avoid compiler warning about format mismatch.
1861
1862 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1863
1864 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1865 mouse movement events if the menu bar is active. This avoids
1866 producing a busy "hour-glass" cursor by Windows if the mouse
1867 pointer is positioned over a tooltip shown for some menu item.
1868
1869 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1870
1871 Don't assume process IDs fit in int.
1872 * emacs.c (shut_down_emacs) [!DOS_NT]:
1873 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1874 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1875 Use pid_t, not int, to store process IDs, as 'int'
1876 is not wide enough on a few platforms (e.g., AIX and IRIX).
1877
1878 2012-10-23 Kenichi Handa <handa@gnu.org>
1879
1880 The following change is to make face-font-rescale-alist work
1881 correctly for non-ASCII fonts.
1882
1883 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1884 (font_open_for_lface): Handle Vface_font_rescale_alist.
1885
1886 2012-10-23 Chong Yidong <cyd@gnu.org>
1887
1888 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1889
1890 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1891
1892 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1893 for screen font.
1894 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1895
1896 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1897 event (Bug#12681).
1898
1899 2012-10-21 Glenn Morris <rgm@gnu.org>
1900
1901 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1902
1903 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1904
1905 Port to OpenBSD 5.1.
1906 * frame.c (Fmouse_position, Fmouse_pixel_position):
1907 * xdisp.c (produce_stretch_glyph):
1908 Declare local vars only when they're needed.
1909 This is clearer and avoids a warning on OpenBSD about unused vars.
1910 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1911 This is safer, and avoids OpenBSD warnings about unused vars.
1912 * keyboard.c (record_menu_key): Remove unnecessary decl.
1913 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1914 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1915 as our definition clashes with OpenBSD's.
1916 * xfaces.c (load_face_colors, check_lface_attrs)
1917 (get_lface_attributes_no_remap, get_lface_attributes)
1918 (lface_fully_specified_p, x_supports_face_attributes_p)
1919 (tty_supports_face_attributes_p, face_fontset, realize_face)
1920 (realize_x_face, realize_tty_face):
1921 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1922 merely Lisp_Object *. This is more informative and avoids
1923 a warning on OpenBSD about accessing beyond an object's size.
1924
1925 2012-10-20 Chong Yidong <cyd@gnu.org>
1926
1927 * lread.c (Fload): Doc fix (Bug#12592).
1928
1929 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1930
1931 * font.c (Ffont_at): Fix previous change.
1932
1933 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1934
1935 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1936 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1937 for the reasons.
1938
1939 * alloc.c (NSTATICS): Decrease to 0x800.
1940
1941 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1942
1943 * fns.c (Fnreverse): Include the problem element when signaling an
1944 error (bug#12677).
1945
1946 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1947
1948 * nsterm.m (ns_select): Check writefds before call to
1949 FD_ISSET (Bug#12668).
1950
1951 2012-10-18 Daniel Colascione <dancol@dancol.org>
1952
1953 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1954 (staticpro): If we run out of staticpro slots, die with an
1955 informative error instead of just calling emacs_abort.
1956
1957 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1958
1959 Fix two flaws reported by Dmitry Antipov.
1960 * window.c (Ftemp_output_buffer_show): Remove.
1961 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1962 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1963
1964 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1965
1966 * makefile.w32-in ($(BLD)/w32.$(O)):
1967 ($(BLD)/vm-limit.$(O)):
1968 ($(BLD)/term.$(O)):
1969 ($(BLD)/unexw32.$(O)):
1970 ($(BLD)/fileio.$(O)):
1971 ($(BLD)/dispnew.$(O)): Update dependencies.
1972
1973 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1974 Add prototypes.
1975
1976 * w32proc.c: Include ctype.h.
1977
1978 * w32.h (init_environment, check_windows_init_file)
1979 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1980 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1981 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1982 (sys_link): Add prototypes.
1983
1984 * w32.c: Include w32select.h.
1985 (sys_access, e_malloc, sys_select): Add prototypes.
1986 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1987
1988 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1989
1990 * unexw32.c: Include lisp.h and w32.h.
1991
1992 * term.c [WINDOWSNT]: Include w32term.h.
1993
1994 * process.c [WINDOWSNT]: Add prototype of sys_select.
1995
1996 * fileio.c [WINDOWSNT]: Include w32.h.
1997
1998 * dispnew.c [WINDOWSNT]: Include w32.h.
1999
2000 * cygw32.c (Fcygwin_convert_path_to_windows)
2001 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
2002 Lisp_Object values. (Bug#12661)
2003
2004 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
2005 to Lisp_Object. (Bug#12661)
2006
2007 2012-10-17 Kenichi Handa <handa@gnu.org>
2008
2009 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
2010 invalidate.
2011
2012 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2013
2014 * buffer.c (Fkill_buffer): When unchaining the marker,
2015 reset its buffer pointer to NULL (Bug#12652).
2016
2017 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2018
2019 Do not verify indirection counters of killed buffers (Bug#12579).
2020 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
2021 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
2022
2023 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2024
2025 * alloc.c (Fmake_byte_code): Fix typo in comment.
2026 * print.c (print_interval): Define as static to match prototype.
2027 * indent.c (disptab_matches_widthtab, recompute_width_table):
2028 Convert to eassert.
2029
2030 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2031
2032 * editfns.c (get_system_name): Remove.
2033 * lisp.h (get_system_name): Remove prototype.
2034 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
2035 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
2036
2037 2012-10-15 Daniel Colascione <dancol@dancol.org>
2038
2039 * dbusbind.c: Add comment explaining reason for previous change.
2040
2041 2012-10-15 Martin Rudalics <rudalics@gmx.at>
2042
2043 * window.c (Fwindow_end): Rewrite check whether cached position
2044 can be used (Bug#12600).
2045 (resize_frame_windows, grow_mini_window, shrink_mini_window):
2046 Set windows_or_buffers_changed.
2047
2048 2012-10-15 Daniel Colascione <dancol@dancol.org>
2049
2050 * dbusbind.c: Fix cygw32 build break when compiling with dbus
2051 enabled by undefining the symbol "interface", which the platform
2052 headers define to something incompatible.
2053
2054 2012-10-14 Daniel Colascione <dancol@dancol.org>
2055
2056 * image.c (init_tiff_functions, init_imagemagick_functions)
2057 (init_svg_functions): Fix cygw32 build break by using these
2058 functions only when WINDOWSNT _and_ HAVE_NTGUI.
2059
2060 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
2061
2062 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
2063
2064 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
2065
2066 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
2067
2068 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
2069
2070 * coding.c (detect_coding): Set coding->id before calling
2071 this->detector.
2072
2073 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
2074
2075 * fileio.c: Formatting fixes.
2076
2077 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
2078
2079 Fix some stat-related races.
2080 * fileio.c (Fwrite_region): Avoid race condition if a file is
2081 removed or renamed by some other process immediately after Emacs
2082 writes it but before Emacs stats it. Do not assume that stat (or
2083 fstat) succeeds.
2084 * image.c (slurp_file): Resolve the file name with fopen + fstat
2085 rather than stat + fopen.
2086 (pbm_read_file) [0]: Remove unused code with stat race.
2087 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
2088 Remove ineffective code with stat race.
2089
2090 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2091
2092 * doc.c (get_doc_string): Don't signal an error if the file is missing.
2093
2094 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2095
2096 * nsterm.m (hold_event_q): New static variable.
2097 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
2098 ! q_event_ptr.
2099 (hold_event): New function.
2100 (ns_read_socket): If hold_event_q have events, store them and
2101 return (Bug#12384).
2102 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
2103 is zero (Bug#12384).
2104
2105 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
2106
2107 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
2108
2109 2012-10-12 Eli Zaretskii <eliz@gnu.org>
2110
2111 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
2112
2113 * fileio.c (check_existing): New function.
2114 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
2115 instead of calling 'stat', when what's needed is to check whether
2116 a file exists. This avoids expensive system calls on MS-Windows.
2117 (Bug#12587)
2118
2119 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
2120
2121 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
2122 determine whether a file exists and is not a directory.
2123
2124 * lisp.h (check_existing): Add prototype.
2125
2126 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2127
2128 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
2129
2130 2012-10-12 Glenn Morris <rgm@gnu.org>
2131
2132 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
2133
2134 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2135
2136 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
2137
2138 * eval.c (Fautoload): Remember previous autoload status in load-history.
2139
2140 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2141
2142 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
2143 * lread.c (load_each_byte, new_backquote_flag, readchar)
2144 (read_filtered_event, lisp_file_lexically_bound_p)
2145 (safe_to_load_version, Fload, complete_filename_p, openp)
2146 (build_load_history, readevalloop, read_escape, read1)
2147 (string_to_number, read_vector, read_list):
2148 * macros.c (Fstart_kbd_macro):
2149 * marker.c (CONSIDER):
2150 * menu.c (parse_single_submenu, digest_single_submenu)
2151 (find_and_return_menu_selection, Fx_popup_menu):
2152 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
2153 (Ftry_completion):
2154 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
2155 (ns_menu_show):
2156 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
2157 (xmenu_show, xdialog_show):
2158 Use bool for booleans.
2159 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
2160 as it's not a predicate. All uses changed. Omit unnecessary
2161 buffer termination.
2162
2163 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2164
2165 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
2166 (save_excursion_restore): Do not restore mark if it was not saved.
2167
2168 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2169
2170 * marker.c (cached_modiff): EMACS_INT, not int.
2171
2172 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
2173 instead of having a wrong decl.
2174 * nsmenu.m (waiting_for_input): Remove wrong decl.
2175
2176 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2177
2178 keyboard.c, keymap.c: Use bool for booleans.
2179 * dispnew.c (sit_for): Distinguish between 3-way display_option
2180 and boolean do_display.
2181 * keyboard.c (single_kboard, this_command_key_count_reset)
2182 (waiting_for_input, echoing, immediate_quit, input_pending)
2183 (interrupt_input, interrupts_deferred, pop_kboard)
2184 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
2185 (command_loop_1, adjust_point_for_property)
2186 (safe_run_hooks_error, input_polling_used, read_char):
2187 (help_char_p, readable_events, kbd_buffer_events_waiting)
2188 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
2189 (lucid_event_type_list_p, get_input_pending):
2190 (gobble_input, menu_separator_name_p, menu_bar_item)
2191 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
2192 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
2193 (keyremap_step, test_undefined, read_key_sequence)
2194 (detect_input_pending, detect_input_pending_ignore_squeezables)
2195 (detect_input_pending_run_timers, requeued_events_pending_p)
2196 (quit_throw_to_read_char, Fset_input_interrupt_mode):
2197 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
2198 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
2199 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
2200 (accessible_keymaps_1, Fkey_description, push_key_description):
2201 (shadow_lookup, struct where_is_internal_data)
2202 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
2203 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
2204 (describe_map, describe_vector):
2205 * menu.c (single_menu_item):
2206 * nsmenu.m (ns_update_menubar):
2207 * process.c (wait_reading_process_output):
2208 * search.c (scan_buffer, scan_newline):
2209 Use bool for boolean.
2210 * keyboard.c (timers_run, swallow_events)
2211 (detect_input_pending_run_timers):
2212 * process.c (wait_reading_process_output):
2213 Use unsigned for counter where wraparound-on-overflow is desired,
2214 since unsigned is guaranteed to have that behavior and signed is not.
2215 (read_char): Use ptrdiff_t for string length.
2216 (get_input_pending): Remove first argument, since it was always
2217 the same pointer-to-int (now pointer-to-boolean) &input_pending,
2218 and behave as if it had that value. Return new value of
2219 input_pending. All callers changed.
2220 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
2221 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
2222 a string length.
2223 * keymap.c (push_key_description): Omit last arg, which was always 1.
2224 All callers changed.
2225
2226 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
2227
2228 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
2229
2230 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
2231 ($(BLD)/term.$(O)): Update dependencies.
2232
2233 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2234
2235 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
2236 * lisp.h (enum pvec_type): Adjust comments and omit explicit
2237 initializer for PVEC_NORMAL_VECTOR.
2238
2239 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2240
2241 Clean out old termopts cruft.
2242 * termopts.h (flow_control, meta_key): Remove unused decls.
2243 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
2244 Don't include termopts.h.
2245
2246 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2247
2248 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2249
2250 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2251
2252 * commands.h (immediate_quit): Remove duplicate decl.
2253
2254 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
2255
2256 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
2257 caching.
2258 (nsfont_open): Remove setting of Vfonts_in_cache.
2259 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
2260
2261 2012-10-09 Eli Zaretskii <eliz@gnu.org>
2262
2263 * w32fns.c (w32_last_error): Change the return value to DWORD, to
2264 match what GetLastError returns. Explain why the function is
2265 needed.
2266
2267 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
2268 'is_tooltip_frame', to avoid confusion with its global namesake.
2269
2270 2012-10-08 Daniel Colascione <dancol@dancol.org>
2271
2272 * xdisp.c (start_hourglass): Call w32_note_current_window when
2273 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
2274 build that caused Emacs to display the hourglass cursor forever.
2275
2276 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
2277 which is broken under remote desktop, calculate the number of
2278 colors available for a display based on the display's number of
2279 planes and number of bits per pixel per plane. (bug#10397).
2280
2281 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
2282
2283 * nsfont.m (Vfonts_in_cache): New variable.
2284 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
2285 are used. Add cached fonts to Vfonts_in_cache.
2286 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
2287
2288 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
2289
2290 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
2291 in nt/config.nt.
2292 (FONT_H): Define after FRAME_H.
2293 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
2294 Update dependencies.
2295
2296 * w32term.c: Remove leftover declaration of keyboard_codepage.
2297
2298 2012-10-08 Eli Zaretskii <eliz@gnu.org>
2299
2300 * makefile.w32-in (FONT_H): Add $(FRAME_H).
2301 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
2302 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
2303 (GLOBAL_SOURCES): Add cygw32.c.
2304 ($(BLD)/unexw32.$(O)):
2305 ($(BLD)/w32.$(O)):
2306 ($(BLD)/w32console.$(O)):
2307 ($(BLD)/w32fns.$(O)):
2308 ($(BLD)/w32heap.$(O)):
2309 ($(BLD)/w32menu.$(O)):
2310 ($(BLD)/w32proc.$(O)): Add w32common.h.
2311
2312 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
2313 'const char *'.
2314 (x_to_w32_color): Don't modify the argument, modify a copy instead.
2315
2316 2012-10-08 Daniel Colascione <dancol@dancol.org>
2317
2318 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
2319 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
2320 accidental message numbering hole. Change other messages to
2321 match.
2322
2323 * w32select.h (HAVE_W32SELECT): Remove.
2324
2325 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
2326 w32common.h instead of w32heap.h.
2327
2328 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
2329 (get_allocation_unit, get_processor_type, get_w32_major_version)
2330 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2331 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2332 (OS_NT, os_subtype, cache_system_info): Move declarations to
2333 w32common.
2334
2335 * w32heap.c: Include w32common.h.
2336 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
2337 (w32_minor_version, w32_build_number, w32_subtype):
2338 Remove duplicate definitions.
2339
2340 * w32fns.c: Include w32common.h; include w32heap.h only in
2341 WINDOWSNT.
2342
2343 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
2344 Use `report_file_error' instead of `error' in order to better
2345 inform users of what went wrong. Increase NTGUI_UNICODE file
2346 dialog box file name length to 32k, the maximum allowed by the NT
2347 kernel.
2348
2349 * w32common.h: New file.
2350 (ROUND_UP, ROUND_DOWN, get_page_size)
2351 (get_allocation_unit, get_processor_type, get_w32_major_version)
2352 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2353 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2354 (OS_NT, os_subtype, cache_system_info): Move here.
2355
2356 * unexw32.c, unexcw.c: Include w32common.h.
2357
2358 * emacs.c (main): Use (defined (WINDOWSNT) || defined
2359 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
2360 to call syms_of_w32select.
2361
2362 * cygw32.h: Remove obsolete EXFUN declarations.
2363
2364 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
2365
2366 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
2367 of w32inevt.o from SOME_MACHINE_OBJECTS.
2368
2369 2012-10-08 Daniel Colascione <dancol@dancol.org>
2370
2371 * image.c: Permanent fix for JPEG compilation issue --- limit
2372 jpeglib `boolean' redefinition to Cygwin builds.
2373
2374 2012-10-08 Eli Zaretskii <eliz@gnu.org>
2375
2376 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
2377
2378 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
2379 Cygwin.
2380
2381 2012-10-08 Daniel Colascione <dancol@dancol.org>
2382
2383 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
2384 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
2385 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
2386 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
2387 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
2388 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
2389 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
2390 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
2391 now a supported configuration.
2392
2393 * Makefile.in: consolidate image variables into LIBIMAGE; add
2394 W32_OBJ and W32_LIBS. Compile new files.
2395
2396 * conf_post.h:
2397 (_DebPrint) declare tracing facility for W32 debugging. We need
2398 to unify tracing later.
2399
2400 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
2401 unconditional use of W32 Unicode functions. Cygwin runs only on
2402 100% Unicode operating systems.
2403
2404 * cygw32.c: New file. Define Cygwin-specific facilities.
2405 (Fcygwin_convert_path_to_windows)
2406 (Fcygwin_convert_path_from_windows): New user functions for
2407 accessing Cygwin path-munging routines.
2408
2409 * cygw32.h: New file.
2410 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
2411 UTF-16LE strings temporarily inside non-Lisp-visible string
2412 objects.
2413
2414 (w32_strerror): Just what it says on the tin.
2415
2416 * emacs.c: Make the NS fork-then-exec code for daemon-launching
2417 also run for Cygwin; both systems have the same problem with using
2418 GUI facilities in a forked child. Also call syms_of_cygw32,
2419 syms_of_w32select in correct places.
2420
2421 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
2422 needs fork-then-exec for daemon launching.
2423
2424 * font.h: Include frame.h.
2425
2426 * image.c: Use the image library cache machinery only when we're
2427 compiling for native WINDOWSNT; Cygwin can use shared libraries
2428 like any other Unixlike system.
2429
2430 * keyboard.c: Clarify a comment regarding the input loop.
2431
2432 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
2433 functions directly instead of trying to detect at runtime that our
2434 host operating system supports them. We make this change for two
2435 reasons: Cygwin lacks support for the multibyte character
2436 conversion functions used by the legacy menu code, and Cygwin
2437 never needs to rely on non-Unicode APIs.
2438
2439 * unexw32.c (hinst): Declare extern.
2440
2441 * w32.c: Change header order;
2442 (w32_strerror): Move to w32fns.c because we need it for
2443 non-WINDOWSNT builds.
2444
2445 * w32.h: Add #error macro to make sure we don't include w32.h for
2446 Cygwin builds. Remove w32select declarations.
2447
2448 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
2449 w32fns.c. w32console.c is WINDOWSNT-only.
2450
2451 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2452 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2453 POSIXy alternative.
2454 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2455 (w32_major_version, w32_minor_version, w32_build_number)
2456 (os_subtype, sound_type): Define here
2457 (w32_defined_color): Make color parameter const for consistency
2458 with other _defined_color functions.
2459 (w32_createwindow): Unconditionally call w32_init_class instead of
2460 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2461 through the code is complex and unnecessary because class
2462 registration is practically free.
2463 (w32_name_of_message): New EMACSDEBUG-only function.
2464 (Fset_message_beep): Move here
2465 (Fx_open_connection): Require that the display name for Windows be
2466 "w32" for consistency, emacsclient disambiguation, and maybe, one
2467 day, multi-window-system support.
2468 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2469 Cygwin files for W32 GUI facilities, since these clearly don't
2470 expect Cygwin names.
2471 (_DebPrint): Define.
2472 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2473 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2474 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2475 (w32_last_error): Remove.
2476
2477 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
2478
2479 * w32heap.c (syspage_mask): Declare here.
2480 (cache_system_info): Remove.
2481
2482 * w32inevt.c (faked_key): Define globally, not statically.
2483 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2484 (w32_console_toggle_lock_key): Move to w32fns.c.
2485
2486 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2487
2488 * w32proc.c (_DebPrint): Move to w32fns.c.
2489 * w32select.c: Include string.h, stdio.h for Cygwin.
2490 * w32select.h: New File.
2491
2492 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2493 get_osfhandle.
2494 (w32_message_fd): New variable. Under Cygwin, holds the file
2495 descriptor the system used to tell us about pending thread
2496 messages.
2497
2498 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2499 that prevented compilation under non-WINDOWSNT systems.
2500
2501 (w32_initialize): Open /dev/windows and assign it to
2502 w32_message_fd. Provide w32 feature.
2503
2504 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2505 (WM_EMACS_INPUT_READY): add.
2506 (prepend_msg, w32_message_fd): Declare globally.
2507
2508 * w32xfns.c:
2509 (keyboard_handle): Use only when WINDOWSNT.
2510 (notify_msg_ready): New function. Posts a message to the main
2511 thread's message queue under CYGWIN, which wakes up the main
2512 thread from select(2) by making the /dev/windows file descriptor
2513 ready. Under WINDOWSNT, it sets an event the same way the old
2514 code did.
2515
2516 (post, prepend_msg): Actually call notify_msg_ready instead of
2517 setting the input event directly.
2518
2519 2012-10-07 Eli Zaretskii <eliz@gnu.org>
2520
2521 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2522 but it still has blocs in it, don't return it to the system,
2523 instead of aborting. (Bug#12402)
2524
2525 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2526
2527 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
2528
2529 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2530 MAC_OS_X_VERSION_10_6.
2531 (syms_of_nsterm): Remove comment about Panther and above for
2532 ns-antialias-text.
2533 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2534 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2535 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2536
2537 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2538 MAC_OS_X_VERSION_10_4.
2539
2540 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2541 MAC_OS_X_VERSION_10_2.
2542
2543 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2544
2545 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2546 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2547
2548 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2549 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
2550 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2551 Remove ns_in_resize check.
2552 (ns_clear_frame_area): Remove resize handle code.
2553
2554 * nsfns.m (ns_in_resize): Remove.
2555 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2556 Remove ns_in_resize check.
2557
2558 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2559
2560 Improve sys_siglist detection.
2561 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2562 defined as a macro, as is done in Solaris.
2563 (sys_siglist_entries): New macro.
2564 (save_strsignal): Use it.
2565 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2566 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2567
2568 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2569
2570 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2571 fullscreen/Fullscreen.
2572
2573 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2574 tobar_height is new.
2575
2576 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2577 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2578 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2579 (windowDidResize:): Check for correct window if old style fullscreen.
2580 Capitalize word in comment. Remove incorrect comment.
2581 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2582 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2583 error in drawing background.
2584 (toggleFullScreen:): Remove comment. Rearrange calls.
2585 Set toolbar values to zero, save old height in tobar_height.
2586 Restore tool bar height when leaving fullscreen.
2587 (canBecomeMainWindow): New function.
2588
2589 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2590
2591 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2592
2593 2012-10-05 Eli Zaretskii <eliz@gnu.org>
2594
2595 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2596
2597 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
2598 that time stamps of directories could also be changed.
2599 Don't request the too broad GENERIC_WRITE, only the more restrictive
2600 FILE_WRITE_ATTRIBUTES access rights.
2601
2602 * fileio.c (Fset_file_times): Special-case ignoring errors for
2603 directories only on MSDOS, not on MS-Windows.
2604
2605 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
2606
2607 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2608
2609 2012-10-04 Eli Zaretskii <eliz@gnu.org>
2610
2611 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2612 see whether CreateFile failed.
2613
2614 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2615
2616 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2617 to avoid similar races.
2618 * keyboard.c (pending_signals): Now bool, not int.
2619
2620 Port timers to OpenBSD, plus check for timer failures.
2621 OpenBSD problem reported by Han Boetes.
2622 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2623 and/or setitimer.
2624 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2625 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2626 like OpenBSD, which has timer_settime but does not declare it.
2627 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2628 whether to use itimerspec-related primitives. All uses of
2629 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2630
2631 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2632
2633 * profiler.c (handle_profiler_signal): Fix a malloc race
2634 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2635
2636 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2637
2638 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2639
2640 2012-10-02 Eli Zaretskii <eliz@gnu.org>
2641
2642 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2643 consistent with the change in return value of 'safe_strsignal'.
2644
2645 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2646
2647 Prefer plain 'static' to 'static inline' (Bug#12541).
2648 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2649 (bidi_set_sor_type, bidi_push_embedding_level)
2650 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2651 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2652 (bidi_cache_search, bidi_cache_ensure_space)
2653 (bidi_cache_iterator_state, bidi_cache_find)
2654 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2655 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2656 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2657 Now 'static', not 'static inline'.
2658
2659 Count overruns when profiling; change units to ns.
2660 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2661 Give extra weight to samples after overruns, to attempt to count
2662 the time more accurately.
2663 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2664 the underlying primitives nominally do ns.
2665 (Fprofiler_cpu_start): Document the change. Mention that
2666 the sampling intervals are only approximate.
2667
2668 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2669
2670 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2671
2672 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2673 case for the special 0 coding-system.
2674
2675 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2676 (Fmake_overlay): Remove redundant tests.
2677 (fix_start_end_in_overlays): Remove redundant recentering.
2678
2679 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
2680
2681 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2682 Update dependencies.
2683
2684 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2685
2686 Fix a malloc race condition involving strsignal.
2687 A signal can arrive in the middle of a malloc, and Emacs's signal
2688 handler can invoke strsignal, which can invoke malloc, which is
2689 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2690 Fix it by altering the signal handler so that it does not invoke
2691 strsignal.
2692 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2693 * process.c (status_message): Use const pointer, in case strsignal
2694 is #defined to safe_strsignal.
2695 * sysdep.c (sys_siglist, init_signals): Always define and
2696 initialize a substitute sys_siglist if the system does not define
2697 one, even if HAVE_STRSIGNAL.
2698 (safe_strsignal): Rename from strsignal. Always define,
2699 using sys_siglist. Return a const pointer.
2700 * syssignal.h (safe_strsignal): New decl.
2701 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2702
2703 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2704
2705 * w32proc.c (timer_loop): Fix code that waits for timer
2706 expiration, to avoid high CPU usage.
2707
2708 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2709
2710 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2711 (sweep_weak_table): Remove redundant prototypes.
2712
2713 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2714
2715 * emacs.c: Move the inclusion of TERM_HEADER after including
2716 windows.h on WINDOWSNT. This avoids compilation problems with
2717 MSVC.
2718
2719 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2720
2721 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2722 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2723 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2724 as the previous version used 'void *'.
2725
2726 * ralloc.c (ROUNDUP): Fix last change.
2727 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2728 'size_t'.
2729
2730 * w32proc.c <disable_itimers>: New static flag.
2731 (init_timers): Initialize it to zero, after creating the critical
2732 sections used by the timer threads.
2733 (term_timers): Set to 1 before deleting the critical sections.
2734 (getitimer, setitimer): If disable_itimers is non-zero, return an
2735 error indication without doing anything. Reported by Fabrice
2736 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2737 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2738 return results.
2739 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2740 support timers.
2741
2742 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2743 term_ntproc after all the other bookkeeping, to get timers working
2744 as long as possible.
2745
2746 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2747
2748 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2749 Suggested by Juri Linkov in
2750 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2751
2752 Prefer plain 'static' to 'static inline' (Bug#12541).
2753 With static functions, modern compilers inline pretty well by
2754 themselves; advice from programmers often hurts as much as it helps.
2755 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2756 this change shrinks the text size of the Emacs executable by 1.1%
2757 without affecting CPU significantly in my benchmark.
2758 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2759 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2760 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2761 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2762 (bset_auto_fill_function, bset_auto_save_file_format)
2763 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2764 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2765 (bset_cache_long_line_scans, bset_case_fold_search)
2766 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2767 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2768 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2769 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2770 (bset_header_line_format, bset_indicate_buffer_boundaries)
2771 (bset_indicate_empty_lines, bset_invisibility_spec)
2772 (bset_left_fringe_width, bset_major_mode, bset_mark)
2773 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2774 (bset_name, bset_overwrite_mode, bset_pt_marker)
2775 (bset_right_fringe_width, bset_save_length)
2776 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2777 (bset_scroll_up_aggressively, bset_selective_display)
2778 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2779 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2780 (set_buffer_overlays_after):
2781 * category.c (bset_category_table):
2782 * charset.c (read_hex):
2783 * coding.c (produce_composition, produce_charset)
2784 (handle_composition_annotation, handle_charset_annotation)
2785 (char_encodable_p):
2786 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2787 (assign_row, set_frame_matrix_frame, make_current)
2788 (add_row_entry):
2789 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2790 * fns.c (maybe_resize_hash_table):
2791 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2792 * gmalloc.c (register_heapinfo):
2793 * image.c (lookup_image_type):
2794 * intervals.c (set_interval_object, set_interval_left)
2795 (set_interval_right, copy_interval_parent, rotate_right)
2796 (rotate_left, balance_possible_root_interval):
2797 * keyboard.c (kset_echo_string, kset_kbd_queue)
2798 (kset_keyboard_translate_table, kset_last_prefix_arg)
2799 (kset_last_repeatable_command, kset_local_function_key_map)
2800 (kset_overriding_terminal_local_map, kset_real_last_command)
2801 (kset_system_key_syms, clear_event, set_prop):
2802 * lread.c (digit_to_number):
2803 * marker.c (attach_marker, live_buffer, set_marker_internal):
2804 * nsterm.m (ns_compute_glyph_string_overhangs):
2805 * process.c (pset_buffer, pset_command)
2806 (pset_decode_coding_system, pset_decoding_buf)
2807 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2808 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2809 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2810 * syntax.c (bset_syntax_table, dec_bytepos):
2811 * terminal.c (tset_param_alist):
2812 * textprop.c (interval_has_some_properties)
2813 (interval_has_some_properties_list):
2814 * window.c (wset_combination_limit, wset_dedicated)
2815 (wset_display_table, wset_hchild, wset_left_fringe_width)
2816 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2817 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2818 (wset_right_fringe_width, wset_right_margin_cols)
2819 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2820 (wset_vertical_scroll_bar_type, wset_window_parameters):
2821 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2822 (wset_column_number_displayed, wset_region_showing)
2823 (window_box_edges, run_window_scroll_functions)
2824 (append_glyph_string_lists, prepend_glyph_string_lists)
2825 (append_glyph_string, set_glyph_string_background_width)
2826 (append_glyph, append_composite_glyph)
2827 (take_vertical_position_into_account):
2828 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2829 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2830 (lface_hash, lface_same_font_attributes_p, lookup_face):
2831 * xml.c (libxml2_loaded_p):
2832 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2833 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2834 Now 'static', not 'static inline'.
2835
2836 * bidi.c: Tune.
2837 (bidi_copy_it): Do the whole copy with a single memcpy.
2838 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2839
2840 Revert the FOLLOW-SYMLINKS change for file-attributes.
2841 Doing it right would require several changes to Tramp, and there's
2842 not enough time to get that tested before the freeze today.
2843 * dired.c (directory_files_internal, Ffile_attributes):
2844 Undo last change.
2845
2846 * frame.c (x_report_frame_params): Port better to wider ints.
2847 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2848 or that pointers can be printed in 15 decimal digits.
2849 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2850
2851 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2852
2853 Support x64 build on MS-Windows.
2854 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2855 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2856 compatibility with x64.
2857 (x_get_focus_frame): Add prototype.
2858
2859 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2860 defining an XRectangle structure.
2861
2862 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2863 arithmetics for compatibility with x64.
2864
2865 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2866 compatibility with x64.
2867
2868 * w32heap.h: Adjust prototypes and declarations.
2869
2870 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2871 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2872 DWORD, long, and unsigned long, for compatibility with x64.
2873 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2874 (sbrk): Argument is now of type ptrdiff_t.
2875
2876 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2877 less than 0x0500.
2878 (w32_msg_pump): Use WPARAM type for 'result'.
2879
2880 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2881 architecture.
2882 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2883 compatibility with x64.
2884
2885 * vm-limit.c (lim_data): Now size_t.
2886 (check_memory_limits): Adjust prototypes of real_morecore and
2887 __morecore to receive argument of type ptrdiff_t. Use size_t for
2888 five_percent and data_size.
2889
2890 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2891 variables, for compatibility with x64.
2892 (rva_to_section, offset_to_section, relocate_offset)
2893 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2894 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2895 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2896 for compatibility with x64.
2897
2898 * sysdep.c (STDERR_FILENO): Define if not already defined.
2899
2900 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2901 (__morecore): Argument type is now ptrdiff_t.
2902 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2903 (relinquish): Use ptrdiff_t type for 'excess'.
2904 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2905
2906 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2907 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2908 instead of a literal number.
2909
2910 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2911 (min): Define only if not already defined.
2912
2913 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2914 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2915 hosts.
2916
2917 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2918 'bitmaps' is a pointer.
2919
2920 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2921
2922 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2923
2924 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2925
2926 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2927 * dired.c (directory_files_internal, Ffile_attributes):
2928 New arg follow_symlinks. All uses changed.
2929
2930 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2931
2932 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2933
2934 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2935
2936 Support atimers and CPU profiler via profile.c on MS-Windows.
2937 * w32proc.c (sig_mask, crit_sig): New static variables.
2938 (sys_signal): Support SIGALRM and SIGPROF.
2939 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2940 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2941 sigfillset, and sigprocmask are no longer no-ops.
2942 (sigismember): New function.
2943 (struct itimer_data): New definition.
2944 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2945 (crit_prof): New static variables.
2946 (MAX_SINGLE_SLEEP): New definition.
2947 (timer_loop, stop_timer_thread, term_timers, init_timers)
2948 (start_timer_thread, getitimer, setitimer): New functions.
2949 (alarm): No longer a no-op, calls setitimer.
2950
2951 * w32.c (term_ntproc): Call term_timers.
2952 (init_ntproc): Make sure all signals are unblocked at startup, to
2953 erase any traces of dumping. Call init_timers.
2954
2955 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2956 Windows-specific code to display the hourglass mouse pointer is no
2957 longer used.
2958 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2959 to hourglass timer expiration.
2960 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2961 Remove, no longer used.
2962 (w32_note_current_window, show_hourglass, hide_hourglass):
2963 New functions, in support of hourglass cursor display similar to other
2964 window systems.
2965 (syms_of_w32fns): Don't initialize hourglass_timer.
2966
2967 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2968 WINDOWSNT as well.
2969 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2970
2971 * w32.h (init_timers, term_timers): Add prototypes.
2972
2973 2012-09-30 Kenichi Handa <handa@gnu.org>
2974
2975 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2976 to the buffer relocation which may be caused by ccl_driver.
2977
2978 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2979
2980 * xfns.c (Fx_file_dialog): Update comment.
2981
2982 * w32fns.c (Fx_file_dialog): Update comment.
2983
2984 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2985 Initialize panel name field if OSX >= 10.6.
2986
2987 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2988
2989 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2990
2991 * nsterm.m (NEW_STYLE_FS): New define.
2992 (ns_fullscreen_hook, windowWillEnterFullScreen)
2993 (windowDidEnterFullScreen, windowWillExitFullScreen)
2994 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2995 (setFSValue): New functions.
2996 (EmacsFSWindow): New implementation.
2997 (canBecomeKeyWindow): New function for EmacsFSWindow.
2998 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2999 (dealloc): Release nonfs_window if in fullscreen.
3000 (updateFrameSize:): Call windowDidMove to update top/left.
3001 (windowWillResize:toSize:): Check if frame is still maximized.
3002 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
3003 next_maximized, maximized_width, maximized_height and nonfs_window.
3004 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
3005 tbar_height.
3006 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
3007 fullscreen. Set maximized_width/height. Act on next_maximized.
3008
3009 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
3010 (EmacsView): Add variables for fullscreen.
3011 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
3012 (EmacsFSWindow): New interface for fullscreen.
3013
3014 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
3015
3016 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3017
3018 2012-09-30 Chong Yidong <cyd@gnu.org>
3019
3020 * fns.c (Frandom): Doc fix.
3021
3022 2012-09-30 Martin Rudalics <rudalics@gmx.at>
3023
3024 * window.c (Vwindow_combination_limit): New default value.
3025 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
3026
3027 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3028
3029 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
3030 Suggested by Eli Zaretskii in
3031 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
3032
3033 2012-09-30 Eli Zaretskii <eliz@gnu.org>
3034
3035 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
3036 HAVE_TIMER_SETTIME is defined.
3037
3038 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3039
3040 Profiler improvements: more-accurate timers, overflow checks.
3041 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
3042 signal.h, setjmp.h. Include systime.h instead.
3043 (saturated_add): New function.
3044 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
3045 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
3046 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
3047 New static vars.
3048 (enum profiler_cpu_running): New enum.
3049 (profiler_cpu_running): Now of that enum type, not bool.
3050 All uses changed to store the new value.
3051 (handle_profiler_signal): Rename from sigprof_handler_1,
3052 for consistency with other handlers. Do not check whether
3053 cpu_log is a hash-table if garbage collecting, since it
3054 doesn't matter in that case.
3055 (deliver_profiler_signal): Rename from sigprof_handler,
3056 for consistency with other handlers.
3057 (setup_cpu_timer): New function, with much of what used to be in
3058 Fprofiler_cpu_start. Check for out-of-range argument.
3059 Prefer timer_settime if available, and prefer
3060 thread cputime clocks, then process cputime clocks, then
3061 monotonic clocks, to the old realtime clock. Use make_timeval
3062 to round more-correctly when falling back to setitimer.
3063 (Fprofiler_cpu_start): Use it.
3064 (Fprofiler_cpu_stop): Prefer timer_settime if available.
3065 Don't assume that passing NULL as the 2nd argument of setitimer
3066 is the same as passing a pointer to all-zero storage.
3067 Ignore SIGPROF afterwards.
3068 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
3069 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
3070 non-fatal signal handlers. Ignore SIGPROF on startup.
3071 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
3072 in profiler.c, since sysdep.c now uses it.
3073
3074 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
3075 Suggested by Eli Zaretskii in
3076 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3077
3078 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
3079
3080 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3081
3082 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
3083
3084 * lisp.h (struct backtrace): Remove indirection for `function' field.
3085 * xdisp.c (redisplay_internal):
3086 * profiler.c (record_backtrace, sigprof_handler_1):
3087 * alloc.c (Fgarbage_collect):
3088 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
3089 (Fbacktrace_frame): Adjust accordingly.
3090
3091 2012-09-28 Glenn Morris <rgm@gnu.org>
3092
3093 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
3094 (Frun_hook_with_args_until_failure): Doc fixes.
3095
3096 2012-09-28 Eli Zaretskii <eliz@gnu.org>
3097
3098 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
3099 Qautomatic_redisplay and change the symbol name. All users changed.
3100
3101 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
3102
3103 * profiler.c (sigprof_handler): Fix race condition.
3104
3105 2012-09-28 Glenn Morris <rgm@gnu.org>
3106
3107 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
3108
3109 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
3110
3111 Check more robustly for timer_settime.
3112 * Makefile.in (LIB_TIMER_TIME): New macro.
3113 (LIBES): Add it.
3114 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
3115 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
3116 call timer_settime.
3117
3118 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3119
3120 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
3121
3122 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
3123
3124 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3125
3126 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
3127
3128 * character.h (MAYBE_UNIFY_CHAR): Remove.
3129 * charset.c, charset.h (maybe_unify_char): Now static.
3130 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
3131 Since this stuff is now private to charset.c, there's no need for
3132 a public macro and no need to inline by hand.
3133
3134 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3135 Stefan Monnier <monnier@iro.umontreal.ca>
3136 Juanma Barranquero <lekktu@gmail.com>
3137
3138 * profiler.c: New file.
3139 * Makefile.in (base_obj): Add profiler.o.
3140 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
3141 ($(BLD)/profiler.$(O)): New target.
3142 * emacs.c (main): Call syms_of_profiler.
3143 * alloc.c (Qautomatic_gc): New constant.
3144 (MALLOC_PROBE): New macro.
3145 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
3146 (total_bytes_of_live_objects): New function.
3147 (Fgarbage_collect): Use it. Record itself in backtrace_list.
3148 Call malloc_probe for the memory profiler.
3149 (syms_of_alloc): Define Qautomatic_gc.
3150 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
3151 race condition.
3152 (struct backtrace): Move definition...
3153 * lisp.h (struct backtrace): ..here.
3154 (Qautomatic_gc, profiler_memory_running): Declare vars.
3155 (malloc_probe, syms_of_profiler): Declare functions.
3156 * xdisp.c (Qautomatic_redisplay): New constant.
3157 (redisplay_internal): Record itself in backtrace_list.
3158 (syms_of_xdisp): Define Qautomatic_redisplay.
3159
3160 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3161 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
3162
3163 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
3164
3165 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
3166
3167 Prefer POSIX timers if available.
3168 They avoid a race if the timer is too close to the current time.
3169 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
3170 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
3171 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
3172
3173 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3174
3175 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
3176 CHAR_STRING_ADVANCE.
3177 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
3178 STRING_CHAR_ADVANCE.
3179
3180 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
3181
3182 Move Vlibrary_cache to emacs.c and reset before dumping.
3183
3184 * lisp.h (reset_image_types): Declare.
3185 [WINDOWSNT] (Vlibrary_cache): Declare.
3186
3187 * image.c (reset_image_types): New function.
3188
3189 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
3190 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
3191 (Fdump_emacs): Reset Vlibrary_cache and image_types.
3192
3193 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
3194 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
3195
3196 * w32.h (Vlibrary_cache): Do not declare.
3197
3198 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3199
3200 * w32proc.c (sys_signal): Handle all signals defined by the
3201 MS-Windows runtime, not just SIGCHLD. Actually install the signal
3202 handlers for signals supported by Windows. Don't override
3203 term_ntproc as the handler for SIGABRT.
3204 (sigaction): Rewrite to call sys_signal instead of duplicating its
3205 code.
3206 (sys_kill): Improve commentary.
3207
3208 * w32.c (term_ntproc): Accept (and ignore) one argument, for
3209 consistency with a signature of a signal handler. All callers
3210 changed.
3211 (init_ntproc): Accept an argument DUMPING. If dumping, don't
3212 install term_ntproc as a signal handler for SIGABRT, as that
3213 should be done by the dumped Emacs.
3214
3215 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
3216
3217 * w32select.c (term_w32select): Protect against repeated
3218 invocation by setting clipboard_owner to NULL after calling
3219 DestroyWindow.
3220
3221 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
3222 and term_ntproc to their modified signatures.
3223
3224 * character.c (char_string, string_char): Remove calls to
3225 MAYBE_UNIFY_CHAR. See the discussion starting at
3226 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
3227 for the details.
3228
3229 2012-09-25 Chong Yidong <cyd@gnu.org>
3230
3231 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
3232
3233 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
3234
3235 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
3236 when encountering an unknown bytecode.
3237
3238 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
3239
3240 image.c, indent.c: Use bool for booleans.
3241 * dispextern.h (struct image_type): Members valid_p, load, init
3242 now return bool, not int. All uses changed.
3243 * image.c: Omit unnecessary static decls.
3244 (x_create_bitmap_mask, x_build_heuristic_mask):
3245 Return void, not int, since callers don't care about the return value.
3246 (x_create_bitmap_mask, define_image_type, valid_image_p)
3247 (struct image_keyword, parse_image_spec, image_spec_value)
3248 (check_image_size, image_background)
3249 (image_background_transparent, x_clear_image_1)
3250 (postprocess_image, lookup_image, x_check_image_size)
3251 (x_create_x_image_and_pixmap, xbm_image_p)
3252 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
3253 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
3254 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
3255 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
3256 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
3257 (png_image_p, init_png_functions, png_load_body, png_load)
3258 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
3259 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
3260 (init_gif_functions, gif_load, imagemagick_image_p)
3261 (imagemagick_load_image, imagemagick_load, svg_image_p)
3262 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
3263 (gs_load):
3264 * nsimage.m (ns_load_image):
3265 * nsterm.m (ns_defined_color):
3266 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
3267 * xfns.c (x_defined_color):
3268 * xterm.c (x_alloc_lighter_color_for_widget)
3269 (x_alloc_nearest_color_1, x_alloc_nearest_color)
3270 (x_alloc_lighter_color):
3271 * indent.c (disptab_matches_widthtab, current_column)
3272 (scan_for_column, string_display_width, indented_beyond_p)
3273 (compute_motion, vmotion, Fvertical_motion):
3274 Use bool for booleans.
3275
3276 2012-09-24 Chong Yidong <cyd@gnu.org>
3277
3278 * chartab.c (Fset_char_table_default): Obsolete function removed.
3279
3280 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 Move pid_t related decls out of lisp.h.
3283 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
3284 (interruptible_wait_for_termination):
3285 Move these decls from lisp.h to syswait.h, since they use pid_t.
3286 Needed on FreeBSD; see Herbert J. Skuhra in
3287 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
3288 * callproc.c: Include syswait.h.
3289
3290 gnutls.c, gtkutil.c: Use bool for boolean.
3291 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
3292 (emacs_gnutls_handle_error):
3293 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
3294 (xg_hide_tooltip, xg_create_frame_widgets)
3295 (create_dialog, xg_uses_old_file_dialog)
3296 (xg_get_file_with_chooser, xg_get_file_with_selection)
3297 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
3298 (xg_item_label_same_p, xg_update_menubar)
3299 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
3300 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
3301 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
3302 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
3303 (update_frame_tool_bar, free_frame_tool_bar):
3304 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
3305 * nsmenu.m (ns_update_menubar):
3306 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
3307 * xfns.c (Fx_show_tip) [USE_GTK]:
3308 Use bool for boolean.
3309 * gtkutil.c (xg_update_frame_menubar):
3310 * xmenu.c (update_frame_menubar):
3311 Return void, not int, since caller ignores return value.
3312 * gtkutil.c (xg_change_toolbar_position):
3313 Return void, not 1.
3314
3315 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
3316
3317 * makefile.w32-in (BLOCKINPUT_H): Remove.
3318 (SYSSIGNAL_H): New macro.
3319 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
3320 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
3321 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
3322 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
3323 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
3324 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
3325 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
3326 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
3327 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
3328 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
3329 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
3330 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
3331 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
3332 ($(BLD)/w32xfns.$(O)): Update dependencies.
3333
3334 2012-09-23 Eli Zaretskii <eliz@gnu.org>
3335
3336 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
3337 fatal_error_backtrace.
3338
3339 * w32proc.c (sys_kill): Undo last change: don't do anything when
3340 invoked to deliver SIGABRT to our own process. This is now
3341 handled by emacs_raise.
3342
3343 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
3344
3345 * w32term.c (w32_read_socket): Remove leftover reference to
3346 interrupt_input_pending.
3347
3348 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3349
3350 Do not use SA_NODEFER.
3351 Problem reported by Dani Moncayo in
3352 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
3353 * alloc.c (die):
3354 * sysdep.c (emacs_abort): Do not reset signal handler.
3355 * emacs.c (terminate_due_to_signal): Reset signal handler here.
3356 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
3357 wanted even on POSIXish hosts, and it doesn't work on Windows.
3358
3359 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3360
3361 * xterm.c (x_term_init): Call fixup_locale before and after calling
3362 gtk_init (Bug#12392).
3363
3364 2012-09-23 Chong Yidong <cyd@gnu.org>
3365
3366 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
3367 Vdynamic_library_alist.
3368
3369 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
3370 (Fgnutls_available_p): Caller changed.
3371
3372 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
3373 (Flibxml_parse_xml_region): Likewise.
3374
3375 * dispextern.h (struct image_type): Remove arg from init function.
3376
3377 * image.c (Finit_image_library, lookup_image_type)
3378 (define_image_type): Remove now-unneeded second arg.
3379 (init_xpm_functions, init_png_functions, init_jpeg_functions)
3380 (init_tiff_functions, init_gif_functions, init_svg_functions):
3381 Arglist and w32_delayed_load calling convention changed.
3382 (gs_type): Remove init_gs_functions; there is no such function.
3383 (valid_image_p, make_image): Fix caller to lookup_image_type.
3384
3385 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3386
3387 Simplify and avoid signal-handling races (Bug#12471).
3388 * alloc.c (die):
3389 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
3390 Avoid recursive loop if there's a fatal error in the function itself.
3391 * atimer.c (pending_atimers):
3392 * blockinput.h: Don't include "atimer.h"; no longer needed.
3393 (interrupt_input_pending): Remove. All uses removed.
3394 pending_signals now counts both atimers and ordinary interrupts.
3395 This is less racy than having three separate pending-signal flags.
3396 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
3397 (input_blocked_p):
3398 Rename from their upper-case counterparts BLOCK_INPUT,
3399 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
3400 INPUT_BLOCKED_P, and turn into functions. All uses changed.
3401 This makes it easier to access volatile variables more accurately.
3402 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
3403 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
3404 that's more reliable if the code is buggy and sets
3405 interrupt_input_blocked to a negative value. All uses changed.
3406 * atimer.c (deliver_alarm_signal):
3407 Remove. No need to deliver this to the parent; any thread can
3408 handle this signal now. All uses replaced by underlying handler.
3409 * atimer.c (turn_on_atimers):
3410 * dispnew.c (handle_window_change_signal):
3411 * emacs.c (handle_danger_signal):
3412 * keyboard.c (kbd_buffer_get_event):
3413 Don't reestablish signal handler; not needed with sigaction.
3414 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
3415 (UNBLOCK_INPUT_TO):
3416 Rework to avoid unnecessary accesses to volatile variables.
3417 (UNBLOCK_INPUT_TO): Now a function.
3418 (totally_unblock_input, unblock_input): New decls.
3419 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
3420 (init_data): Remove. Necessary stuff now done in init_signal.
3421 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
3422 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
3423 (fatal_error_code): Remove; no longer needed.
3424 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
3425 it doesn't always backtrace. All uses changed. No need to reset
3426 signal to default, since sigaction and/or die does that for us now.
3427 Use emacs_raise (FOO), not kill (getpid (), FOO).
3428 (main): Check more-accurately whether we're dumping.
3429 Move fatal-error setup to sysdep.c
3430 * floatfns.c: Do not include "syssignal.h"; no longer needed.
3431 * gtkutil.c (xg_get_file_name, xg_get_font):
3432 Remove no-longer-needed signal-mask manipulation.
3433 * keyboard.c, process.c (POLL_FOR_INPUT):
3434 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
3435 * keyboard.c (read_avail_input): Remove.
3436 All uses replaced by gobble_input.
3437 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
3438 (kbd_buffer_store_event_hold, gobble_input):
3439 (record_asynch_buffer_change) [USABLE_SIGIO]:
3440 (store_user_signal_events):
3441 No need to mess with signal mask.
3442 (gobble_input): If blocking input and there are terminals, simply
3443 set pending_signals to 1 and return. All hooks changed to not
3444 worry about whether input is blocked.
3445 (process_pending_signals): Clear pending_signals before processing
3446 them, in case a signal comes in while we're processing.
3447 By convention callers now test pending_signals before calling us.
3448 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3449 New functions, to support changes to blockinput.h.
3450 (handle_input_available_signal): Now extern.
3451 (reinvoke_input_signal): Remove. All uses replaced by
3452 handle_async_input.
3453 (quit_count): Now volatile, since a signal handler uses it.
3454 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3455 All callers changed. Block SIGINT only if not already blocked.
3456 Clear sigmask reliably, even if Fsignal returns, which it can.
3457 Omit unnecessary accesses to volatile var.
3458 (quit_throw_to_read_char): No need to restore sigmask.
3459 * keyboard.c (gobble_input, handle_user_signal):
3460 * process.c (wait_reading_process_output):
3461 Call signal-handling code rather than killing ourselves.
3462 * lisp.h: Include <float.h>, for...
3463 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3464 (pending_signals): Now volatile.
3465 (syms_of_data): Now const if IEEE floating point.
3466 (handle_input_available_signal) [USABLE_SIGIO]:
3467 (terminate_due_to_signal, record_child_status_change): New decls.
3468 * process.c (create_process): Avoid disaster if memory is exhausted
3469 while we're processing a vfork, by tightening the critical section
3470 around the vfork.
3471 (send_process_frame, process_sent_to, handle_pipe_signal)
3472 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3473 ignores SIGPIPE.
3474 (send_process): No need for setjmp/longjmp any more, since the
3475 SIGPIPE stuff is now gone. Instead, report an error if errno
3476 is EPIPE.
3477 (record_child_status_change): Now extern. PID and W are now args.
3478 Return void, not bool. All callers changed.
3479 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3480 Remove. All uses removed. This bug should be fixed now in a
3481 different way.
3482 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3483 and record the child status change directly. This avoids the
3484 need to futz with the signal mask.
3485 (process_fatal_action): Move here from emacs.c.
3486 (emacs_sigaction_flags): New function, containing
3487 much of what used to be in emacs_sigaction_init.
3488 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3489 caught by emacs, to make races less likely.
3490 (deliver_process_signal): Rename from handle_on_main_thread.
3491 All uses changed.
3492 (BACKTRACE_LIMIT_MAX): Now at top level.
3493 (thread_backtrace_buffer, threadback_backtrace_pointers):
3494 New static vars.
3495 (deliver_thread_signal, deliver_fatal_thread_signal):
3496 New functions, for more-accurate delivery of thread-specific signals.
3497 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3498 (deliver_arith_signal): Handle in this thread, not
3499 in the main thread, since it's triggered by this thread.
3500 (maybe_fatal_sig): New function.
3501 (init_signals): New arg DUMPING so that we can be more accurate
3502 about whether we're dumping. Caller changed.
3503 Treat thread-specific signals differently from process-general signals.
3504 Block all signals while handling fatal error; that's safer.
3505 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3506 on IEEE hosts.
3507 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3508 Ignore SIGPIPE unless batch.
3509 (emacs_backtrace): Output backtrace for the appropriate thread,
3510 which is not necessarily the main thread.
3511 * syssignal.h: Include <stdbool.h>.
3512 (emacs_raise): New macro.
3513 * xterm.c (x_connection_signal): Remove; no longer needed
3514 now that we use sigaction.
3515 (x_connection_closed): No need to mess with sigmask now.
3516 (x_initialize): No need to reset SIGPIPE handler here, since
3517 init_signals does this for us now.
3518
3519 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3520
3521 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
3522 background rect may be larger (Bug#12245).
3523
3524 2012-09-23 Chong Yidong <cyd@gnu.org>
3525
3526 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3527
3528 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3529
3530 * .gdbinit: Just stop at fatal_error_backtrace.
3531 See Stefan Monnier's request in
3532 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3533 Remove no-longer-used query of system type.
3534
3535 2012-09-22 Chong Yidong <cyd@gnu.org>
3536
3537 * search.c (Freplace_match): Doc fix (Bug#12325).
3538
3539 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3540
3541 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3542 (Fline_end_position): Doc fix.
3543
3544 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3545
3546 2012-09-22 Chong Yidong <cyd@gnu.org>
3547
3548 * dispextern.h (struct image_type): Add new slot, storing a type
3549 initialization function.
3550
3551 * image.c (define_image_type): Call the image initializer function
3552 if it is defined. Arguments and return value changed.
3553 (valid_image_p, make_image): Callers changed.
3554 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3555 (gif_type, imagemagick_type, svg_type, gs_type):
3556 Add initialization functions.
3557 (Finit_image_library): Call lookup_image_type.
3558 (CHECK_LIB_AVAILABLE): Macro deleted.
3559 (lookup_image_type): Call define_image_type here, rather than via
3560 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3561 (syms_of_image): Move define_image_type calls for xbm_type and
3562 pbm_type to lookup_image_type.
3563
3564 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3565
3566 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3567 'idle_timers' from here ...
3568 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3569 lists, to avoid infloops when the timer does something stupid,
3570 like reinvoke itself with the same or smaller time-out.
3571 (Bug#12447)
3572
3573 2012-09-22 Martin Rudalics <rudalics@gmx.at>
3574
3575 * window.c (Fsplit_window_internal): Handle only Qt value of
3576 Vwindow_combination_limit separately.
3577 (Qtemp_buffer_resize): New symbol.
3578 (Vwindow_combination_limit): New default value.
3579 Rewrite doc-string.
3580
3581 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3582
3583 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3584 the new overlay string. (Bug#10159)
3585
3586 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3587
3588 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3589 or that fprintf is async-signal-safe. POSIX doesn't require
3590 either assumption.
3591
3592 2012-09-22 Chong Yidong <cyd@gnu.org>
3593
3594 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3595 (Bug#8207).
3596
3597 2012-09-22 Kenichi Handa <handa@gnu.org>
3598
3599 * composite.c (composition_reseat_it): Handle the case that a
3600 grapheme cluster is not covered by a single font (Bug#12352).
3601
3602 2012-09-21 Chong Yidong <cyd@gnu.org>
3603
3604 * image.c (define_image_type): Avoid adding duplicate types to
3605 image_types (Bug#12463). Suggested by Jörg Walter.
3606
3607 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3608
3609 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3610 (print_load_command_name): Add case LC_DATA_IN_CODE.
3611 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3612
3613 2012-09-21 Glenn Morris <rgm@gnu.org>
3614
3615 * eval.c (Frun_hook_with_args_until_success)
3616 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3617
3618 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
3619
3620 * fileio.c (Ffile_selinux_context): Only call freecon when
3621 lgetfilecon succeeded.
3622 (Fset_file_selinux_context): Likewise. (Bug#12444)
3623
3624 2012-09-21 Eli Zaretskii <eliz@gnu.org>
3625
3626 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3627 reordering, locate the cursor by calling set_cursor_from_row; if
3628 that fails, clear the desired glyph matrix before returning a
3629 failure indication to the caller. Fixes leaving garbled display
3630 when fast scrolling with a down-key. (Bug#12403)
3631 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3632 scrolling through multibyte text.
3633
3634 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3635
3636 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3637 calling mark_vectorlike since that's the one that marks the window.
3638 (mark_discard_killed_buffers): Mark the final cdr.
3639 * window.h (struct window): Move prev/next_buffers to the
3640 non-standard fields.
3641 * window.c (make_window): Initialize prev/next_buffers manually.
3642
3643 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3644
3645 Omit unused arg EXPECTED from socket hooks.
3646 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3647 * nsterm.m (ns_term_init):
3648 * termhooks.h (struct terminal.read_socket_hook):
3649 * w32inevt.c (w32_console_read_socket):
3650 * w32term.c (w32_read_socket):
3651 * xterm.c (XTread_socket):
3652 Omit unused arg EXPECTED. All callers changed.
3653 (store_user_signal_events): Return void, not int, since callers no
3654 longer care about the return value. All uses changed.
3655
3656 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
3657
3658 * w32gui.h (XParseGeometry): Do not declare.
3659
3660 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3661
3662 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
3663 Ignore 'expected'. See Eli Zaretskii in
3664 <http://bugs.gnu.org/12471#8> (last line).
3665
3666 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3667 (XParseGeometry): Now static. Substitute extremal values for
3668 values that are out of range.
3669
3670 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3671
3672 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3673
3674 * nsfns.m (XParseGeometry): Remove.
3675 (Fx_create_frame): Call x_set_offset to correctly interpret
3676 top_pos in geometry.
3677
3678 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
3679 (Fx_parse_geometry): If there is a space in string, call
3680 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3681
3682 2012-09-17 Eli Zaretskii <eliz@gnu.org>
3683
3684 * search.c (scan_buffer): Use character positions in calls to
3685 region_cache_forward and region_cache_backward, not byte
3686 positions. (Bug#12196)
3687
3688 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3689 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3690
3691 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3692 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3693 emacs_blocked_malloc, now deleted.
3694
3695 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3696
3697 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3698 The workaround was for improving performance on Solaris 2.4, but
3699 is getting in the way now. Emacs will still work if someone is
3700 still running Solaris 2.4 in a museum somewhere; Sun dropped
3701 support for Solaris 2.4 in 2003.
3702 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3703 * process.c (create_process) [HAVE_WORKING_VFORK]:
3704 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3705 since Emacs no longer uses vfork on that platform.
3706
3707 2012-09-17 Glenn Morris <rgm@gnu.org>
3708
3709 * emacs.c: Use COPYRIGHT.
3710
3711 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3712
3713 Remove configure's --without-sync-input option (Bug#12450).
3714 When auditing signal-handling in preparation for cleaning it up,
3715 I found that SYNC_INPUT has race conditions and would be a real
3716 pain to fix. Since it's an undocumented and deprecated
3717 configure-time option, now seems like a good time to remove it.
3718 Also see <http://bugs.gnu.org/11080#16>.
3719 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3720 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3721 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3722 (malloc_hysteresis):
3723 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3724 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3725 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3726 (dont_register_blocks, bytes_used_when_reconsidered)
3727 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3728 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3729 [!SYSTEM_MALLOC && !SYNC_INPUT]:
3730 Remove. All uses removed.
3731 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3732 implementation, one that depends on whether the new macro
3733 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3734 is defined.
3735 * atimer.c (run_timers, handle_alarm_signal):
3736 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3737 (handle_async_input, process_pending_signals)
3738 (handle_input_available_signal, init_keyboard):
3739 * nsterm.m (ns_read_socket):
3740 * process.c (wait_reading_process_output):
3741 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3742 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3743 (emacs_write):
3744 * xterm.c (XTread_socket):
3745 Assume SYNC_INPUT.
3746 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3747 * eval.c (handling_signal): Remove. All uses removed.
3748 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3749 All uses replaced with the SYNC_INPUT version.
3750 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3751 Remove decls.
3752 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3753 Now static.
3754
3755 * font.c (Ffont_shape_gstring): Remove unused local.
3756
3757 2012-09-16 Glenn Morris <rgm@gnu.org>
3758
3759 * Makefile.in (clean): No longer run nextstep's clean.
3760
3761 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3762 (ns_frag): Remove.
3763 (ns-app): Move here from ns.mk, and simplify.
3764 (clean): Simplify nextstep entry.
3765 * ns.mk: Remove file.
3766
3767 2012-09-17 Kenichi Handa <handa@gnu.org>
3768
3769 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3770 not covert the last few charactes.
3771
3772 2012-09-16 Kenichi Handa <handa@gnu.org>
3773
3774 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3775 here, but just check the validity of glyphs in the glyph-string.
3776
3777 2012-09-16 Martin Rudalics <rudalics@gmx.at>
3778
3779 * window.c (Fwindow_parameter, Fset_window_parameter):
3780 Accept any window as argument (Bug#12452).
3781
3782 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3783
3784 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3785 to ns_term_init to avoid memory leak.
3786
3787 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3788 explicit retain/release.
3789 (ns_term_init): Only allow one display. Initialize outerpool and
3790 ns_*_types.
3791
3792 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3793
3794 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3795 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3796 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3797 the Microsoft problem in a different way, by altering ../nt/config.nt.
3798
3799 2012-09-15 Eli Zaretskii <eliz@gnu.org>
3800
3801 * w32xfns.c:
3802 * w32uniscribe.c:
3803 * w32term.c:
3804 * w32select.c:
3805 * w32reg.c:
3806 * w32proc.c:
3807 * w32menu.c:
3808 * w32inevt.c:
3809 * w32heap.c:
3810 * w32font.c:
3811 * w32fns.c:
3812 * w32console.c:
3813 * w32.c:
3814 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3815 by lisp.h. This completes removal of setjmp.h inclusion
3816 erroneously announced in the previous commit. (Bug#12446)
3817
3818 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3819 more accurate.
3820
3821 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3822 not defined as a macro. The latter happens on MS-Windows.
3823 (Bug#12446)
3824
3825 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3826
3827 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3828 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3829 Some instances of '#include <setjmp.h>' removed, if the
3830 only reason for the instance was because "lisp.h" was included.
3831 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3832 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3833 and _longjmp with the new symbols. Emacs already uses _setjmp if
3834 available, so this change affects only POSIXish hosts that have
3835 sigsetjmp but not _setjmp, such as some versions of Solaris and
3836 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3837 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3838 (png_load_body) [HAVE_PNG]:
3839 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3840 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3841 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3842 since PNG requires jmp_buf. This is the only exception to the
3843 general rule that we now use sys_setjmp and sys_longjmp.
3844 This exception is OK since this code does not change the signal
3845 mask or longjmp out of a signal handler.
3846
3847 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3848
3849 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3850 Include "syssignal.h", for 'main_thread'.
3851
3852 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3853
3854 Avoid out-of-range marker position (Bug#12426).
3855 * insdel.c (replace_range, replace_range_2):
3856 Adjust markers before overlays, as suggested by comments.
3857 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3858 Remove redundant check before calling offset_intervals.
3859
3860 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3861
3862 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3863 current buffer (Bug#12387).
3864
3865 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3866
3867 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3868
3869 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3870
3871 Use a more backwards-compatible timer format (Bug#12430).
3872 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3873 vector element, not from the 4th, since PSECS is now at the end.
3874 (Fcurrent_idle_time): Doc fix.
3875
3876 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3877
3878 Function to mark objects and remove killed buffers at once.
3879 * alloc.c (discard_killed_buffers): Rename to ...
3880 (mark_discard_killed buffers) ... new name. Add marking
3881 of remaining objects. Fix comment. Adjust users.
3882 (mark_object): Do not touch frame buffer lists here.
3883 * frame.c (delete_frame): Reset frame buffer lists here.
3884
3885 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3886
3887 Better workaround for GNOME bug when --enable-gcc-warnings.
3888 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3889 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3890 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3891
3892 Simplify SIGIO usage (Bug#12408).
3893 The code that dealt with SIGIO was crufty and confusing, e.g., it
3894 played tricks like "#undef SIGIO" but these tricks were not used
3895 consistently. Simplify mostly by not #undeffing standard symbols,
3896 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3897 or not as we please) rather than "defined SIGIO" (standard symbol
3898 that we probably shouldn't #undef).
3899 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3900 Modules that need it can include it.
3901 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3902 * dispextern.h (ignore_sigio): New decl.
3903 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3904 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3905 * emacs.c (shut_down_emacs):
3906 * keyboard.c (kbd_buffer_store_event_hold):
3907 Use ignore_sigio rather than invoking 'signal' directly.
3908 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3909 for FIONREAD.
3910 (FIONREAD, SIGIO): Do not #undef.
3911 (tty_read_avail_input): Use #error rather than a syntax error.
3912 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3913 for I_PIPE, used by SETUP_SLAVE_PTY.
3914 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3915 * sysdep.c (croak): Remove; no longer needed. This bit of
3916 temporary code, with Fred N. Fish's comment that it's temporary,
3917 has been in Emacs since at least 1992!
3918 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3919 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3920 * syssignal.h (croak): Remove decl.
3921 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3922 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3923 now that we're termios-only.
3924 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3925 * term.c (dissociate_if_controlling_tty): Use #error rather than
3926 a run-time error.
3927
3928 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3929 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3930 to work around GNOME bug 683906.
3931 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3932 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3933 This works around GCC bug 54561.
3934
3935 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3936
3937 More fixes for 'volatile' and setjmp/longjmp.
3938 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3939 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3940 (png_load_body) [HAVE_PNG]:
3941 (jpeg_load_body) [HAVE_JPEG]:
3942 New function, with most of the old parent function's body.
3943 (png_load) [HAVE_PNG]:
3944 (jpeg_load) [HAVE_JPEG]:
3945 Invoke the new function, to avoid longjmp munging our locals.
3946 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3947 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3948 longjmp is passed 2, as the C standard doesn't guarantee this.
3949 Instead, store the failure code into mgr->failure_code.
3950
3951 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3952
3953 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3954 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3955 (syms_of_keyboard): Remove support for unread-command-char.
3956
3957 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3958
3959 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3960 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3961 violation. (Bug#12426)
3962
3963 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3964
3965 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3966
3967 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3968
3969 * eval.c: Add `inhibit-debugger'.
3970 (Qinhibit_debugger): New symbol.
3971 (call_debugger): Bind it instead of Qdebug_on_error.
3972 (maybe_call_debugger): Test Vinhibit_debugger.
3973 (syms_of_eval): Define inhibit-debugger.
3974 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3975 (syms_of_xdisp): Remove inhibit-debug-on-message.
3976
3977 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3978
3979 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3980 If a nonvolatile local variable is written before a _longjmp to
3981 the frame containing the variable, and is read after the _longjmp,
3982 the value read is indeterminate. Some local variables of type
3983 'struct handler' and 'struct catchtag' are used in this way, so
3984 mark each of their slots as volatile if the slot can be set before
3985 _longjmp and read afterwards.
3986 * lisp.h (struct handler): var and chosen_clause are now volatile.
3987 (struct catchtag): val, next, and pdlcount are now volatile.
3988
3989 * bidi.c (bidi_push_it, bidi_pop_it):
3990 * fns.c (copy_hash_table):
3991 * image.c (define_image_type):
3992 * keyboard.c (kbd_buffer_store_event_hold):
3993 * process.c (Fprocess_send_eof):
3994 * xfaces.c (x_create_gc) [HAVE_NS]:
3995 * xgselect.c (xg_select):
3996 Prefer assignment to memcpy when either will do.
3997
3998 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3999 Use pointer-to-a-pointer to simplify and avoid a NILP check each
4000 time an item is removed. No need to mark this function 'inline';
4001 the compiler knows better than we do.
4002
4003 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
4004
4005 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
4006 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
4007 to change_frame_size (Bug#12388).
4008 (windowDidResize:): Pass YES to updateFrameSize.
4009
4010 * nsterm.h: Add delay parameter to updateFrameSize.
4011
4012 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4013
4014 Discard killed buffers from deleted window and frame objects.
4015 This reduces an amount of references to killed buffers and
4016 helps GC to reclaim them faster.
4017 * alloc.c (discard_killed_buffers): New function.
4018 (mark_object): Use it for deleted windows and frames.
4019 (mark_object): If symbol's value is set up for a killed buffer
4020 or deleted frame, restore its global binding.
4021 * data.c (swap_in_global_binding): Add GC notice.
4022 (swap_in_symval_forwarding): Use convenient set_blv_where.
4023 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
4024 * window.h: ... to here.
4025
4026 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4027
4028 Convenient macro to check whether the buffer is live.
4029 * buffer.h (BUFFER_LIVE_P): New macro.
4030 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
4031 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
4032
4033 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4034
4035 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
4036 composition cases (Bug#12364).
4037
4038 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
4039 overhang of succeeding glyphs overlapping box cursor.
4040
4041 * w32term.c (x_draw_glyph_string): Likewise.
4042
4043 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4044
4045 Simplify, document, and port floating-point (Bug#12381).
4046 The porting part of this patch fixes bugs on non-IEEE platforms
4047 with frexp, ldexp, logb.
4048 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
4049 Now static.
4050 * floatfns.c: Simplify discussion of functions that Emacs doesn't
4051 support, by removing commented-out code and briefly listing the
4052 C89 functions excluded. The commented-out stuff was confusing
4053 maintenance, e.g., we thought we needed cbrt but it was commented out.
4054 (logb): Remove decl; no longer needed.
4055 (isfinite): New macro, if not already supplied.
4056 (isnan): Don't replace any existing macro.
4057 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
4058 are present on all C89 platforms.
4059 (Ffrexp): Do not special-case zero, as frexp does the right thing
4060 for that case.
4061 (Flogb): Do not use logb, as it doesn't have the desired meaning
4062 on hosts that use non-base-2 floating point. Instead, stick with
4063 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
4064 frexp, to avoid getting an unspecified result.
4065
4066 * xdisp.c (Qinhibit_debug_on_message): Now static.
4067
4068 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
4069
4070 * nsterm.m (ns_update_begin): Set clip path to whole view by using
4071 NSBezierPath (Bug#12131).
4072
4073 2012-09-10 Chong Yidong <cyd@gnu.org>
4074
4075 * fns.c (Fdelq, Fdelete): Doc fix.
4076
4077 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
4078
4079 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
4080 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
4081
4082 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
4083
4084 * lisp.h (make_lisp_ptr): New macro to replace XSET.
4085 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
4086 Use it.
4087
4088 2012-09-09 Eli Zaretskii <eliz@gnu.org>
4089
4090 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
4091 left fringe if the window has a left margin. This avoids leaving
4092 traces of the cursor because its leftmost pixel is not drawn over.
4093
4094 * dispnew.c (update_window_line): When the left margin area of a
4095 screen line is updated, set the redraw_fringe_bitmaps_p flag of
4096 that screen line. (Bug#12277)
4097
4098 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
4099
4100 Assume C89 or later for math functions (Bug#12381).
4101 This simplifies the code, and makes it a bit smaller and faster,
4102 and (most important) makes it easier to clean up signal handling
4103 since we can stop worring about floating-point exceptions in
4104 library code. That was a problem before C89, but the problem
4105 went away many years ago on all practical Emacs targets.
4106 * data.c, image.c, lread.c, print.c:
4107 Don't include <math.h>; no longer needed.
4108 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
4109 might be autoconfigured, as that never happens.
4110 * data.c (fmod):
4111 * doprnt.c (DBL_MAX_10_EXP):
4112 * print.c (DBL_DIG):
4113 Remove. C89 or later always defines these.
4114 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
4115 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
4116 (arith_error, domain_error, domain_error2):
4117 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
4118 no longer needed -- we simply return what C returns. All uses removed.
4119 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
4120 the wrapped code.
4121 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
4122 Remove. All uses expanded, as these macros are no longer used
4123 more than once and are now more trouble than they're worth.
4124 (Ftan): Use tan, not sin / cos.
4125 (Flogb): Assume C89 frexp.
4126 (fmod_float): Assume C89 fmod.
4127 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
4128 (init_floatfns): Remove. All uses removed.
4129
4130 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4131
4132 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
4133 compositeToPoint for OSX < 10.6 (Bug#12390).
4134
4135 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
4136
4137 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
4138 This produces more-accurate results.
4139
4140 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4141
4142 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
4143 changes (Bug#12088).
4144
4145 2012-09-08 Chong Yidong <cyd@gnu.org>
4146
4147 * syntax.c (Fstring_to_syntax): Doc fix.
4148
4149 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4150
4151 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
4152 in the internal border.
4153 (x_set_window_size): Remove static variables and their usage.
4154 (ns_redraw_scroll_bars): Fix NSTRACE arg.
4155 (ns_after_update_window_line, ns_draw_fringe_bitmap):
4156 Remove fringe/internal border adjustment (Bug#11052).
4157 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
4158 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
4159 (ns_fix_rect_ibw): Remove.
4160 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
4161 (ns_dumpglyphs_box_or_relief): Ditto.
4162 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
4163 adjustment.
4164 (ns_dumpglyphs_image): Ditto.
4165 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
4166 border adjustment.
4167 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
4168 their usage. Add fringe_extended_p and its use as in other terms.
4169 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
4170 scroll bar was removed.
4171 (updateFrameSize): New function.
4172 (windowDidResize): Move code to updateFrameSize and call it.
4173
4174 * nsterm.h (EmacsView): Add updateFrameSize.
4175
4176 2012-09-07 Chong Yidong <cyd@gnu.org>
4177
4178 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
4179
4180 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
4181
4182 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4183
4184 More signal-handler cleanup (Bug#12327).
4185 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
4186 Problem introduced when merging patches. Noted by Eli Zaretskii in
4187 <http://bugs.gnu.org/12327#67>.
4188 * floatfns.c: Comment fix.
4189 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
4190 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
4191 and anyway the declaration is harmless even if SIGDANGER is not defined.
4192 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
4193 defined BROKEN_FIONREAD). systty.h formerly did this, but other
4194 source files not surprisingly expected syssignal.h to define, or
4195 not define, SIGIO, and it's cleaner to do it that way, for consistency.
4196 Include <sys/ioctl.h>, for FIONREAD.
4197 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
4198 This eliminates a problem whereby other files mysteriously had
4199 to include "syssignal.h" before including "systty.h" if they
4200 wanted to use "#ifdef SIGIO".
4201
4202 2012-09-07 Eli Zaretskii <eliz@gnu.org>
4203
4204 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
4205
4206 * w32.c (sigemptyset): Empty the set.
4207 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
4208
4209 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
4210
4211 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
4212
4213 * alloc.c (mark_buffer): Revert unsafe marking optimization.
4214 (mark_object): Likewise for frame objects.
4215
4216 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4217
4218 * syssignal.h (handle_on_main_thread): Always declare,
4219 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
4220 This ports to platforms without HAVE_PTHREAD.
4221
4222 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4223
4224 Signal-handler cleanup (Bug#12327).
4225 Emacs's signal handlers were written in the old 4.2BSD style with
4226 sigblock and sigmask and so forth, and this led to some
4227 inefficiencies and confusion. Rewrite these to use
4228 pthread_sigmask etc. without copying signal sets around. Also,
4229 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
4230 'signal', and instead use functions that do not attempt to take
4231 over the system name space. This patch causes Emacs's text
4232 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
4233 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
4234 Do not include <signal.h> or "syssignal.h", as these
4235 modules do not use signals.
4236 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
4237 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
4238 Do not include <signal.h>, as "syssignal.h" does that for us now.
4239 * atimer.c (sigmask_atimers): New function.
4240 (block_atimers, unblock_atimers): New functions,
4241 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
4242 All uses replaced.
4243 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
4244 no longer needed here.
4245 * emacs.c (main): Inspect existing signal handler with sigaction,
4246 so that there's no need to block and unblock SIGHUP.
4247 * sysdep.c (struct save_signal): New member 'action', replacing
4248 old member 'handler'.
4249 (save_signal_handlers, restore_signal_handlers):
4250 Use sigaction instead of 'signal' to save and restore.
4251 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
4252 New function. All users of 'signal' modified to use set_sighandler
4253 if they're writeonly, and to use sys_signal if they're read+write.
4254 (emacs_sigaction_init, forwarded_signal): New functions.
4255 (sys_signal): Remove. All uses replaced by calls to sigaction
4256 and emacs_sigaction_init, or by direct calls to 'signal'.
4257 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
4258 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
4259 all uses replaced by pthread_sigmask etc. calls.
4260 * syssignal.h: Include <signal.h>.
4261 (emacs_sigaction_init, forwarded_signal): New decls.
4262 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
4263 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
4264 (sigmask, sys_sigmask): Remove; no longer needed.
4265 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
4266 (sigblock, sigunblock, sigfree):
4267 (sigsetmask) [!defined sigsetmask]:
4268 Remove. All uses replaced by pthread_sigmask.
4269 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
4270 no longer need to be replaced, and its typical old uses
4271 are now done via emacs_sigaction_init and sigaction.
4272 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
4273 (sys_sigdel): Remove; unused.
4274 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
4275
4276 2012-09-06 Eli Zaretskii <eliz@gnu.org>
4277
4278 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
4279 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
4280
4281 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4282
4283 Explicitly mark buffer_defaults and buffer_local_symbols.
4284 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
4285 mark_local_symbols here.
4286 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
4287 since special buffers aren't marked here any more.
4288 (allocate_buffer): Chain new buffer with all_buffers here...
4289 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
4290 not here.
4291 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
4292 (syms_of_buffer): Remove staticpro of the above.
4293 (init_buffer_once): Set names for buffer_defaults and
4294 buffer_local_symbols.
4295
4296 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4297
4298 Use bool for booleans in font-related modules.
4299 * font.c (font_intern_prop, font_style_to_value)
4300 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
4301 (generate_otf_features, font_check_otf_features, font_check_otf)
4302 (font_match_p, font_list_entities, font_at):
4303 * fontset.c (fontset_id_valid_p, reorder_font_vector
4304 (fontset_find_font, Fset_fontset_font)
4305 (face_suitable_for_char_p) [0]:
4306 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
4307 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
4308 (m17n_flt_initialized, ftfont_shape_by_flt):
4309 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
4310 * nsfont.m (nsfont_draw):
4311 * w32font.c (w32font_draw):
4312 * w32term.c (x_draw_glyphless_glyph_string_foreground):
4313 Use bool for booleans.
4314 * font.h: Adjust to above API changes.
4315 (struct font, struct font_driver, struct font_driver_list):
4316 Use bool for booleans.
4317 (struct font): Remove useless member encoding_type.
4318 All users removed.
4319 * fontset.c, xftfont.c: Omit unnecessary static decls.
4320
4321 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4322
4323 * alloc.c (mark_object): Revert window marking code
4324 since it's unsafe for the Fset_window_configuration.
4325
4326 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4327
4328 Fix race conditions with signal handlers and errno (Bug#12327).
4329 Be more systematic about preserving errno whenever a signal
4330 handler returns, even if it's not in the main thread. Do this by
4331 renaming signal handlers to distinguish between signal delivery
4332 and signal handling. All uses changed.
4333 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
4334 * data.c (deliver_arith_signal): Rename from arith_error.
4335 * dispnew.c (deliver_window_change_signal): Rename from
4336 window_change_signal.
4337 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
4338 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
4339 * keyboard.c (deliver_input_available_signal): Rename from
4340 input_available_signal.
4341 (deliver_user_signal): Rename from handle_user_signal.
4342 (deliver_interrupt_signal): Rename from interrupt_signal.
4343 * process.c (deliver_pipe_signal): Rename from send_process_trap.
4344 (deliver_child_signal): Rename from sigchld_handler.
4345 * atimer.c (handle_alarm_signal):
4346 * data.c (handle_arith_signal):
4347 * dispnew.c (handle_window_change_signal):
4348 * emacs.c (handle_fatal_signal, handle_danger_signal):
4349 * keyboard.c (handle_input_available_signal):
4350 * keyboard.c (handle_user_signal, handle_interrupt_signal):
4351 * process.c (handle_pipe_signal, handle_child_signal):
4352 New functions, with the actual signal-handling code taken from the
4353 original respective signal handlers, sans the sporadic attempts to
4354 preserve errno, since that's now done by handle_on_main_thread.
4355 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
4356 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
4357 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4358 Move to sysdep.c.
4359 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4360 Move initialization of main_thread to sysdep.c's init_signals.
4361 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
4362 our usage, and simplifies the mainline code.
4363 (record_child_status_change): New static function, as a helper
4364 for handle_child_signal, and with most of the old child handler's
4365 contents.
4366 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
4367 (handle_child_signal): Use the above.
4368 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4369 Moved here from emacs.c.
4370 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
4371 code moved here from emacs.c's main function.
4372 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
4373 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
4374 This lets callers save and restore errno properly.
4375
4376 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4377
4378 Remove redundant or unused things here and there.
4379 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
4380 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
4381 * editfns.c (Fcompare_buffer_substrings): Likewise.
4382 * frame.h (struct terminal, struct font_driver_list):
4383 Remove redundant declarations.
4384 * window.h (Qleft, Qright): Likewise.
4385
4386 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4387
4388 Do not mark objects from deleted buffers, windows and frames.
4389 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
4390 (mark_object): Likewise for windows and frames.
4391
4392 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4393
4394 * alloc.c (valid_lisp_object_p): Treat killed buffers,
4395 buffer_defaults and buffer_local_symbols as valid objects.
4396 Return special value to denote them.
4397
4398 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4399
4400 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
4401 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
4402 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
4403 (file_name_absolute_p, Fsubstitute_in_file_name):
4404 (check_executable, check_writable, Ffile_accessible_directory_p)
4405 (Fset_file_selinux_context, Fdefault_file_modes)
4406 (Finsert_file_contents, choose_write_coding_system)
4407 (Fwrite_region, build_annotations, a_write, e_write)
4408 (Fdo_auto_save):
4409 * filelock.c (boot_time_initialized, get_boot_time)
4410 (get_boot_time_1, lock_file_1, within_one_second):
4411 * floatfns.c (in_float):
4412 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
4413 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
4414 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
4415 * lisp.h (struct Lisp_Hash_Table.cmpfn):
4416 * window.c (compare_window_configurations):
4417 Use bool for booleans.
4418 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
4419 (Fdefault_file_modes): Now mode_t, not int, for modes.
4420 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
4421 (internal_delete_file): Now returns void, not a (boolean) int,
4422 since nobody was looking at the return value.
4423 * lisp.h, window.h: Adjust to above API changes.
4424
4425 * xdisp.c (set_message): Simplify and reindent last change.
4426
4427 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
4428
4429 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
4430
4431 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
4432
4433 * eval.c (call_debugger): Make the function non-static so that we
4434 can call it from set_message.
4435
4436 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
4437 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
4438
4439 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4440
4441 Give more-useful info on a fatal error (Bug#12328).
4442 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4443 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4444 of doing the work ourselves.
4445 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4446 do most of the work.
4447 (fatal_error_backtrace): New function, taken from the guts
4448 of the old fatal_error_signal, but with a new option to output
4449 a backtrace.
4450 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4451 info about the signal than just its number.
4452 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4453 * sysdep.c: Include <execinfo.h>
4454 (emacs_backtrace): New function, taken partly from the previous
4455 code of the 'die' function.
4456 (emacs_abort): Call fatal_error_backtrace rather than abort.
4457
4458 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4459
4460 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4461 eager (load-time) macro-expansion.
4462 * lisp.mk (lisp): Add macroexp.
4463
4464 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4465
4466 Simplify redefinition of 'abort' (Bug#12316).
4467 Do not try to redefine the 'abort' function. Instead, redo
4468 the code so that it calls 'emacs_abort' rather than 'abort'.
4469 This removes the need for the NO_ABORT configure-time macro
4470 and makes it easier to change the abort code to do a backtrace.
4471 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4472 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4473 Remove; sysdep.c's emacs_abort now takes its place.
4474 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4475 'abort' changed to use 'emacs_abort'.
4476 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4477 (abort) [!defined abort]: Rename to ...
4478 (emacs_abort): ... new name.
4479 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4480 the place of the old 'abort' in emacs.c.
4481 * w32.c, w32fns.c (abort): Do not #undef.
4482 * w32.c (emacs_abort): Rename from w32_abort.
4483
4484 2012-09-04 Eli Zaretskii <eliz@gnu.org>
4485
4486 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4487 offsets[j].dv, since the y axis of the screen coordinates points
4488 down, while the y axis of the font definition coordinates points
4489 up. This fixes display of Arabic diacritics such as KASRA and
4490 KASRATAN. (Bug#11860)
4491
4492 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4493
4494 Be more systematic about _setjmp vs setjmp.
4495 * alloc.c (test_setjmp, mark_stack):
4496 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4497 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4498 (png_load, my_error_exit, jpeg_load):
4499 * process.c (send_process_trap, send_process):
4500 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4501 The underscored versions are up to 30x faster on some hosts.
4502 Formerly, the code used setjmp+longjmp sometimes and
4503 _setjmp+_longjmp at other times, with no particular reason to
4504 prefer setjmp+longjmp.
4505
4506 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4507
4508 Fix minor problem found by static checking.
4509 * buffer.c (Fdelete_all_overlays): Return nil.
4510
4511 2012-09-03 Martin Rudalics <rudalics@gmx.at>
4512
4513 * buffer.c (Fdelete_all_overlays): New function.
4514
4515 2012-09-03 Chong Yidong <cyd@gnu.org>
4516
4517 * gtkutil.c: Add extern decl for Qxft.
4518
4519 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4520
4521 * emacs.c, eval.c: Use bool for boolean.
4522 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4523 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4524 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4525 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4526 (main, decode_env_path, Fdaemon_initialized):
4527 * eval.c (call_debugger, Finteractive_p, interactive_p):
4528 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4529 (maybe_call_debugger, Fbacktrace):
4530 * process.c (read_process_output, exec_sentinel):
4531 Use bool for booleans.
4532 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4533 All callers changed.
4534 * eval.c (interactive_p): Omit always-true boolean argument
4535 EXCLUDE_SUBRS_P. All callers changed.
4536 * dispextern.h, lisp.h: Reflect above API changes.
4537 * firstfile.c (dummy): Use the address of 'main', whose signature
4538 won't change, instead of the address of 'initialize', whose
4539 signature just changed from int to bool.
4540 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4541 * msdos.c (fatal_error_in_progress): ... from here.
4542 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4543 of incrementing it.
4544 (redisplay_internal, unwind_redisplay): Simply clear
4545 REDISPLAYING_P when unwinding, instead of saving its previous,
4546 always-false value and then restoring it.
4547
4548 Clean up some extern decls.
4549 Mostly, this hoists extern decls out of .c files and into .h files.
4550 That way, we're more likely to catch errors if the interfaces change.
4551 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4552 declare xg_mark_data.
4553 * dispextern.h (x_frame_parm_handlers):
4554 * font.h (Qxft):
4555 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4556 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4557 (Qultra_bold, Qoblique, Qitalic):
4558 Move extern decl here from .c file.
4559 * alloc.c (xg_mark_data) [USE_GTK]:
4560 * doc.c (Qclosure):
4561 * eval.c (Qlexical_binding):
4562 * fns.c (time) [!HAVE_UNISTD_H]:
4563 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4564 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4565 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4566 * lread.c (Qinternal_interpreter_environment):
4567 * minibuf.c (Qbuffer):
4568 * process.c (QCfamily, QCfilter):
4569 * widget.c (free_frame_faces):
4570 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4571 * xfont.c (x_clear_errors):
4572 * xterm.c (x_frame_parm_handlers):
4573 Remove now-redundant extern decls.
4574 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4575 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4576 Now static.
4577 * xfaces.c: Remove unnecessary static decls.
4578 * xterm.c (updating_frame): Remove decl of nonexistent object.
4579
4580 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4581 when building globals.h, as the objects that are not built on
4582 this host are not needed to compile C files on this host.
4583
4584 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4585
4586 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4587
4588 * frame.h: Add missing prototype for x_wm_set_size_hint.
4589
4590 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4591
4592 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4593 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4594 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4595 (Fsubstitute_command_keys):
4596 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4597 (save_excursion_save, save_excursion_restore)
4598 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4599 (format_time_string, general_insert_function)
4600 (make_buffer_string, make_buffer_string_both)
4601 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4602 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4603 (copy_text, insert_1, insert_1_both, insert_from_string)
4604 (insert_from_string_before_markers, insert_from_string_1)
4605 (insert_from_buffer, insert_from_buffer_1, replace_range)
4606 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4607 (del_range_2, modify_region):
4608 * intervals.c (intervals_equal, balance_possible_root_interval)
4609 (adjust_intervals_for_insertion, merge_properties_sticky)
4610 (graft_intervals_into_buffer, lookup_char_property)
4611 (adjust_for_invis_intang, set_point_both)
4612 (get_property_and_range, compare_string_intervals)
4613 (set_intervals_multibyte_1, set_intervals_multibyte):
4614 * keyboard.c (decode_timer):
4615 Use bool for boolean.
4616 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4617 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4618
4619 2012-09-02 Chong Yidong <cyd@gnu.org>
4620
4621 * keymap.c (push_key_description): Print M-TAB as C-M-i
4622 (Bug#11758).
4623
4624 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
4625
4626 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4627 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4628 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4629 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4630 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4631 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4632 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4633
4634 2012-09-01 Eli Zaretskii <eliz@gnu.org>
4635
4636 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4637 more than one grapheme cluster passed to the shaper: compute the
4638 offset adjustment values separately for each cluster. (Bug#11860)
4639
4640 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4641 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4642 about implicit conversions from integer to pointer.
4643
4644 2012-09-01 Daniel Colascione <dancol@dancol.org>
4645
4646 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4647 system used too early.
4648
4649 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4650
4651 Better seed support for (random).
4652 * emacs.c (main): Call init_random.
4653 * fns.c (Frandom): Set the seed from a string argument, if given.
4654 Remove long-obsolete Gentzel cruft.
4655 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4656 (init_random): New function.
4657
4658 2012-09-01 Daniel Colascione <dancol@dancol.org>
4659
4660 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4661 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4662 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4663 x_wm_set_size_hint, x_query_colors, x_real_positions,
4664 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4665 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4666 all of which have been moved to common code.
4667
4668 * xfaces.c: Include TERM_HEADER instead of listing all possible
4669 window-system headers.
4670
4671 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4672 to match header.
4673
4674 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4675 directly accessing frame internals.
4676
4677 * w32font.h: Include font.h. Define syms_of_w32font and
4678 globals_of_w32font.
4679
4680 * process.c: Include TERM_HEADER instead of listing all possible
4681 window-system headers.
4682
4683 * nsterm.h: Remove declarations now in frame.h.
4684 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
4685
4686 * menu.c: Include TERM_HEADER instead of listing all possible
4687 window-system headers.
4688
4689 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4690 window system.
4691
4692 * keyboard.c: Include TERM_HEADER instead of listing all possible
4693 window-system headers.
4694
4695 * image.c: Include TERM_HEADER instead of listing all possible
4696 window-system headers. Declare Vlibrary_cache when compiling for
4697 Windows.
4698
4699 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4700 window system declarations.
4701
4702 * frame.h: Move common functions here: set_frame_menubar,
4703 x_set_window_size, x_sync, x_get_focus_frame,
4704 x_set_mouse_position, x_set_mouse_pixel_position,
4705 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4706 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4707 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4708 x_activate_menubar, x_real_positions, x_bitmap_icon,
4709 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4710 and x_query_colors.
4711
4712 * frame.c: Include TERM_HEADER instead of listing all possible
4713 window-system headers.
4714
4715 * font.c: Include TERM_HEADER instead of listing all possible
4716 window-system headers.
4717
4718 * emacs.c: Include TERM_HEADER.
4719
4720 * dispnew.c: Include TERM_HEADER instead of listing all possible
4721 window-system headers.
4722
4723 * ccl.h: Include character.h.
4724
4725 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4726 the current window system; include in list of objects to link into
4727 Emacs.
4728
4729 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4730
4731 Remove mark_ttys function and fix tty_display_info initialization.
4732 * lisp.h (mark_ttys): Remove prototype.
4733 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4734 to mark_ttys because all possible values of 'top_frame' slot are
4735 the frames which are reachable from Vframe_list.
4736 * term.c (mark_ttys): Remove.
4737 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4738
4739 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4740
4741 Change struct frame bitfields from unsigned char to unsigned.
4742 * frame.h (struct frame): Change type of 'display_preempted',
4743 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4744 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4745 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4746 bitfields from unsigned char to unsigned.
4747
4748 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4749
4750 Remove unused member of struct x_output and struct w32_output.
4751 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4752 * w32term.h (struct w32_output): Likewise.
4753
4754 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4755
4756 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4757 does not become zero (Bug#12234).
4758
4759 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4760
4761 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4762 for GCC 4.7.1 x86-64.
4763
4764 2012-08-30 Glenn Morris <rgm@gnu.org>
4765
4766 * lread.c (init_lread): For out-of-tree builds, only add the
4767 source directory's site-lisp dir to the load-path if it exists,
4768 consistent with in-tree builds. (Bug#12302)
4769
4770 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4771
4772 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4773 button_values to NULL. Call setStykeMask so dialogs get a close button.
4774 (windowShouldClose:): Set window_closed.
4775 (dealloc): New member, free button_values.
4776 (process_dialog:): Make member function. Remove window argument,
4777 replace window with self. Count buttons and allocate and store values
4778 in button_values.
4779 (addButton:value:row:): value is int with the name tag. Call setTag
4780 with tag. Remove return self, declare return value as void.
4781 (addString:row:): Remove return self, declare return value as void.
4782 (addSplit): Remove return self, declare return value as void.
4783 (clicked:): Remove return self, declare return value as void.
4784 Set dialog_return to button_values[seltag]. Code formatting change.
4785 (initFromContents:isQuestion:): Adjust call to process_dialog.
4786 Code formatting change.
4787 (timeout_handler:): Set timer_fired to YES.
4788 (runDialogAt:): Set timer_fired to NO.
4789 Handle click on close button as quit.
4790
4791 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4792 Add window_closed and button_values. Add void as return value for
4793 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4794 Add process_dialog as new member.
4795
4796 2012-08-28 Eli Zaretskii <eliz@gnu.org>
4797
4798 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4799 is not one of the heaps we manage. (Bug#12242)
4800
4801 2012-08-28 Glenn Morris <rgm@gnu.org>
4802
4803 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4804
4805 2012-08-28 Martin Rudalics <rudalics@gmx.at>
4806
4807 * window.c (Fset_window_configuration): Remove handling of
4808 auto-buffer-name window parameter. Install revision of reverted
4809 fix.
4810
4811 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4812
4813 Do not allow to set major mode for a dead buffer.
4814 * buffer.c (Fset_buffer_major_mode): Signal an error
4815 if the buffer is dead.
4816 (Fother_buffer, other_buffer_safely): Remove redundant
4817 nested declaration.
4818
4819 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4820
4821 Always use set_buffer_if_live to restore original buffer at unwind.
4822 * buffer.h (record_unwind_current_buffer): New function.
4823 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4824 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4825 * undo.c, window.c: Adjust users.
4826 * buffer.c (set_buffer_if_live): Fix comment.
4827
4828 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4829
4830 Fix usage of set_buffer_internal.
4831 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4832 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4833 * coding.c (decode_coding): Omit redundant test.
4834 * fileio.c (decide_coding_unwind): Likewise.
4835 * fns.c (secure_hash): Likewise.
4836 * insdel.c (modify_region): Likewise.
4837 * keyboard.c (command_loop_1): Likewise.
4838 * print.c (PRINTFINISH): Likewise.
4839 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4840
4841 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4842
4843 * dispnew.c: Use bool for boolean.
4844 (frame_garbaged, display_completed, delayed_size_change)
4845 (fonts_changed_p, add_window_display_history)
4846 (add_frame_display_history, verify_row_hash)
4847 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4848 (row_equal_p, realloc_glyph_pool)
4849 (allocate_matrices_for_frame_redisplay)
4850 (showing_window_margins_p)
4851 (adjust_frame_glyphs_for_frame_redisplay)
4852 (build_frame_matrix_from_leaf_window, make_current)
4853 (mirrored_line_dance, mirror_line_dance, update_frame)
4854 (update_window_tree, update_single_window)
4855 (check_current_matrix_flags, update_window, update_text_area)
4856 (update_window_line, set_window_update_flags, scrolling_window)
4857 (update_frame_1, scrolling, buffer_posn_from_coords)
4858 (do_pending_window_change, change_frame_size)
4859 (change_frame_size_1, sit_for):
4860 Use bool for boolean.
4861 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4862 and remove last int (actually boolean) argument, which was always 0.
4863 All callers changed.
4864 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4865 * dispextern.h (struct composition_it): Use bool for boolean.
4866 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4867 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4868 * dired.c (file_name_completion):
4869 Use bool for boolean. (This was missed in an earlier change.)
4870
4871 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4872
4873 * window.c (Fset_window_configuration): Revert first part of
4874 last change.
4875
4876 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4877
4878 * nsterm.h (NSPanel): New class variable dialog_return.
4879
4880 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4881 Initialize dialog_return.
4882 (windowShouldClose:): Use stop instead of stopModalWithCode.
4883 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4884 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4885 event.
4886 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4887 modal loop returns.
4888
4889 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4890
4891 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4892 * composite.c (find_composition, composition_gstring_p)
4893 (composition_reseat_it, find_automatic_composition):
4894 * data.c (let_shadows_buffer_binding_p)
4895 (let_shadows_global_binding_p, set_internal, make_blv)
4896 (Fmake_variable_buffer_local, Fmake_local_variable)
4897 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4898 (cons_to_signed, arith_driver):
4899 * dbusbind.c (xd_in_read_queued_messages):
4900 * dired.c (directory_files_internal, file_name_completion):
4901 Use bool for booleans.
4902 * dired.c (file_name_completion):
4903 * process.h (fd_callback):
4904 Omit int (actually boolean) argument. It wasn't being used.
4905 All uses changed.
4906 * composite.h, lisp.h: Reflect above API changes.
4907
4908 * cmds.c, coding.c: Use bool for booleans.
4909 * cmds.c (move_point, Fself_insert_command):
4910 * coding.h (struct composition status, struct coding_system):
4911 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4912 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4913 (emacs_mule_char, decode_coding_emacs_mule)
4914 (encode_coding_emacs_mule, detect_coding_iso_2022)
4915 (decode_coding_iso_2022, encode_invocation_designation)
4916 (encode_designation_at_bol, encode_coding_iso_2022)
4917 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4918 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4919 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4920 (encode_coding_raw_text, detect_coding_charset)
4921 (decode_coding_charset, encode_coding_charset, detect_eol)
4922 (detect_coding, get_translation_table, produce_chars)
4923 (consume_chars, reused_workbuf_in_use)
4924 (make_conversion_work_buffer, code_conversion_save)
4925 (decode_coding_object, encode_coding_object)
4926 (detect_coding_system, char_encodable_p)
4927 (Funencodable_char_position, code_convert_region)
4928 (code_convert_string, code_convert_string_norecord)
4929 (Fset_coding_system_priority):
4930 * fileio.c (Finsert_file_contents):
4931 Use bool for booleans.
4932 * coding.h, lisp.h: Reflect above API changes.
4933 * coding.c: Remove unnecessary static function decls.
4934 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4935 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4936 not a boolean 'int', since callers never look at the return value.
4937 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4938 * coding.h (decoding_buffer_size, encoding_buffer_size)
4939 (emacs_mule_string_char): Remove unused extern decls.
4940 (struct iso_2022_spec, struct coding_system):
4941 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4942 (struct emacs_mule_spec): Remove unused field 'full_support'.
4943 All initializations removed.
4944 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4945
4946 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4947
4948 Fix spare memory change (Bug#12286).
4949 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4950 (valid_lisp_object_p): Likewise.
4951
4952 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4953
4954 * window.c (Fset_window_configuration): Record any window's old
4955 buffer if it's replaced (see Bug#8789). If the new current
4956 buffer doesn't appear in the selected window, go to its old
4957 point (Bug#12208).
4958
4959 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4960
4961 Special MEM_TYPE_SPARE to denote reserved memory.
4962 * alloc.c (enum mem_type): New memory type.
4963 (refill_memory_reserve): Use new type for spare memory.
4964 This prevents live_cons_p and live_string_p from incorrect
4965 detection of uninitialized objects from spare memory as live.
4966
4967 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4968
4969 Spelling fixes.
4970 * Makefile.in (.PHONY): versioclean -> versionclean.
4971
4972 Remove unused external symbols.
4973 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4974 * window.c (Qwindow_valid_p, decode_valid_window):
4975 Now static, not extern.
4976 * data.c (Qinterval): Remove; unused.
4977 (syms_of_data): Do not define 'interval'.
4978 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4979 * window.h (decode_valid_window):
4980 Remove decls.
4981
4982 * character.c, charset.c, chartab.c: Use bool for booleans.
4983 * character.c (lisp_string_width, string_count_byte8)
4984 (string_escape_byte8):
4985 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4986 (load_charset_map_from_file, map_charset_chars)
4987 (Fdefine_charset_internal, define_charset_internal)
4988 (Fdeclare_equiv_charset, find_charsets_in_text)
4989 (Ffind_charset_region, char_charset, Fiso_charset):
4990 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4991 (sub_char_table_set, sub_char_table_set_range)
4992 (char_table_set_range, optimize_sub_char_table)
4993 (map_sub_char_table):
4994 Use bool for boolean.
4995 * character.c (str_to_unibyte): Omit last boolean argument; it was
4996 always 0. All callers changed.
4997 * character.h, charset.h: Adjust to match previous changes.
4998 * character.h (char_printable_p): Remove decl of nonexistent function.
4999 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
5000 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
5001 are all boolean, so make them single-bit bitfields.
5002
5003 * lisp.h (ASET): Remove attempt to detect side effects.
5004 It was meant to be temporary and it often doesn't work,
5005 because when IDX has side effects the behavior of IDX==IDX
5006 is undefined. See Stefan Monnier in
5007 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
5008
5009 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5010
5011 * lisp.h (functionp): New function (extracted from Ffunctionp).
5012 (FUNCTIONP): Use it.
5013 * eval.c (Ffunctionp): Use it.
5014
5015 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5016
5017 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
5018 as that's faster and simpler than static storage. Don't bother
5019 with the g_main_context_query overhead if g_main_context_pending
5020 says no events are pending.
5021 (gfds, gfds_size): Remove these static vars.
5022 (xgselect_initialize): Remove; no longer needed.
5023 All uses and decls removed.
5024
5025 * emacs.c (fatal_error_signal_hook): Remove.
5026 All uses removed. This leftover from old code was always 0.
5027
5028 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
5029 * casefiddle.c (casify_object, casify_region):
5030 * casetab.c (set_case_table):
5031 * category.c, category.h (word_boundary_p):
5032 * category.h (CHAR_HAS_CATEGORY):
5033 Use bool for booleans, instead of int.
5034
5035 2012-08-25 Eli Zaretskii <eliz@gnu.org>
5036
5037 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
5038
5039 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5040
5041 On assertion failure, print backtrace if available.
5042 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
5043 (die) [ENABLE_CHECKING]: Print a backtrace if available.
5044 * Makefile.in (LIB_EXECINFO): New macro.
5045 (LIBES): Use it.
5046
5047 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
5048 * bytecode.c (exec_byte_code):
5049 * callint.c (check_mark, Fcall_interactively):
5050 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
5051 (getenv_internal, sync_process_alive, call_process_exited):
5052 * lisp.h (USE_SAFE_ALLOCA):
5053 Use bool for booleans, instead of int.
5054 * lisp.h, process.h: Adjust prototypes to match above changes.
5055 * callint.c (Fcall_interactively): Don't assume the mark's
5056 offset fits in 'int'.
5057
5058 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
5059
5060 * buffer.c, buffer.h: Use bool for boolean.
5061 * buffer.c (reset_buffer_local_variables)
5062 (buffer_lisp_local_variables, Fset_buffer_modified_p)
5063 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
5064 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
5065 (overlay_touches_p, overlay_strings, Foverlay_put)
5066 (report_overlay_modification, call_overlay_mod_hooks):
5067 (mmap_enlarge, mmap_set_vars):
5068 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
5069 Use bool for booleans, instead of int.
5070 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
5071 since the 1-or-0 return value is always ignored anyway.
5072 (mmap_initialized_p):
5073 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
5074 * buffer.h, lisp.h: Adjust prototypes to match above changes.
5075
5076 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5077
5078 * bidi.c: Use bool for boolean.
5079 This is a bit more readable, and makes the text segment of bidi.o
5080 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
5081 Presumably it's faster too.
5082 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
5083 Now bool.
5084 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5085 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
5086 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
5087 (bidi_explicit_dir_char, bidi_level_of_next_char)
5088 (bidi_find_other_level_edge, bidi_move_to_visually_next):
5089 Use bool for booleans, instead of int.
5090 * dispextern.h (bidi_init_it, bidi_paragraph_init)
5091 (bidi_unshelve_cache): Adjust decls to match code.
5092
5093 2012-08-23 Martin Rudalics <rudalics@gmx.at>
5094
5095 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
5096 argument.
5097
5098 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5099
5100 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
5101 * atimer.h: Include <stdbool.h>.
5102
5103 2012-08-22 Dan Nicolaescu <dann@gnu.org>
5104
5105 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
5106 compile time tests instead of run time tests on systems that do
5107 not use them.
5108 (FRAME_MAC_P): Remove leftover from deleted code.
5109 * frame.c (syms_of_frame): Remove leftover from deleted code.
5110
5111 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
5112
5113 * nsterm.m (insertText:): Don't clear modifiers if code is space.
5114
5115 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
5116
5117 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
5118 Otherwise, the compiler complains about (A?B:C) where B is void
5119 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
5120 (fontset_add): Return void, for FONTSET_ADD.
5121
5122 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5123
5124 * alloc.c: Use bool for booleans.
5125 (gc_in_progress, abort_on_gc)
5126 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5127 (dont_register_blocks) [GC_MALLOC_CHECK]:
5128 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
5129 (check_string_bytes, make_specified_string, memory_full)
5130 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
5131 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
5132 (mark_stack, valid_pointer_p, make_pure_string)
5133 (Fgarbage_collect, survives_gc_p, gc_sweep):
5134 Use bool for booleans, instead of int.
5135 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5136 Remove unused local.
5137 * alloc.c (PURE_POINTER_P):
5138 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
5139 * editfns.c (Fformat):
5140 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
5141 (Fdo_auto_save):
5142 * fns.c (sweep_weak_table):
5143 * lisp.h (suppress_checking, push_message, survives_gc_p)
5144 (make_pure_string, gc_in_progress, abort_on_gc):
5145 * lread.c (readchar, read1):
5146 * print.c (Fprin1_to_string):
5147 * xdisp.c (push_message):
5148 Use bool for booleans affected directly or indirectly by
5149 alloc.c's changes.
5150
5151 Make recently-introduced setters macros.
5152 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
5153 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
5154 (set_fontset_default, set_fontset_fallback): Rename from their
5155 upper-case counterparts, and make them functions rather than macros.
5156 This is more consistent with the other recently-introduced setters.
5157 These don't need to be inline, since they're local.
5158
5159 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
5160
5161 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
5162 the loop (Bug#12247).
5163
5164 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5165
5166 * lisp.h (vcopy): Use memcpy rather than our own loop.
5167 This fixes a performance regression introduced by the recent
5168 addition of vcopy. This means 'vcopy' will need to be modified
5169 for a copying collector, but that's OK. Also, tighten the
5170 checking in the assertion.
5171
5172 2012-08-21 Eli Zaretskii <eliz@gnu.org>
5173
5174 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
5175 components for RTL text (Bug#11860). Adjust X-OFFSET of each
5176 non-base glyph for the width of the base character, according to
5177 what x_draw_composite_glyph_string_foreground expects.
5178 Generate WADJUST value according to composition_gstring_width's
5179 expectations, to produce correct width of the composed character.
5180 Reverse the sign of the DU offset produced by ScriptPlace.
5181
5182 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5183
5184 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
5185
5186 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5187
5188 Avoid direct writes to contents member of struct Lisp_Vector.
5189 * lisp.h (vcopy): New function to copy data into vector.
5190 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
5191 * fns.c (Ffillarray): Use ASET.
5192 * keyboard.c (timer_check_2): Use AREF and ASET.
5193 (append_tool_bar_item, Frecent_keys): Use vcopy.
5194 * lread.c (read_vector): Use ASET.
5195 * msdos.c (Frecent_doskeys): Use vcopy.
5196 * xface.c (Finternal_copy_lisp_face): Use vcopy.
5197 (Finternal_merge_in_global_face): Use ASET and vcopy.
5198 * xfont.c (xfont_list_pattern): Likewise.
5199
5200 2012-08-21 Martin Rudalics <rudalics@gmx.at>
5201
5202 * window.c (Fwindow_point): For the selected window always return
5203 the position of its buffer's point.
5204 (Fset_window_point): For the selected window always go in its
5205 buffer to the specified position.
5206
5207 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5208
5209 Setter macros for fontsets.
5210 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
5211 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
5212 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
5213 Adjust users.
5214
5215 2012-08-20 Glenn Morris <rgm@gnu.org>
5216
5217 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5218 Don't assume that `ln -f' works.
5219
5220 2012-08-20 Eli Zaretskii <eliz@gnu.org>
5221
5222 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
5223 and later about non-assignments with no effect. See discussion at
5224 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
5225 details.
5226
5227 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5228
5229 Inline setter functions for Lisp_Objects slots of struct specbinding.
5230 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
5231 Adjust users.
5232
5233 2012-08-20 Martin Rudalics <rudalics@gmx.at>
5234
5235 * window.c (select_window): Always make selected window's buffer
5236 current.
5237
5238 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5239
5240 Use AREF and ASET for docstrings of category tables.
5241 * category.h (CATEGORY_DOCSTRING): Use AREF.
5242 (SET_CATEGORY_DOCSTRING): Use ASET.
5243 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
5244
5245 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5246
5247 Inline setter functions for hash table members.
5248 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
5249 (set_hash_hash, set_hash_index): Rename with _slot suffix.
5250 (set_hash_key_and_value, set_hash_index, set_hash_next)
5251 (set_hash_hash): New functions.
5252 * charset.c, fns.c: Adjust users.
5253
5254 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5255
5256 Inline getter and setter functions for per-buffer values.
5257 * buffer.h (per_buffer_default, set_per_buffer_default)
5258 (per_buffer_value, set_per_buffer_value): New functions.
5259 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
5260 * buffer.c, data.c: Adjust users.
5261
5262 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
5263
5264 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
5265
5266 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
5267
5268 Rely on <config.h> + <unistd.h> to declare 'environ',
5269 as gnulib does this if the system doesn't.
5270 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
5271 Remove declaration. MS-Windows declares it on stdlib.h which is
5272 included by conf_post.h.
5273 * emacs.c (environ) [DOUG_LEA_MALLOC]:
5274 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
5275 * vm-limit.c: Include <unistd.h>, for 'environ'.
5276
5277 * unexaix.c, unexcoff.c: Include "mem-limits.h".
5278 (start_of_data): Remove decl; mem-limits.h provides it.
5279
5280 * xdisp.c (handle_invisible_prop): Make it a bit faster
5281 and avoid a gcc -Wmaybe-uninitialized diagnostic.
5282
5283 2012-08-19 Chong Yidong <cyd@gnu.org>
5284
5285 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
5286 ends (Bug#3874).
5287
5288 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
5289
5290 * .gdbinit: Use call instead of set when calling a function in the
5291 inferior.
5292
5293 * data.c (set_internal): Don't use set_blv_found.
5294 (Fkill_local_variable): Likewise.
5295
5296 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
5297
5298 * nsfont.m (ns_ascii_average_width): Ensure the string
5299 ascii_printable is initialized with a null-terminated character
5300 array. Otherwise, it can contain undesired extra characters.
5301
5302 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5303
5304 port new setting code to Sun C 5.8 2005/10/13
5305 * chartab.c, lisp.h (char_table_set, char_table_set_range):
5306 Return void, not Lisp_Object. Otherwise, the compiler
5307 complains about (A?B:C) where B is void and C is Lisp_Object
5308 when compiling CHAR_TABLE_SET, due to the recent change to
5309 the API of sub_char_table_set_contents.
5310
5311 2012-08-18 Chong Yidong <cyd@gnu.org>
5312
5313 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
5314 for the string case (Bug#3874).
5315
5316 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5317
5318 * buffer.h (BSET): Remove (Bug#12215).
5319 Replace all uses with calls to new setter functions.
5320 (bset_bidi_paragraph_direction, bset_case_canon_table)
5321 (bset_case_eqv_table, bset_directory, bset_display_count)
5322 (bset_display_time, bset_downcase_table)
5323 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
5324 (bset_last_selected_window, bset_local_var_alist)
5325 (bset_mark_active, bset_point_before_scroll, bset_read_only)
5326 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
5327 (bset_width_table):
5328 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5329 (bset_auto_fill_function, bset_auto_save_file_format)
5330 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5331 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5332 (bset_cache_long_line_scans, bset_case_fold_search)
5333 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5334 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5335 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5336 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5337 (bset_header_line_format, bset_indicate_buffer_boundaries)
5338 (bset_indicate_empty_lines, bset_invisibility_spec)
5339 (bset_left_fringe_width, bset_major_mode, bset_mark)
5340 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5341 (bset_name, bset_overwrite_mode, bset_pt_marker)
5342 (bset_right_fringe_width, bset_save_length)
5343 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5344 (bset_scroll_up_aggressively, bset_selective_display)
5345 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5346 (bset_word_wrap, bset_zv_marker):
5347 * category.c (bset_category_table):
5348 * syntax.c (bset_syntax_table):
5349 New setter functions.
5350
5351 * process.h (PSET): Remove (Bug#12215).
5352 Replace all uses with calls to new setter functions.
5353 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5354 (PROCESS_INLINE): New macro.
5355 (pset_childp): New setter function.
5356 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
5357 * process.c (PROCESS_INLINE):
5358 Define to EXTERN_INLINE, so that the corresponding functions
5359 are compiled into code.
5360 (pset_buffer, pset_command, pset_decode_coding_system)
5361 (pset_decoding_buf, pset_encode_coding_system)
5362 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
5363 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
5364 (pset_type, pset_write_queue): New setter functions.
5365
5366 * window.h (WSET): Remove (Bug#12215).
5367 Replace all uses with calls to new setter functions.
5368 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5369 (WINDOW_INLINE): New macro.
5370 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
5371 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
5372 (wset_total_lines, wset_vertical_scroll_bar)
5373 (wset_window_end_pos, wset_window_end_valid)
5374 (wset_window_end_vpos): New setter functions.
5375 * window.c (WINDOW_INLINE):
5376 Define to EXTERN_INLINE, so that the corresponding functions
5377 are compiled into code.
5378 (wset_combination_limit, wset_dedicated, wset_display_table)
5379 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
5380 (wset_new_normal, wset_new_total, wset_next_buffers)
5381 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5382 (wset_prev_buffers, wset_right_fringe_width)
5383 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
5384 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
5385 (wset_window_parameters):
5386 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5387 (wset_column_number_displayed, wset_region_showing):
5388 New setter functions.
5389
5390 * termhooks.h (TSET): Remove (Bug#12215).
5391 Replace all uses with calls to new setter functions.
5392 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5393 (TERMHOOKS_INLINE): New macro.
5394 (tset_charset_list, tset_selection_alist): New setter functions.
5395 * terminal.c (TERMHOOKS_INLINE):
5396 Define to EXTERN_INLINE, so that the corresponding functions
5397 are compiled into code.
5398 (tset_param_alist): New setter function.
5399
5400 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5401
5402 * keyboard.h (KSET): Remove (Bug#12215).
5403 Replace all uses with calls to new setter functions.
5404 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5405 (KEYBOARD_INLINE): New macro.
5406 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
5407 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
5408 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
5409 New setter functions.
5410 * keyboard.c (KEYBOARD_INLINE):
5411 Define to EXTERN_INLINE, so that the corresponding functions
5412 are compiled into code.
5413 (kset_echo_string, kset_kbd_queue)
5414 (kset_keyboard_translate_table, kset_last_prefix_arg)
5415 (kset_last_repeatable_command, kset_local_function_key_map)
5416 (kset_overriding_terminal_local_map, kset_real_last_command)
5417 (kset_system_key_syms): New setter functions.
5418
5419 * frame.h (FSET): Remove (Bug#12215).
5420 Replace all uses with calls to new setter functions.
5421 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5422 (FRAME_INLINE): New macro.
5423 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
5424 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
5425 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
5426 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
5427 (fset_param_alist, fset_root_window, fset_scroll_bars)
5428 (fset_selected_window, fset_title, fset_tool_bar_items)
5429 (fset_tool_bar_position, fset_tool_bar_window): New functions.
5430 * frame.c (FRAME_INLINE):
5431 Define to EXTERN_INLINE, so that the corresponding functions
5432 are compiled into code.
5433 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
5434
5435 A few more naming-convention fixes for getters and setters.
5436 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
5437 and rename from buffer_overlays_set_before.
5438 (set_buffer_overlays_after): Move here from buffer.h, and rename
5439 from buffer_overlays_set_after.
5440 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5441 All uses changed.
5442 (set_buffer_intervals): Rename from buffer_set_intervals.
5443 * intervals.c (set_interval_object): Move here from intervals.h,
5444 and rename from interval_set_object.
5445 (set_interval_left): Move here from intervals.h, and rename from
5446 interval_set_left.
5447 (set_interval_right): Move here from intervals.h, and rename from
5448 interval_set_right.
5449 (copy_interval_parent): Move here from intervals.h, and rename from
5450 interval_copy_parent.
5451 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5452 (set_interval_plist): Rename from interval_set_plist.
5453 Return void, not Lisp_Object, since no caller uses the result.
5454 * lisp.h (string_intervals): Rename from string_get_intervals.
5455 (set_string_intervals): Rename from string_set_intervals.
5456
5457 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5458 (set_char_table_contents): Rename from char_table_set_contents.
5459 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
5460 All uses changed. See the end of
5461 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5462
5463 * lisp.h (CSET): Remove (Bug#12215).
5464 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5465 (set_char_table_purpose): New functions,
5466 replacing CSET. All uses changed. For example, replace
5467 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
5468 "set_char_table_parent (char_table, parent);".
5469 The old version was confusing because it used the same name
5470 'parent' for two different things.
5471
5472 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5473
5474 Functions to get and set Lisp_Object fields of buffer-local variables.
5475 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5476 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5477 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
5478 * data.c, eval.c, frame.c: Adjust users.
5479
5480 2012-08-17 Chong Yidong <cyd@gnu.org>
5481
5482 * xfaces.c (merge_face_vectors): If the target font specfies a
5483 font spec, make the font's attributes take precedence over
5484 directly-specified attributes.
5485 (merge_face_ref): Recognize :font.
5486
5487 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5488
5489 Do not use memcpy for copying intervals.
5490 * intervals.c (reproduce_interval): New function.
5491 (reproduce_tree, reproduce_tree_obj): Use it.
5492 (reproduce_tree_obj): Remove prototype.
5493
5494 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5495
5496 * lisp.h (duration_to_sec_usec): Remove unused decl.
5497
5498 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5499
5500 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5501 to an allocated instance of NSString, not to the class itself.
5502
5503 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
5504
5505 * makefile.w32-in (C_CTYPE_H): New macro.
5506 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5507 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5508 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5509
5510 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5511
5512 Use ASCII tests for character types.
5513 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5514 * xfns.c, xterm.c:
5515 Don't include <ctype.h>; was not needed.
5516 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5517 * sysdep.c, xfaces.c:
5518 Include <c-ctype.h> instead of <ctype.h>.
5519 * nsterm.m: Include <c-ctype.h>.
5520 * charset.c (read_hex):
5521 * doc.c (Fsnarf_documentation):
5522 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5523 (DRIVE_LETTER) [DOS_NT]:
5524 (Ffile_name_directory, Fexpand_file_name)
5525 (Fsubstitute_in_file_name):
5526 * font.c (font_parse_xlfd, font_parse_fcname):
5527 * frame.c (x_set_font_backend):
5528 * gtkutil.c (xg_get_font):
5529 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5530 * nsimage.m (hexchar):
5531 * nsterm.m (ns_xlfd_to_fontname):
5532 * sysdep.c (system_process_attributes):
5533 * xfaces.c (hash_string_case_insensitive):
5534 Use C-locale tests instead of locale-specific tests for character
5535 types, since we want the ASCII interpretation here, not the
5536 interpretation suitable for whatever happens to be the current locale.
5537
5538 2012-08-16 Martin Rudalics <rudalics@gmx.at>
5539
5540 Consistently check windows for validity/liveness
5541 (Bug#11984, Bug#12025, Bug#12026).
5542 * lisp.h (CHECK_VALID_WINDOW): New macro.
5543 * window.c (decode_window): Rename to decode_live_window.
5544 (decode_valid_window, Fwindow_valid_p): New functions.
5545 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5546 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5547 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5548 (Fwindow_prev_sibling, Fwindow_combination_limit)
5549 (Fset_window_combination_limit, Fwindow_use_time)
5550 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5551 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5552 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5553 (Fwindow_hscroll, Fset_window_hscroll)
5554 (Fwindow_redisplay_end_trigger)
5555 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5556 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5557 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5558 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5559 (Fwindow_end, Fset_window_point, Fset_window_start)
5560 (Fpos_visible_in_window_p, Fwindow_line_height)
5561 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5562 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5563 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5564 (Fset_window_parameter, Fwindow_display_table)
5565 (Fset_window_display_table, Fdelete_other_windows_internal)
5566 (Fset_window_buffer, Fset_window_new_total)
5567 (Fset_window_new_normal, Fdelete_window_internal)
5568 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5569 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5570 (Fwindow_scroll_bars): Check whether argument window is a valid or
5571 live window. Update doc-strings.
5572 (syms_of_window): New symbol Qwindow_valid_p.
5573 * keyboard.c (Fposn_at_x_y): Check whether argument
5574 frame_or_window denotes a valid window.
5575
5576 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5577
5578 Fix previous char table change.
5579 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5580 * chartab.c (optimize_sub_char_table): Likewise.
5581
5582 2012-08-16 Chong Yidong <cyd@gnu.org>
5583
5584 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5585
5586 * xfont.c (xfont_open):
5587 * xftfont.c (xftfont_open): Set the font's max_width field.
5588
5589 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5590 min_width to space_width and average_width to the average over
5591 printable ASCII characters.
5592 (ns_char_width): Code cleanup.
5593 (ns_ascii_average_width): New utility function.
5594
5595 * font.h (struct font): Update comments.
5596
5597 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5598
5599 Simple interface to set Lisp_Object fields of character tables.
5600 * lisp.h (CSET): New macro.
5601 (char_table_set_extras, char_table_set_contents)
5602 (sub_char_table_set_contents): New function.
5603 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5604 * syntax.c: Adjust users.
5605
5606 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5607
5608 * eval.c (eval_sub): Bind lexical-binding.
5609 * lread.c (Qlexical_binding): Make non-static.
5610
5611 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5612
5613 * nsmenu.m (popupSession): Remove.
5614 (pop_down_menu): Remove endModalSession.
5615 (timeout_handler:): New method.
5616 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5617 Call runModalForWindow. Check timer_fired when it returns.
5618 If not set, cancel timer and break out of loop.
5619 Otherwise loop again, with a new timeout.
5620
5621 * nsterm.m: Include fcntl.h if present.
5622 (fd_entry, t_readfds, inNsSelect): Remove.
5623 (select_writefds, select_valid, select_timeout, selfds)
5624 (select_mutex, apploopnr): Add.
5625 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5626 Otherwise call kbd_buffer_store_event.
5627 (ns_send_appdefined): Remove release of fd_entry.
5628 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5629 Increment and decrement apploopnr.
5630 (ns_select): If no file descriptors, just do a NSTimer.
5631 Otherwise copy read/write masks and start select thread (fd_handler).
5632 Start main loop and wait for application defined event.
5633 Inform select thread to stop selecting after main loop is exited.
5634 (ns_term_init): Create selfds pipe and set non-blocking.
5635 Initialize select_mutex. Start the select thread (fd_handler).
5636 (fd_handler:): Loop forever, wait for info from the main thread
5637 to either start or stop selecting. When select returns, send
5638 and appdefined event.
5639 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5640 If not call kbd_buffer_store_event.
5641
5642 * nsterm.h (EmacsApp): fd_handler takes id argument.
5643 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5644
5645 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5646
5647 2012-08-15 Eli Zaretskii <eliz@gnu.org>
5648
5649 * region-cache.c (move_cache_gap): Update gap_len using the actual
5650 growth of the boundaries array. Do not change cache_len.
5651 (Bug#12196)
5652
5653 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5654
5655 Generalize and cleanup font subsystem checks.
5656 * font.h (FONT_DEBUG, font_assert): Remove.
5657 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5658 Change font_assert to eassert. Use eassert where appropriate.
5659
5660 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5661
5662 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5663
5664 2012-08-15 Chong Yidong <cyd@gnu.org>
5665
5666 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5667 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5668 extract the font descriptor instead of just the font name.
5669 In that case, return a font spec instead of a string.
5670 (x_last_font_name): Move to this file from xfns.c.
5671
5672 * xfns.c (Fx_select_font): The return value can also be a font
5673 spec. Move x_last_font_name management to gtkutil.c.
5674
5675 * xfaces.c: Make font weight and style symbols non-static.
5676
5677 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5678
5679 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5680 (bug#12117).
5681
5682 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5683
5684 * alloc.c (Fgarbage_collect): Use plural form consistently.
5685
5686 2012-08-14 Eli Zaretskii <eliz@gnu.org>
5687
5688 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5689 iteration through the command loop. Fixes a problem whereby mouse
5690 movements are ignored until the first mouse click.
5691
5692 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5693
5694 Use bool, not int, for Lisp booleans.
5695 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5696 makes Emacs a bit smaller and presumably a bit faster.
5697 * lisp.h: Include <stdbool.h>.
5698 (struct Lisp_Boolfwd, defvar_bool):
5699 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5700 * regex.c [!emacs]: Include <stdbool.h>.
5701 (false, true): Remove; <stdbool.h> does this for us now.
5702
5703 2012-08-14 Chong Yidong <cyd@gnu.org>
5704
5705 * character.c (Fcharacterp): Doc fix (Bug#12076).
5706
5707 * data.c (Findirect_variable): Doc fix (Bug#11040).
5708
5709 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5710
5711 * editfns.c (Fformat): Doc fix (Bug#12059).
5712 (Fsave_current_buffer): Doc fix (Bug#11542).
5713
5714 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5715
5716 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5717 (bug#12022).
5718
5719 2012-08-14 Martin Rudalics <rudalics@gmx.at>
5720
5721 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5722 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5723 * minibuf.c (choose_minibuf_frame, read_minibuf):
5724 * w32fns.c (x_create_tip_frame):
5725 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5726 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5727
5728 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5729
5730 * intervals.c (offset_intervals): Remove obsolete comment.
5731
5732 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5733
5734 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5735
5736 2012-08-14 Gergely Risko <gergely@risko.hu>
5737
5738 * coding.c (decode_coding): Record buffer modification before
5739 disabling undo_list (Bug#11773).
5740
5741 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5742
5743 Revert and cleanup some recent overlay changes.
5744 * buffer.h (enum overlay_type): Remove.
5745 (buffer_get_overlays, buffer_set_overlays): Likewise.
5746 (buffer_set_overlays_before, buffer_set_overlays_after):
5747 New function. Adjust users.
5748 (unchain_both): Add eassert.
5749
5750 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5751
5752 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5753
5754 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5755
5756 * gtkutil.c (xg_mark_data): Don't assume C99.
5757
5758 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5759
5760 * gtkutil.c (xg_frame_tb_info): New struct.
5761 (TB_INFO_KEY): New define.
5762 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5763 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5764 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5765 if not present.
5766 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5767 is up to date. Otherwise store new data.
5768 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5769
5770 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5771
5772 Use KSET for write access to Lisp_Object members of struct kboard.
5773 * keyboard.h (KSET): New macro.
5774 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5775 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5776 * xterm.c: Adjust users.
5777
5778 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5779
5780 Use BSET for write access to Lisp_Object members of struct buffer.
5781 * buffer.h (BSET): New macro.
5782 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5783 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5784 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5785 * window.c, xdisp.c, xfns.c: Adjust users.
5786
5787 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5788
5789 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5790
5791 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5792
5793 * nsterm.m (not_in_argv): New function.
5794 (application:openFile, application:openTempFile:):
5795 (application:openFileWithoutUI:, application:openFiles:): Open file
5796 if not_in_argv returns non-zero (bug#12171).
5797
5798 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5799 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5800 Define for Gtk+ versions less than 3.2.
5801 (xg_get_font_name): Use those functions/macros here.
5802 Reported by Frans Oilinki <moilinki@gmail.com>.
5803
5804 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5805
5806 * unexmacosx.c (copy_data_segment): Copy initialized data in
5807 statically linked libraries from input file rather than memory.
5808
5809 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5810 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5811 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5812
5813 2012-08-10 Glenn Morris <rgm@gnu.org>
5814
5815 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5816 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5817
5818 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5819
5820 Fix last change to allow compilation with low optimization levels.
5821 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5822 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5823
5824 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5825
5826 Use common inline syntax in intervals.h.
5827 * intervals.h (INTERVALS_INLINE): New macro.
5828 Change all users from LISP_INLINE.
5829
5830 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5831
5832 Define Qnone once for all platforms.
5833 * frame.c (Qnone): Define here.
5834 (syms_of_frame): DEFSYM it.
5835 * lisp.h (Qnone): New declaration.
5836 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5837 * xfns.c: Remove duplication. Adjust users.
5838
5839 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5840
5841 Remove unused macros from intervals.h.
5842 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5843 * intervals.c: Adjust comment.
5844
5845 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5846
5847 * w32fns.c <w32_unicode_gui>: New static variable.
5848 (globals_of_w32fns): Initialize it according to os_subtype.
5849 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5850 testing os_subtype.
5851
5852 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5853 Eli Zaretskii <eliz@gnu.org>
5854
5855 Fix bug #10299 with Unicode characters sent by customized
5856 keyboards created by MSKLC.
5857 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5858 (w32_init_class): Use it to initialize the Emacs class with either
5859 ANSI or Unicode API calls.
5860 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5861 later.
5862 (w32_wnd_proc): If the character code sent by WM_CHAR or
5863 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5864 original message. Call DefWindowProcW on NT and later.
5865
5866 2012-08-10 Glenn Morris <rgm@gnu.org>
5867
5868 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5869
5870 * lisp.h (DIRECTORY_SEP): Let configure set it.
5871
5872 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5873
5874 Use TSET for write access to Lisp_Object slots of struct terminal.
5875 * termhooks.h (TSET): New macro.
5876 * coding.c, terminal.c, xselect.c: Adjust users.
5877
5878 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5879
5880 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5881 the failing expression, include them in the error message.
5882 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5883 * lisp.h (internal_condition_case_n): Update declaration.
5884
5885 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5886
5887 Inline functions to examine and change buffer overlays.
5888 * buffer.c (unchain_both): New function.
5889 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5890 (buffer_has_overlays): New function.
5891 (enum overlay_type): New enum.
5892 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5893 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5894
5895 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5896
5897 Inline functions to examine and change buffer intervals.
5898 * alloc.c (mark_interval_tree): Remove.
5899 (MARK_INTERVAL_TREE): Simplify.
5900 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5901 * intervals.c (buffer_balance_intervals): New function.
5902 (graft_intervals_into_buffer): Adjust indentation.
5903 (set_intervals_multibyte): Simplify.
5904 * buffer.h (BUF_INTERVALS): Remove.
5905 (buffer_get_intervals, buffer_set_intervals): New function.
5906 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5907 * intervals.c, textprop.c: Adjust users.
5908
5909 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5910
5911 Inline functions to examine and change string intervals.
5912 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5913 (string_get_intervals, string_set_intervals): New function.
5914 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5915 * lread.c, print.c, textprop.c: Adjust users.
5916
5917 2012-08-08 Glenn Morris <rgm@gnu.org>
5918
5919 * lisp.mk (lisp): Remove language/persian.elc.
5920
5921 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5922
5923 Cleanup intervals.
5924 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5925 (NULL_INTERVAL_P): Likewise. Adjust users.
5926 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5927 Adjust comment. Move under #if 0.
5928 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5929 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5930
5931 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5932
5933 Check total length of intervals with eassert.
5934 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5935 * intervals.c: Change all users to eassert.
5936
5937 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5938
5939 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5940 Rename fields to match removal of FGET and WGET and disuse of
5941 INTERNAL_FIELD in Lisp_Cons.
5942
5943 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5944
5945 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5946 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5947 name since all xname users are fixed long time ago. Do not
5948 use INTERNAL_FIELD.
5949 (set_symbol_name, set_symbol_function, set_symbol_plist):
5950 (set_symbol_next, set_overlay_plist): New function.
5951 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5952 (struct Lisp_Overlay): Likewise.
5953 (CVAR, MVAR, SVAR): Remove.
5954 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5955 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5956 * xterm.c: Adjust users.
5957 * .gdbinit: Change to use name field of struct Lisp_Symbol
5958 where appropriate.
5959
5960 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5961
5962 Basic functions to set Lisp_Object and pointer slots of intervals.
5963 * intervals.h (interval_set_parent, interval_set_object):
5964 (interval_set_left, interval_set_right, interval_set_plist):
5965 (interval_copy_parent): New function.
5966 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5967 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5968 Adjust indentation.
5969 (INTERVAL_SIZE): Remove. Adjust users.
5970 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5971
5972 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5973
5974 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5975 * process.h (PGET): Remove.
5976 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5977 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5978
5979 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5980
5981 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5982 * window.h (WGET): Remove.
5983 (struct window): Do not use INTERNAL_FIELD.
5984 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5985 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5986 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5987 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5988 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5989 Adjust users.
5990
5991 2012-08-07 Chong Yidong <cyd@gnu.org>
5992
5993 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5994 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5995 (Fdelete_window_internal): Signal an error if the window is not on
5996 a live frame (Bug#12025).
5997
5998 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5999
6000 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
6001 * frame.h (FGET): Remove.
6002 (struct frame): Do not use INTERNAL_FIELD.
6003 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6004 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6005 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6006 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6007
6008 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
6009
6010 * w32.c: Silence compiler warnings.
6011 (map_w32_filename): Remove unused variable `is_fat'.
6012 (chase_symlinks): Add parentheses around expression.
6013
6014 2012-08-06 Glenn Morris <rgm@gnu.org>
6015
6016 * sysdep.c: Respect BROKEN_GETWD.
6017
6018 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
6019 Let configure handle it.
6020 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
6021
6022 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6023
6024 Use GCALIGNMENT where appropriate.
6025 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
6026 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
6027 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
6028
6029 2012-08-06 Eli Zaretskii <eliz@gnu.org>
6030
6031 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
6032 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
6033
6034 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
6035
6036 * buffer.h (struct buffer): Revert `indirections' to a simple int;
6037 that should be sufficient for everyone.
6038
6039 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6040
6041 * keyboard.c (timer_check_2): Add break so timer_check returns next
6042 timeout.
6043
6044 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6045
6046 Fix Windows build errors introduced after converting to WGET and WSET.
6047 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
6048 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6049
6050 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6051
6052 * nsterm.m (ns_frame_rehighlight): Use FSET.
6053
6054 * nsmenu.m (ns_update_menubar): Use FSET.
6055
6056 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6057
6058 Separate read and write access to Lisp_Object slots of Lisp_Process.
6059 * process.h (PGET, PSET): New macros similar to AREF and ASET.
6060 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6061
6062 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6063
6064 Separate read and write access to Lisp_Object slots of struct window.
6065 * window.h (WGET, WSET): New macros similar to AREF and ASET.
6066 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6067 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6068 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6069 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6070 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6071 Adjust users.
6072
6073 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6074
6075 Fix Windows build errors introduced after converting to FGET and FSET.
6076 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
6077 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
6078 (w32_judge_scroll_bars): Change to use FSET.
6079 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6080
6081 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6082
6083 Fix replacement typo.
6084 * window.c (replace_window): Set root_window instead of
6085 selected_window. This fixes a total window subsystem
6086 malfunction reported by Bastien Guerry <bzg@gnu.org>.
6087
6088 2012-08-06 Glenn Morris <rgm@gnu.org>
6089
6090 * lisp.mk (lisp): Add language/persian.elc.
6091
6092 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6093
6094 Separate read and write access to Lisp_Object slots of struct frame.
6095 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
6096 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6097 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6098 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6099 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6100
6101 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
6102
6103 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
6104
6105 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
6106
6107 Generalize common compile-time constants.
6108 * lisp.h (header_size, bool_header_size, word_size): Now here.
6109 (struct Lisp_Vector): Add comment.
6110 (struct Lisp_Bool_Vector): Move up to define handy constants.
6111 (VECSIZE, PSEUDOVECSIZE): Simplify.
6112 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
6113 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
6114 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
6115 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
6116 * xfont.c, xmenu.c: Use word_size where appropriate.
6117
6118 2012-08-05 Lawrence Mitchell <wence@gmx.li>
6119
6120 * search.c (Freplace_match): Treat \? in the replacement text
6121 literally (Bug#8161).
6122
6123 2012-08-05 Chong Yidong <cyd@gnu.org>
6124
6125 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
6126 * frame.c (Vdelete_frame_functions):
6127 * emacs.c (Vkill_emacs_hook): Doc fix.
6128
6129 2012-08-04 Eli Zaretskii <eliz@gnu.org>
6130
6131 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
6132 --with-x-toolkit=no builds.
6133 Reported by Carsten Mattner <carstenmattner@gmail.com>.
6134
6135 2012-08-04 Chong Yidong <cyd@gnu.org>
6136
6137 * syntax.c (Fmodify_syntax_entry): Doc fix.
6138
6139 2012-08-04 Eli Zaretskii <eliz@gnu.org>
6140
6141 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
6142 * w32.c (init_environment): Change the default values of many
6143 environment variables in dflt_envvars[] to NULL, to avoid pushing
6144 them into environment when they were not already defined.
6145 Remove the code that deletes site-lisp subdirectories from the default
6146 value of EMACSLOADPATH, as it is no longer needed.
6147 (check_windows_init_file): Now external, not static.
6148 Use Vload_path as is, without adding anything, as this function is now
6149 called when Vload_path is already set up.
6150
6151 * w32.h (check_windows_init_file): Add prototype.
6152
6153 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
6154 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
6155 compatibility with Posix platforms.
6156 (main): Move the call to check_windows_init_file to here from
6157 w32.c.
6158 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
6159 any, in the DEFALT argument into the root of the Emacs build or
6160 installation tree, as appropriate.
6161
6162 * callproc.c (init_callproc_1): Call decode_env_path instead of
6163 doing its equivalent by hand.
6164 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
6165 the code that sets Vexec_path run on MS-Windows.
6166
6167 * lread.c (init_lread): Add comments to #ifdef's.
6168
6169 * msdos.c (dos_set_window_size, IT_update_begin)
6170 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
6171 instead of direct references.
6172
6173 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
6174
6175 Export DEFAULT_REHASH_* to GDB.
6176 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
6177 Now constants, not macros.
6178
6179 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
6180
6181 Remove unnecessary casts involving pointers.
6182 These casts are no longer needed now that we assume C89 or later,
6183 since they involve casting to or from void *.
6184 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
6185 (make_pure_float, make_pure_vector):
6186 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
6187 * macros.c (Fstart_kbd_macro):
6188 * menu.c (find_and_return_menu_selection):
6189 * minibuf.c (read_minibuf_noninteractive):
6190 * sysdep.c (closedir):
6191 * xdisp.c (x_produce_glyphs):
6192 * xfaces.c (compare_fonts_by_sort_order):
6193 * xfns.c (x_real_positions, select_visual):
6194 * xselect.c (x_stop_queuing_selection_requests)
6195 (x_get_window_property, x_get_window_property_as_lisp_data):
6196 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
6197 Remove unnecessary pointer casts.
6198 * alloc.c (record_xmalloc): New function.
6199 * lisp.h (record_xmalloc): New decl.
6200 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
6201 more like a function. This is because the pointer cast is not
6202 needed. All uses changed.
6203 * print.c (print_string, print_error_message): Avoid length recalc.
6204
6205 Improve fix for macroexp crash with debugging (Bug#12118).
6206 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
6207 ARRAY_MARK_FLAG when checking subscripts, because ASET is
6208 not supposed to be invoked from the garbage collector.
6209 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
6210 (gc_aset): New function, which is like ASET but can be
6211 used in the garbage collector.
6212 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6213 (set_hash_index): Use it instead of ASET.
6214
6215 2012-08-03 Eli Zaretskii <eliz@gnu.org>
6216
6217 Support symlinks on latest versions of MS-Windows.
6218 * w32.c: Include winioctl.h and aclapi.h.
6219 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
6220 (revert_to_self): Forward declarations of static functions.
6221 <static BOOL g_b_init_get_security_info>:
6222 <g_b_init_create_symbolic_link>: New static flags.
6223 (globals_of_w32): Initialize them to zero.
6224 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
6225 (map_w32_filename): Improve commentary. Simplify switch.
6226 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
6227 headers (most versions of MinGW w32api don't).
6228 (get_security_info, create_symbolic_link)
6229 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
6230 New functions.
6231 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
6232 in the argument file name.
6233 (sys_access): Call unc_volume_file_attributes only if
6234 GetFileAttributes fails with network-related error codes.
6235 (sys_rename): Diagnose renaming of a symlink when the user doesn't
6236 have the required privileges.
6237 (get_file_security_desc_by_name): Rename from
6238 get_file_security_desc.
6239 (stat_worker): New function, with most of the guts of 'stat', and
6240 with addition of handling of symlinks and support for 'lstat'.
6241 If possible, get file's attributes and security information by
6242 handle, not by name. Produce S_IFLNK bit for symlinks, when
6243 called from 'lstat'.
6244 (stat, lstat): New functions, call 'stat_worker'.
6245 (symlink, readlink, careadlinkat): Rewritten to create and resolve
6246 symlinks when the underlying filesystem supports them.
6247
6248 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6249
6250 Fix macroexp crash on Windows with debugging (Bug#12118).
6251 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
6252 checking subscripts; problem introduced with the recent
6253 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
6254 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
6255 since it's used in non-static inline functions now.
6256
6257 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
6258 Don't assume buffer size fits in 'int'. Remove unused local.
6259
6260 Use C99-style 'extern inline' if available.
6261 * buffer.h (BUFFER_INLINE):
6262 * category.h (CATEGORY_INLINE):
6263 * character.h (CHARACTER_INLINE):
6264 * charset.h (CHARSET_INLINE):
6265 * composite.h (COMPOSITE_INLINE):
6266 * dispextern.h (DISPEXTERN_INLINE):
6267 * lisp.h (LISP_INLINE):
6268 * systime.h (SYSTIME_INLINE):
6269 New macro, replacing 'static inline' in this header.
6270 * buffer.h, category.h, character.h, charset.h, composite.h:
6271 * dispextern.h, lisp.h, systime.h:
6272 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6273 * alloc.c (LISP_INLINE):
6274 * buffer.c (BUFFER_INLINE):
6275 * category.c (CATEGORY_INLINE):
6276 * character.c (CHARACTER_INLINE):
6277 * charset.c (CHARSET_INLINE):
6278 * composite.c (COMPOSITE_INLINE):
6279 * dispnew.c (DISPEXTERN_INLINE):
6280 * sysdep.c (SYSTIME_INLINE):
6281 Define to EXTERN_INLINE, so that the corresponding functions
6282 are compiled into code.
6283 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
6284 (INLINE_HEADER_END): New macros.
6285 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
6286 since it's used in non-static inline functions now.
6287 (VALMASK) [!USE_LSB_TAG]: Likewise.
6288
6289 2012-08-02 Glenn Morris <rgm@gnu.org>
6290
6291 * s/: Remove empty directory.
6292
6293 * s/ms-w32.h: Move to ../nt/inc.
6294 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
6295 Update for new ms-w32.h location.
6296
6297 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6298
6299 Port to Solaris 8.
6300 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
6301
6302 2012-08-02 Glenn Morris <rgm@gnu.org>
6303
6304 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
6305 hard-coding the path separator.
6306
6307 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6308
6309 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
6310 This how ASET and AREF are supposed to work, and makes
6311 it easier to think about future improvements. See
6312 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
6313 * charset.h (set_charset_attr): New function.
6314 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
6315 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
6316 (aref_addr): New function. All uses of &AREF(...) changed.
6317 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6318 (set_hash_index): New functions. All lvalue-style uses of
6319 HASH_KEY etc. changed.
6320 * keyboard.c (set_prop): New function. All lvalue-style uses
6321 of PROP changed.
6322
6323 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
6324
6325 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
6326 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
6327 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
6328 * nsfns.m (ns_set_name_as_filename): Likewise.
6329 * nsmenu.m (ns_update_menubar): Likewise.
6330 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
6331
6332 2012-08-01 Eli Zaretskii <eliz@gnu.org>
6333
6334 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
6335 Adapt to latest changes in field names of the corresponding Lisp
6336 objects.
6337
6338 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
6339
6340 2012-08-01 Glenn Morris <rgm@gnu.org>
6341
6342 * s/msdos.h: Remove file.
6343 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
6344 * Makefile.in (S_FILE): Remove.
6345 (config_h): Remove S_FILE.
6346
6347 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
6348
6349 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
6350 Remove; moved to nt/config.nt.
6351
6352 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6353
6354 Use INTERNAL_FIELD for conses and overlays.
6355 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
6356 Remove obsolete comment.
6357 (MVAR): New macro.
6358 (struct Lisp_Overlay): Use INTERNAL_FIELD.
6359 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
6360
6361 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6362
6363 Use INTERNAL_FIELD for symbols.
6364 * lisp.h (SVAR): New macro. Adjust users.
6365 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
6366 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
6367
6368 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6369
6370 Use INTERNAL_FIELD for processes.
6371 * process.h (PVAR): New macro. Adjust style.
6372 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
6373 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
6374
6375 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6376
6377 Use INTERNAL_FIELD for windows.
6378 * window.h (WVAR): New macro.
6379 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
6380 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6381 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6382 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
6383 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
6384 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6385
6386 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6387
6388 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
6389
6390 2012-08-01 Glenn Morris <rgm@gnu.org>
6391
6392 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
6393 Move to configure.ac.
6394
6395 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
6396
6397 * makefile.w32-in (CONFIG_H): Update dependencies.
6398 (CONF_POST_H): New macro.
6399
6400 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
6401
6402 2012-07-31 Glenn Morris <rgm@gnu.org>
6403
6404 * Makefile.in (S_FILE): No longer set by configure.
6405
6406 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
6407 is available.
6408 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
6409
6410 * process.h (NULL_DEVICE):
6411 * emacs.c (SEPCHAR):
6412 * editfns.c (USER_FULL_NAME): Let configure set them.
6413
6414 * s/README, s/template.h: Remove files.
6415
6416 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
6417
6418 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
6419 Move to configure.ac.
6420
6421 2012-07-31 Eli Zaretskii <eliz@gnu.org>
6422
6423 * .gdbinit (xframe): Adapt to introduction of FVAR and the
6424 resulting renaming of 'struct frame' members.
6425
6426 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
6427
6428 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
6429 after introduction of FVAR.
6430
6431 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6432
6433 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
6434
6435 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
6436 instead of compositeToPoint.
6437 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
6438
6439 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
6440
6441 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6442
6443 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6444 * lisp.h (INTERNAL_FIELD): New macro.
6445 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
6446 (BVAR): Change to use INTERNAL_FIELD.
6447 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6448 (KVAR): Change to use INTERNAL_FIELD.
6449 * frame.h (FVAR): New macro.
6450 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
6451 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6452 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6453 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6454 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6455
6456 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6457
6458 Miscellaneous fixes for non-default X toolkits.
6459 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6460 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6461 Move under #ifdef USE_LUCID.
6462 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6463 definition and usage to avoid warnings.
6464
6465 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6466
6467 * nsterm.m (openFiles): Fix previous checkin.
6468
6469 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6470
6471 * indent.c (compute_motion): Remove unused local.
6472
6473 2012-07-31 Glenn Morris <rgm@gnu.org>
6474
6475 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6476
6477 * conf_post.h [USG5_4]:
6478 Move remaining contents of s/usg5-4-common.h here.
6479 * s/usg5-4-common.h: Remove file.
6480
6481 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6482 * s/irix6-5.h: Remove file.
6483
6484 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6485 * s/darwin.h: Remove file.
6486
6487 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6488 * s/hpux10-20.h: Remove file, which is now empty.
6489
6490 2012-07-30 Glenn Morris <rgm@gnu.org>
6491
6492 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6493 * Makefile.in (config_h): Add conf_post.h.
6494 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6495
6496 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6497
6498 * nsterm.m (ns_do_open_file): New variable.
6499 (ns_term_init): Set ns_do_open_file to YES after run returns.
6500 (openFile, openTempFile, openFileWithoutUI, openFiles):
6501 Open files only if ns_do_open_file.
6502
6503 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6504
6505 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6506 This no-op macro hasn't been needed for many years.
6507 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6508
6509 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6510 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6511 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6512 gdb_make_enums_visible.
6513 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6514 (DIRECTORY_SEP): Now a constant, not a macro.
6515
6516 2012-07-30 Eli Zaretskii <eliz@gnu.org>
6517
6518 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6519 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6520
6521 * w32term.c <w32_keyboard_codepage>: Renamed from
6522 keyboard_codepage and now external. All users changed.
6523
6524 * w32term.h: Add declaration of w32_keyboard_codepage.
6525
6526 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6527 the codepage to translate keys to Unicode. If this argument is
6528 -1, use the value returned by GetConsoleCP. All callers changed.
6529
6530 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6531
6532 Update .PHONY listings in makefiles.
6533 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6534 bootstrap-clean, distclean, maintainer-clean, versioclean,
6535 extraclean, frc.
6536
6537 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6538 This is a bit clearer. Fix some commentary typos.
6539
6540 2012-07-30 Glenn Morris <rgm@gnu.org>
6541
6542 * s/netbsd.h: Let configure include signal.h if needed.
6543 Remove file, which is now empty.
6544
6545 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6546 Let configure set them.
6547 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6548 No more need to undefine.
6549
6550 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6551
6552 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6553 non-single-byte char when adding meta modifier. (Bug#12090)
6554
6555 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6556
6557 Convert safe_call to use variable number of arguments.
6558 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6559 (safe_call2): Fix comment.
6560 * lisp.h (safe_call): Adjust prototype.
6561 * coding.c (encode_coding_object): Change to use safe_call2.
6562 * xfaces.c (merge_face_heights): Change to use safe_call1.
6563
6564 2012-07-30 Glenn Morris <rgm@gnu.org>
6565
6566 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
6567 does that unconditionally. Remove file, which is now empty.
6568
6569 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6570 Remove empty files.
6571
6572 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6573
6574 Export to GDB most of lisp.h's remaining object-like macros.
6575 * lisp.h (min, max): Move earlier, because they're used earlier now.
6576 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6577 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6578 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6579 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6580 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6581 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6582 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6583 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6584 Now constants, for GDB. They need not be macros.
6585 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6586 Now constants, for GDB, as well as macros, for static initializers.
6587 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6588 Move to after the definition of struct Lisp_Char_Table,
6589 since the former now needs that type defined.
6590 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6591 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6592 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6593 New enums, for gdb_make_enums_visible.
6594 (GLYPH_MODE_LINE_FACE): Remove; unused.
6595 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
6596 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6597 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6598 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6599 enum maxargs, enum MAX_ALLOCA.
6600 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6601 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6602 no longer needed, now that they are done in lisp.h.
6603
6604 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6605
6606 Cleanup string bytes checking.
6607 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6608 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6609 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6610 (check_sblock, compact_small_strings): Simplify.
6611
6612 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6613
6614 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6615 These macros are confusing and no longer need to be defined, as
6616 the enum values now suffice. All uses replaced with definiens.
6617 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6618
6619 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
6620
6621 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6622 ($(BLD)/w32console.$(O)): Update dependencies.
6623
6624 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6625
6626 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6627 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6628 time. Adjust users.
6629 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6630
6631 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6632
6633 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6634 setting sitelisp (Bug#12010).
6635
6636 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6637
6638 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
6639
6640 * w32heap.c (cache_system_info):
6641 * w32.c (sys_rename):
6642 * w32proc.c (find_child_console, sys_kill): All users changed.
6643
6644 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6645
6646 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6647
6648 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6649
6650 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6651
6652 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6653
6654 Cleanup statistics calculation in Fgarbage_collect.
6655 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6656 Fix zombies percentage calculation. Simplify elapsed time calculation.
6657
6658 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6659
6660 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6661 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6662 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6663 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6664 (replace_range, replace_range_2, del_range_2): Change to eassert.
6665 * marker.c (byte_char_debug_check): Adjust style.
6666
6667 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6668
6669 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6670 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6671 long-ago-commented-out code that talks about "WIN32".
6672 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6673 All uses changed.
6674
6675 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6676
6677 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6678 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6679 Simplify by using alignof.
6680 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6681 * lisp.h: Include <stdalign.h>.
6682 (GCALIGNMENT): New macro and constant.
6683 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6684 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6685 (stdalign): New macro, if not already defined.
6686
6687 2012-07-28 Eli Zaretskii <eliz@gnu.org>
6688
6689 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6690 * w32inevt.c: Include w32inevt.h.
6691 (w32_read_console_input): New inline function, calls either
6692 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6693 w32_console_unicode_input.
6694 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6695 (w32_kbd_patch_key, key_event): Use the codepage returned by
6696 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6697 (key_event): use uChar.UnicodeChar only if
6698 w32_console_unicode_input is non-zero.
6699
6700 * w32console.c: Include w32heap.h.
6701 <w32_console_unicode_input>: New global variable.
6702 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6703 family of Windows, zero otherwise.
6704
6705 * w32inevt.h: Declare w32_console_unicode_input.
6706
6707 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6708 --without-x. (Bug#11742)
6709
6710 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6711
6712 Adjust GDB to reflect pvec_type changes (Bug#12036).
6713 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6714 2012-07-04 changes to pseudovector representation.
6715 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6716
6717 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
6718
6719 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6720 bus address.
6721 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6722
6723 2012-07-27 Eli Zaretskii <eliz@gnu.org>
6724
6725 * alloc.c (listn): Fix the order the arguments are consed onto the
6726 list.
6727
6728 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6729 enumeration constants, as PURE and HEAP are too general, and clash
6730 with other headers and sources, such as gmalloc.c and the
6731 MS-Windows system headers. All users changed.
6732
6733 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6734
6735 Revert last save_excursion_save and save_excursion_restore changes.
6736 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6737 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6738
6739 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6740
6741 Fix recently-introduced typos in Windows port.
6742 Reported by Martin Rudalics <rudalics@gmx.at>.
6743 * w32.c (init_environment): Replace comma with semicolon.
6744 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6745
6746 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6747
6748 Improve GDB symbol export (Bug#12036).
6749 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6750 arms of an 'if', not using conditional expressions; otherwise GDB
6751 complains about the types in the unevaluated arm when the argument
6752 is an integer literal.
6753 (xgetint): Simplify expression.
6754 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6755 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6756 Zaretskii in <http://bugs.gnu.org/12036#13>.
6757 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6758 needed now that we have gdb_make_enums_visible.
6759 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6760 (enum enum_USE_LSB_TAG):
6761 New enum types, packaging up enums that need to be exported to GDB.
6762
6763 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6764
6765 Utility function to make a list from specified amount of objects.
6766 * lisp.h (enum constype): New datatype.
6767 (listn): New prototype.
6768 * alloc.c (listn): New function.
6769 (Fmemory_use_count, syms_of_alloc): Use it.
6770 * buffer.c (syms_of_buffer): Likewise.
6771 * callint.c (syms_of_callint): Likewise.
6772 * charset.c (define_charset_internal): Likewise.
6773 * coding.c (syms_of_coding): Likewise.
6774 * keymap.c (syms_of_keymap): Likewise.
6775 * search.c (syms_of_search): Likewise.
6776 * syntax.c (syms_of_syntax): Likewise.
6777 * w32.c (init_environment): Likewise.
6778 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6779 * xdisp.c (syms_of_xdisp): Likewise.
6780 * xfns.c (syms_of_xfns): Likewise.
6781
6782 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6783
6784 Fast save_excursion_save and save_excursion_restore.
6785 * lisp.h (struct Lisp_Excursion): New data type.
6786 (PVEC_EXCURSION): New pseudovector type.
6787 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6788 to deal with it. Adjust comments.
6789 (init_marker, attach_marker): New prototype.
6790 (unchain_marker): Adjust prototype.
6791 * marker.c (attach_marker): Change to global.
6792 (init_marker): New function.
6793 * alloc.c (Fmake_marker, build_marker): Use it.
6794 (build_marker): More easserts.
6795 (mark_object): Handle struct Lisp_Excursion.
6796 * editfns.c (save_excursion_save, save_excursion_restore):
6797 Reimplement to use struct Lisp_Excursion. Add comments.
6798
6799 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6800
6801 Fix export of symbols to GDB (Bug#12036).
6802 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6803 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6804 emacs.c, as this is a more-suitable home. Had this been done earlier
6805 the fix for 12036 would have avoided some of the problems noted in
6806 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6807 would have been more obvious.
6808 * emacs.c: Do not include <verify.h>; no longer needed.
6809 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6810 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6811 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6812 Remove; now done in lisp.h.
6813 * lisp.h (PUBLISH_TO_GDB): New macro.
6814 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6815 (DATA_SEG_BITS): Use it.
6816 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6817 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6818 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6819 not be usable in #if. This simplifies things.
6820
6821 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6822
6823 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6824
6825 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6826
6827 Simplify export of symbols to GDB (Bug#12036).
6828 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6829 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6830 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6831 Adjust to changes in lisp.h and emacs.c, by using
6832 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6833 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6834 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6835 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6836 instead of gdb_valbits.
6837 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6838 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6839 instead of gdb_array_mark_flag.
6840 (xboolvector): Get size from $->size, not $->header.size.
6841 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6842 (xreload, hook-run, hookpost-run): Remove.
6843 * emacs.c: Include <verify.h>.
6844 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6845 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6846 Remove.
6847 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6848 (gdb_USE_LSB_TAG): New enum constants.
6849 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6850 Also define these as enum constants, so they're visible to GDB.
6851 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6852 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6853 as constants, so they're visible to GDB.
6854 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6855 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6856 Now enum constants, not macros, so they're visible to GDB.
6857 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6858 more convenient now. All uses changed.
6859 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6860 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6861
6862 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6863
6864 Explicitly free restriction data that are not needed anymore.
6865 * editfns.c (save_restriction_restore): Free restriction data.
6866
6867 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6868
6869 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6870 add argument, tune behavior, and adjust all callers.
6871
6872 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6873
6874 Use typedef for EMACS_INT, EMACS_UINT.
6875 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6876 than macros. This simplifies debugging in the usual case, since
6877 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6878 and it allows expressions involving EMACS_INT casts.
6879 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6880
6881 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6882
6883 * nsterm.m (ns_read_socket): Return early if there is a modal
6884 window (Bug#12043).
6885
6886 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6887
6888 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6889 that FOCUS-FRAME can be omitted.
6890
6891 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6892
6893 Adjust buffer text indirection counters at the end of Fkill_buffer.
6894 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6895 buffer is definitely dead. This should really fix an issue reported
6896 by Christoph Scholtes again. (Bug#12007).
6897 (init_buffer_once): Initialize indirection counters of
6898 buffer_defaults and buffer_local_symbols (for sanity and safety).
6899
6900 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6901
6902 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6903 and continuation glyphs on tooltip frames, leave them at zero.
6904 Avoids continued lines in tooltips. (Bug#11832)
6905
6906 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6907
6908 Simplify copy_overlay.
6909 * buffer.c (copy_overlay): Simplify. Use build_marker.
6910 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6911
6912 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6913
6914 * print.c (print_object): Don't crash when a frame's name is nil
6915 or invalid. (Bug#12025)
6916
6917 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6918 it signals an error when a tooltip frame is being created.
6919
6920 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6921
6922 Cleanup miscellaneous objects allocation and initialization.
6923 * alloc.c (allocate_misc): Change to static. Add argument to
6924 specify the subtype. Adjust comment and users.
6925 (build_overlay): New function.
6926 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6927 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6928 (allocate_misc): Remove prototype.
6929 (build_overlay): Add prototype.
6930
6931 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6932
6933 Swap buffer text indirection counters in Fbuffer_swap_text.
6934 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6935 This avoids crash reported by Christoph Scholtes at
6936 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6937
6938 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6939
6940 * nsmenu.m (Popdown_data): New struct.
6941 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6942 free Popdown_data.
6943 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6944 (initWithContentRect): Make imgView and contentView non-static
6945 and autorelease them. Also autorelease img and matrix (Bug#12005).
6946 (dealloc): Remove (Bug#12005).
6947
6948 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6949
6950 Adjust consing_since_gc when objects are explicitly freed.
6951 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6952 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6953 (free_cons, free_misc): Subtract object size from consing_since_gc.
6954
6955 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6956
6957 Simplify and cleanup markers positioning code.
6958 * marker.c (attach_marker): More useful eassert.
6959 (live_buffer, set_marker_internal): New function.
6960 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6961 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6962
6963 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6964
6965 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6966 as it's limited by the amount of memory, not by INT_MAX.
6967
6968 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6969
6970 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6971 in special-event-map. See the discussion at
6972 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6973 for the reasons.
6974
6975 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6976 info.dwItemData. Fixes crashes on 64-bit Windows.
6977 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6978
6979 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6980
6981 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6982 (conversationIdentifier): Return value is NSInteger.
6983 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6984
6985 2012-07-21 Chong Yidong <cyd@gnu.org>
6986
6987 * window.c (decode_any_window): Signal an error if the window is
6988 on a dead frame (Bug#11984).
6989
6990 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6991
6992 Add indirection counting to speed up Fkill_buffer.
6993 * buffer.h (struct buffer): New member.
6994 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6995 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6996 base buffer indirection counter.
6997 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6998 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6999 through buffer list if indirection counter is 0.
7000
7001 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7002
7003 Extend the value returned by Fgarbage_collect with heap statistics.
7004 * alloc.c (Qheap): New symbol.
7005 (syms_of_alloc): DEFSYM it.
7006 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
7007 (Fmemory_free): Remove.
7008 (syms_of_alloc): Don't defsubr it.
7009 * buffer.c (Fcompact_buffer): Remove.
7010 (syms_of_buffer): Don't defsubr it.
7011
7012 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7013
7014 Make maybe_gc inline.
7015 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
7016 * lisp.h (consing_since_gc, gc_relative_threshold)
7017 (memory_full_cons_threshold): Revert declaration.
7018 (maybe_gc): Remove prototype, define as inline.
7019 * alloc.c: Remove old commented-out code.
7020 (consing_since_gc, gc_relative_threshold)
7021 (memory_full_cons_threshold): Revert to global.
7022 (maybe_gc): Remove.
7023
7024 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7025
7026 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
7027 * lisp.h (build_unibyte_string): New function.
7028 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
7029 * sysdep.c, w32fns.c, xfns.c: Use it.
7030 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
7031 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
7032 Adjust users accordingly.
7033 * font.h (font_open_by_name): Adjust prototype.
7034
7035 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7036
7037 Cleanup calls to Fgarbage_collect.
7038 * lisp.h (maybe_gc): New prototype.
7039 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7040 Remove declarations.
7041 * alloc.c (maybe_gc): New function.
7042 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7043 Make them static.
7044 * bytecode.c (MAYBE_GC): Use maybe_gc.
7045 * eval.c (eval_sub, Ffuncall): Likewise.
7046 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
7047 to avoid dependency from auto-save feature.
7048
7049 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
7050
7051 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
7052 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
7053 'for_each_per_buffer_object_at'.
7054 All uses changed. It's better to use upper-case for macros that
7055 cannot be implemented as functions, to give the reader a clue
7056 that they're special.
7057
7058 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
7059
7060 * alloc.c (Fgarbage_collect): Tweak docstring.
7061
7062 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7063
7064 Tweak the value returned from Fgarbage_collect again.
7065 * alloc.c (Fgarbage_collect): New return value, as confirmed in
7066 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
7067 Adjust documentation.
7068 (total_vector_bytes): Rename to total_vector_slots, adjust
7069 accounting.
7070 (total_free_vector_bytes): Rename to total_free_vector_slots,
7071 adjust accounting.
7072 (Qstring_bytes, Qvector_slots): New symbols.
7073 (syms_of_alloc): DEFSYM them.
7074
7075 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7076
7077 Buffer compaction primitive which may be used from Lisp.
7078 * buffer.c (compact_buffer, Fcompact_buffer): New function.
7079 (syms_of_buffer): Register Fcompact_buffer.
7080 * alloc.c (Fgarbage_collect): Use compact_buffer.
7081 * buffer.h (compact_buffer): New prototype.
7082 (struct buffer_text): New member.
7083
7084 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7085
7086 New macro to iterate over all buffers, miscellaneous cleanups.
7087 * lisp.h (all_buffers): Remove declaration.
7088 * buffer.h (all_buffers): Add declaration, with comment.
7089 (for_each_buffer): New macro.
7090 * alloc.c (Fgarbage_collect, mark_object): Use it.
7091 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
7092 (init_buffer): Likewise.
7093 * data.c (Fset_default): Likewise.
7094 * coding.c (code_conversion_restore): Remove redundant check
7095 for dead buffer.
7096 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
7097
7098 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7099
7100 Fix bug that created negative-length intervals.
7101 * intervals.c (merge_interval_right, merge_interval_left):
7102 Do not zero out this interval if it is absorbed by its children,
7103 as this interval's total length doesn't change in that case. See
7104 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
7105
7106 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
7107
7108 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
7109 when invoking (make-bool-vector N t) and N is a positive
7110 multiple of 8 -- the last 8 bits were mistakenly cleared.
7111
7112 Remove some struct layout assumptions in bool vectors.
7113 * alloc.c (bool_header_size): New constant.
7114 (header_size, word_size): Move earlier, as they're now used earlier.
7115 Use 'word_size' in a few more places, where it's appropriate.
7116 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
7117 padding before the data member of a bool vector.
7118 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
7119 than doing the check by hand with an abort ().
7120
7121 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7122
7123 * eval.c (Fdefvar): Don't check constants since we only set the var if
7124 it's not yet defined anyway (bug#11904).
7125
7126 * lisp.h (last_undo_boundary): Declare new var.
7127 * keyboard.c (command_loop_1): Set it.
7128 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
7129 were auto-added by the command loop (bug#11774).
7130
7131 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7132
7133 * w32font.c (Qsymbol): Remove local definition.
7134 (syms_of_w32font): Don't DEFSYM it.
7135
7136 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7137
7138 Fix sweep_vectors to handle large bool vectors correctly.
7139 * alloc.c (sweep_vectors): Account total_vector_bytes for
7140 bool vectors larger than VBLOCK_BYTES_MAX.
7141
7142 2012-07-18 Chong Yidong <cyd@gnu.org>
7143
7144 * frame.c (x_set_frame_parameters): Revert bogus change introduced
7145 in 2012-05-25 commit by Paul Eggert (Bug#11738).
7146
7147 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7148
7149 Return more descriptive data from Fgarbage_collect.
7150 Suggested by Stefan Monnier in
7151 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
7152 * alloc.c (bounded_number): New function.
7153 (total_buffers, total_vectors): New variable.
7154 (total_string_size): Rename to total_string_bytes, adjust users.
7155 (total_vector_size): Rename to total_vector_bytes, adjust users.
7156 (sweep_vectors): Account total_vectors and total_vector_bytes.
7157 (Fgarbage_collect): New return value. Adjust documentation.
7158 (gc_sweep): Account total_buffers.
7159 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
7160 (VECTOR_SIZE): Remove.
7161 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
7162 (Qinterval, Qmisc): New symbols.
7163 (syms_of_data): Initialize them.
7164 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
7165 (Qcons, Qbuffer): New declarations.
7166
7167 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7168
7169 * alloc.c (Fmemory_free): Account for memory-free's own storage.
7170 Round up, not down. Improve doc.
7171
7172 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7173
7174 Restore old code in allocate_string_data to avoid Faset breakage.
7175 Reported by Julien Danjou <julien@danjou.info> in
7176 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
7177 * alloc.c (allocate_string_data): Restore old code with minor
7178 adjustments, fix comment to explain this subtle issue.
7179
7180 2012-07-17 Eli Zaretskii <eliz@gnu.org>
7181
7182 Remove FILE_SYSTEM_CASE.
7183 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
7184
7185 * fileio.c (FILE_SYSTEM_CASE): Don't define.
7186 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
7187 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
7188 call-process-region passes it through expand-file-name.
7189
7190 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
7191
7192 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7193
7194 Fix crash when creating indirect buffer (Bug#11917)
7195 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
7196 Don't handle unbound variables specially if non-zero.
7197 (Fbuffer_local_variables): Pass zero.
7198 (clone_per_buffer_values): Pass non-zero.
7199
7200 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7201
7202 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
7203 to make the loop interruptible.
7204
7205 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7206
7207 * gnutls.c (emacs_gnutls_handshake): Only retry if
7208 GNUTLS_E_INTERRUPTED.
7209
7210 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7211
7212 Cleanup and convert miscellaneous checks to eassert.
7213 * alloc.c (mark_interval): Fix comment, partially rephrase
7214 old comment from intervals.h (see below).
7215 * intervals.c (find_interval, adjust_intervals_for_insertion)
7216 (delete_interval, adjust_intervals_for_deletion)
7217 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
7218 Convert to eassert.
7219 (adjust_intervals_for_insertion, make_new_interval):
7220 Remove obsolete and unused code.
7221 * intervals.h (struct interval): Remove obsolete comment.
7222 * textprotp.c (erase_properties): Remove unused code.
7223 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
7224 (Fremove_list_of_text_properties): Convert to eassert.
7225
7226 2012-07-17 Chong Yidong <cyd@gnu.org>
7227
7228 * editfns.c (Finsert_char): Doc fix.
7229
7230 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7231
7232 Fix previous change to make Fmemory_free always accurate.
7233 * alloc.c (make_interval): Update total_free_intervals.
7234 (make_float): Likewise for total_free_floats.
7235 (free_cons, Fcons): Likewise for total_free_conses.
7236 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
7237 Likewise for total_free_vector_bytes.
7238 (Fmake_symbol): Likewise for total_free_symbols.
7239 (bytes_free): Remove.
7240
7241 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7242
7243 Simple free memory accounting feature.
7244 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
7245 (sweep_vectors): Accumulate size of free vectors.
7246 (Fgarbage_collect): Setup bytes_free.
7247 (Fmemory_free): New function.
7248 (syms_of_alloc): Register it.
7249
7250 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7251
7252 Cleanup overlays checking.
7253 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
7254 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
7255 eassert and OVERLAYP.
7256 (sort_overlays): Change to use OVERLAYP.
7257
7258 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
7259
7260 * editfns.c (Finsert_char): Make it interactive, and make the
7261 second arg optional. Copy interactive spec and docstring from
7262 ucs-insert.
7263
7264 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7265
7266 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
7267 Unlike the other wrapped functions, fabs has an unspecified
7268 effect on errno.
7269
7270 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
7271
7272 * nsterm.m (keyDown): Interpret flags without left/right bits
7273 as the left key (Bug#11670).
7274
7275 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7276
7277 Remove empty and useless init functions.
7278 * lisp.h (init_character_once, init_fns, init_image)
7279 (init_filelock, init_sound): Remove prototype.
7280 * character.c (init_character_once): Remove.
7281 * filelock.c (init_filelock): Likewise.
7282 * fns.c (init_fns): Likewise.
7283 * image.c (init_image): Likewise.
7284 * sound.c (init_sound): Likewise.
7285 * emacs.c (main): Adjust accordingly.
7286
7287 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7288
7289 * gtkutil.h: Tiny cleanups.
7290 (use_old_gtk_file_dialog): Remove useless declaration.
7291 (xg_uses_old_file_dialog): Add suggested const attribute.
7292
7293 2012-07-15 Eli Zaretskii <eliz@gnu.org>
7294
7295 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
7296 (bidi_paragraph_init): Use it to limit search forward for a strong
7297 directional character in abnormally large paragraphs full of
7298 neutral or weak characters. (Bug#11943)
7299
7300 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
7301
7302 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
7303 the toolbar (Bug#9451).
7304 (xg_make_tool_item): Give the widget event box a transparent
7305 background.
7306
7307 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7308
7309 Cleanup basic allocation variables and functions.
7310 * alloc.c (ignore_warnings, init_intervals, init_float)
7311 (init_cons, init_symbol, init_marker): Remove.
7312 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
7313 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
7314 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
7315 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
7316 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
7317 (staticidx, init_alloc_once, init_strings, free_ablock):
7318 Remove redundant initialization.
7319 * fns.c (init_weak_hash_tables): Remove.
7320 * lisp.h (init_weak_hash_tables): Remove prototype.
7321
7322 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7323
7324 Use zero_vector where appropriate.
7325 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
7326 accordingly.
7327 * lisp.h (zero_vector): New declaration.
7328 * font.c (null_vector): Remove.
7329 (syms_of_font): Remove initialization and staticpro.
7330 (font_list_entities, font_find_for_lface): Change to use zero_vector.
7331 * keymap.c (Faccessible_keymaps): Likewise.
7332
7333 2012-07-15 Leo Liu <sdl.web@gmail.com>
7334
7335 * fringe.c: Fix typo in comments.
7336
7337 2012-07-14 Leo Liu <sdl.web@gmail.com>
7338
7339 * fringe.c: Add a new bitmap exclamation-mark.
7340
7341 2012-07-14 Eli Zaretskii <eliz@gnu.org>
7342
7343 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
7344
7345 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
7346 (HAVE_MENUS): Don't define, defined by editing config.in with
7347 msdos/sed2v2.inp.
7348 (GMALLOC_INHIBIT_VALLOC): Don't define.
7349 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
7350
7351 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
7352
7353 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
7354
7355 2012-07-14 Glenn Morris <rgm@gnu.org>
7356
7357 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
7358 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
7359 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
7360
7361 2012-07-13 Glenn Morris <rgm@gnu.org>
7362
7363 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
7364
7365 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
7366 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
7367
7368 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
7369
7370 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
7371 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
7372 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
7373 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
7374 where appropriate.
7375 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
7376 as boolean expression.
7377 (x_set_window_size): Remove unused variable toolbar.
7378 (ns_get_color_default, ns_mod_to_lisp): Remove.
7379 (ns_mouse_position): Remove unused variables xchar and ychar.
7380 (ns_compute_glyph_string_overhangs): Remove unused variable face.
7381 (ns_set_vertical_scroll_bar): Remove unused variable count.
7382 (ns_delete_terminal): Remove unused variable i.
7383 (ns_term_init): Remove unused variables r, g and b.
7384 (mouseDown): Remove unused variable window.
7385 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
7386 (initFrameFromEmacs): Remove unused variable vbextra.
7387 (mouseEntered): Remove unused variables p and dpyinfo.
7388 (mouseExited): Remove unused variables p and r.
7389 (ns_define_frame_cursor, ns_clear_frame_area)
7390 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
7391 (menuDown): Assign [sender tag] to variable and cast the variable.
7392
7393 * nsterm.h (menuDown): Add id as type to argument sender.
7394 (ns_display_info_for_name): Add Lisp_Object argument.
7395 (ns_term_init): Add Lisp_Object argument.
7396 (ns_map_event_to_object): Add void argument.
7397 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
7398 prototype with arguments and only declare if __OBJC__.
7399 (nxatoms_of_nsselect): Add void argument.
7400 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
7401 (ns_alloc_autorelease_pool): Add void argument.
7402 (ns_release_autorelease_pool): Add void* argument.
7403 (ns_get_defaults_value): Add const char* argument.
7404
7405 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
7406 (initFromContents): Use SSDATA where appropriate.
7407 (ns_update_menubar): Add braces to ambigous if-else.
7408 (initWithTitle): Put () around assignment in if statement.
7409 (ns_menu_show): Remove unused variables window and keymap.
7410 (update_frame_tool_bar): Remove unused variable selected_p.
7411 (initWithContentRect): Remove unused variable this_cmd_name.
7412
7413 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
7414 appropriate.
7415 (setXBMColor): Remove unused variable len.
7416 (setPixmapData): Put () around assignment in loop statement.
7417
7418 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
7419 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
7420 where appropriate.
7421 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
7422 around assignment in loop statement.
7423 (nsfont_open): Remove unused variable i.
7424 (nsfont_open): Remove unused variable len.
7425 (nsfont_draw): Remove unused variable cs.
7426
7427 * nsfns.m (x_set_icon_name, ns_set_name_internal)
7428 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
7429 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
7430 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
7431 (Fns_font_name, Fns_perform_service)
7432 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
7433 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
7434 (ns_set_name): Remove unused variable view.
7435 (x_set_menu_bar_lines): Remove unused variable olines.
7436 (x_set_tool_bar_lines): Remove unused variable root_window.
7437 (Fns_list_colors): Put () around assignment in while statement.
7438 (Fns_perform_service): Remove unused variable len.
7439 (Fns_display_usable_bounds): Remove unused variable top.
7440 (syms_of_nsfns): Remove unused variable i.
7441
7442 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7443 memcpy (Bug#11907).
7444
7445 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
7446
7447 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7448 and free it with DestroyExceptionInfo (Bug#11558).
7449
7450 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
7451
7452 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7453 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7454 Set here, not in nt/config.nt.
7455
7456 2012-07-13 Eli Zaretskii <eliz@gnu.org>
7457
7458 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7459 cursor overflow into the last glyph on display line when the right
7460 fringe is off. (Bug#11832)
7461
7462 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7463
7464 * xdisp.c (produce_special_glyphs): Now static.
7465 * dispextern.h (produce_special_glyphs): Remove decl.
7466
7467 2012-07-13 Glenn Morris <rgm@gnu.org>
7468
7469 * s/bsd-common.h, s/cygwin.h: Remove empty files.
7470 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7471
7472 * s/usg5-4-common.h (USG, USG5):
7473 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7474 * s/sol2-6.h (SOLARIS2):
7475 * s/irix6-5.h (IRIX6_5):
7476 * s/hpux10-20.h (USG, USG5, HPUX):
7477 * s/gnu-linux.h (USG, GNU_LINUX):
7478 * s/freebsd.h (BSD_SYSTEM):
7479 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7480 * s/cygwin.h (CYGWIN):
7481 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7482 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7483
7484 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
7485
7486 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
7487
7488 2012-07-13 Glenn Morris <rgm@gnu.org>
7489
7490 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7491
7492 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7493
7494 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7495 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7496
7497 2012-07-12 Glenn Morris <rgm@gnu.org>
7498
7499 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
7500
7501 * process.c (init_process_emacs): Rename from init_process.
7502 The old name is also the name of a Mach system call.
7503 * lisp.h, emacs.c: Update for this name change.
7504 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7505 longer needed.
7506
7507 2012-07-12 Eli Zaretskii <eliz@gnu.org>
7508
7509 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7510 memmove call that removes glyphs covered by the left truncation
7511 glyph. Improve commentary.
7512 (display_line): Fix display of continuation glyphs on GUI frames
7513 when the right fringe is turned off and variable-size fonts are
7514 used in the window. Move the code that appends a stretch glyph to
7515 produce_special_glyphs, so that it could be used for truncation
7516 and continuation glyphs alike.
7517 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7518 glyph of a suitably computed width, to align the special glyphs at
7519 the window margin. Code moved from display_line. (Bug#11832)
7520
7521 2012-07-12 Glenn Morris <rgm@gnu.org>
7522
7523 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7524
7525 * s/gnu-linux.h, s/hpux10-20.h:
7526 Do not unconditionally define HAVE_XRMSETDATABASE.
7527
7528 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7529
7530 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7531
7532 Fix typos that broke OS X build.
7533 Reported by Randal L. Schwartz in
7534 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7535 * nsterm.m (ns_timeout): Add missing local decl.
7536 (ns_get_color): snprintf -> sprintf, to fix typo.
7537
7538 2012-07-12 Glenn Morris <rgm@gnu.org>
7539
7540 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7541 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7542 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7543 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7544
7545 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7546 Move PTY_OPEN to configure.
7547
7548 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7549 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7550 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7551
7552 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7553
7554 Use empty_unibyte_string where applicable.
7555 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7556 * lread.c (read1): Likewise.
7557 * xsettings.c (syms_of_xsettings): Likewise.
7558
7559 2012-07-12 Glenn Morris <rgm@gnu.org>
7560
7561 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7562 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7563 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7564 * s/hpux10-20.h (RUN_TIME_REMAP):
7565 * s/bsd-common.h (TABDLY): Move to configure.
7566
7567 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7568
7569 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7570
7571 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7572 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
7573
7574 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
7575
7576 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7577 * s/template.h: Move NARROWPROTO to configure.
7578
7579 2012-07-11 Glenn Morris <rgm@gnu.org>
7580
7581 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7582 unused since 2011-01-17 change to systty.h.
7583
7584 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7585 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7586 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7587
7588 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7589
7590 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7591
7592 2012-07-11 Glenn Morris <rgm@gnu.org>
7593
7594 * s/darwin.h, s/gnu-linux.h, s/template.h:
7595 Move INTERRUPT_INPUT to configure.
7596
7597 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7598
7599 Minor adjustments to interning code.
7600 * lisp.h (intern, intern_c_string): Redefine as static inline
7601 wrappers for intern_1 and intern_c_string_1, respectively.
7602 (intern_1, intern_c_string_1): Rename prototypes.
7603 * lread.c (intern_1, intern_c_string_1, oblookup):
7604 Simplify Vobarray checking.
7605 * font.c (font_intern_prop): Likewise. Adjust comment.
7606 * w32font.c (intern_font_name): Likewise.
7607
7608 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7609
7610 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7611
7612 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7613 of Fcar/Fcdr if possible.
7614 * font.c (check_otf_features): Likewise.
7615 * fontset.c (Fnew_fontset): Likewise.
7616 * gnutls.c (Fgnutls_boot): Likewise.
7617 * minibuf.c (read_minibuf): Likewise.
7618 * msdos.c (IT_set_frame_parameters): Likewise.
7619 * xmenu.c (Fx_popup_dialog): Likewise.
7620 * w32menu.c (Fx_popup_dialog): Likewise.
7621
7622 2012-07-11 Glenn Morris <rgm@gnu.org>
7623
7624 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7625 since nothing has defined it on these platforms.
7626
7627 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7628 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7629
7630 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7631 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7632 Move CLASH_DETECTION to configure.
7633
7634 * s/gnu.h: Remove file, which is now empty.
7635
7636 * s/gnu.h, s/gnu-linux.h:
7637 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7638
7639 2012-07-11 John Wiegley <johnw@newartisans.com>
7640
7641 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7642 function attribute, so we only use it if it exists in the
7643 compiler.
7644
7645 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7646
7647 Avoid call to strlen in fast_c_string_match_ignore_case.
7648 * search.c (fast_c_string_match_ignore_case): Change to use
7649 length argument. Adjust users accordingly.
7650 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7651
7652 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7653
7654 Assume mkdir, rmdir.
7655 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7656 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7657
7658 Assume rename.
7659 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7660
7661 Assume perror.
7662 * s/hpux10-20.h (HAVE_PERROR): Remove.
7663 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7664 Remove dummy definition, as this problem was obsolete long ago.
7665
7666 Assume strerror.
7667 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7668
7669 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7670
7671 Avoid calls to strlen in font processing functions.
7672 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
7673 (font_open_by_name): Change to use length argument.
7674 Adjust users accordingly.
7675 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7676 Adjust prototypes.
7677 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7678 Change to return ptrdiff_t.
7679 (xfont_list_pattern, xfont_match): Use length returned by
7680 xfont_decode_coding_xlfd.
7681 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7682
7683 2012-07-11 Glenn Morris <rgm@gnu.org>
7684
7685 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7686 Move DONT_REOPEN_PTY to configure.
7687
7688 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7689 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7690
7691 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7692
7693 Remove "#define unix" that is no longer needed (Bug#11905).
7694 * s/aix4-2.h (unix): Remove; no longer needed.
7695
7696 EMACS_TIME simplification (Bug#11875).
7697 This replaces macros (which typically do not work in GDB)
7698 with functions, typedefs and enums, making the code easier to debug.
7699 The functional style also makes code easier to read and maintain.
7700 * systime.h: Include <sys/time.h> on all hosts, not just if
7701 WINDOWSNT, since 'struct timeval' is needed in general.
7702 (EMACS_TIME): Now a typedef, not a macro.
7703 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7704 not macros.
7705 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7706 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7707 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7708 (EMACS_TIME_LE): Now functions, not macros.
7709 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7710 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7711 which are not functions. All uses rewritten to use:
7712 (make_emacs_time): New function.
7713 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7714 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7715 not functions. All uses rewritten to use the following, respectively:
7716 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7717 (add_emacs_time, sub_emacs_time): New functions.
7718 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7719 * fileio.c (Fcopy_file):
7720 * xterm.c (XTflash): Get the current time closer to when it's used.
7721 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7722
7723 * bytecode.c (targets): Suppress -Woverride-init warnings.
7724
7725 Simplify by avoiding confusing use of strncpy etc.
7726 * doc.c (Fsnarf_documentation):
7727 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7728 * frame.c (Fmake_terminal_frame):
7729 * gtkutil.c (get_utf8_string):
7730 * lread.c (openp):
7731 * nsmenu.m (ns_update_menubar):
7732 * regex.c (regerror):
7733 Prefer memcpy to strncpy and strncat when either will do.
7734 * fileio.c (Fsubstitute_in_file_name):
7735 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7736 (menu_separator_name_p):
7737 * nsmenu.m (ns_update_menubar):
7738 Prefer memcmp to strncmp when either will do.
7739 * nsterm.m: Include <ftoastr.h>.
7740 (ns_get_color):
7741 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7742 Prefer snprintf to strncpy.
7743 * nsterm.m (ns_term_init):
7744 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7745 * nsterm.m (ns_term_init):
7746 Avoid the need for strncpy, by using build_string or
7747 make_unibyte_string directly. Use dtoastr, not snprintf.
7748 * process.c (Fmake_network_process): Diagnose service names that
7749 are too long, rather than silently truncating them or creating
7750 non-null-terminated names.
7751 (Fnetwork_interface_info): Likewise, for interface names.
7752 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7753 Prefer sprintf to strncat.
7754 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7755 Prefer vsnprintf to vsprintf + strncpy.
7756
7757 2012-07-10 Glenn Morris <rgm@gnu.org>
7758
7759 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7760 Clarify fallback case.
7761
7762 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7763
7764 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7765 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7766 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7767 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7768 where argument type is known to be a Lisp_Cons.
7769
7770 2012-07-10 Tom Tromey <tromey@redhat.com>
7771
7772 * bytecode.c (BYTE_CODE_THREADED): New macro.
7773 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7774 (enum byte_code_op): New type.
7775 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7776 (exec_byte_code): Use them. Use token threading when applicable.
7777
7778 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7779
7780 Optimize pure C strings initialization.
7781 * lisp.h (make_pure_string): Fix prototype.
7782 (build_pure_c_string): New function, defined as static inline. This
7783 provides a better opportunity to optimize away calls to strlen when
7784 the function is called with compile-time constant argument.
7785 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7786 argument, adjust users accordingly. Use build_pure_c_string where
7787 appropriate.
7788 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7789 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7790 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7791
7792 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7793
7794 Avoid calls to strlen in miscellaneous functions.
7795 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7796 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7797 * lread.c (openp): Likewise.
7798
7799 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7800
7801 Avoid calls to strlen in path processing functions.
7802 * fileio.c (file_name_as_directory): Add comment. Change to add
7803 srclen argument and return the length of result. Adjust users
7804 accordingly.
7805 (directory_file_name): Fix comment. Change to add srclen argument,
7806 swap 1st and 2nd arguments to obey the common convention.
7807 Adjust users accordingly.
7808 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7809
7810 2012-07-10 Glenn Morris <rgm@gnu.org>
7811
7812 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7813 Move PENDING_OUTPUT_COUNT definition to configure.
7814
7815 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7816 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7817 * s/gnu.h (DATA_START): Move definitions to configure.
7818
7819 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7820 We include usg5-4-common.h, which defines them both.
7821
7822 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7823 O_RDONLY already includes it).
7824
7825 Stop ns builds setting the EMACSLOADPATH environment variable.
7826 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7827 Now it does not set EMACSLOADPATH, just returns the load-path string.
7828 * nsterm.h: Update accordingly.
7829 * lread.c [HAVE_NS]: Include nsterm.h.
7830 (init_lread) [HAVE_NS]: Use ns_load_path.
7831 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7832
7833 2012-07-09 Glenn Morris <rgm@gnu.org>
7834
7835 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7836 since the included bsd-common.h does so.
7837
7838 Stop ns builds setting the EMACSPATH environment variable.
7839 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7840 (ns_init_paths): Do not set EMACSPATH.
7841 * nsterm.h (ns_exec_path): Add it.
7842 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7843 Use ns_exec_path.
7844
7845 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7846
7847 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7848
7849 * process.c (wait_reading_process_output): 'waitchannels' was unset
7850 when read_kbd || !NILP (wait_for_cell); fix this.
7851
7852 Add GCC-style 'const' attribute to functions that can use it.
7853 * character.h (char_resolve_modifier_mask):
7854 * keyboard.h (make_ctrl_char):
7855 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7856 (init_character_once, next_almost_prime, init_fns, init_image)
7857 (flush_pending_output, init_sound):
7858 * mem-limits.h (start_of_data):
7859 * menu.h (finish_menu_items):
7860 Add ATTRIBUTE_CONST.
7861 * emacs.c (DEFINE_DUMMY_FUNCTION):
7862 Declare the dummy function with ATTRIBUTE_CONST.
7863 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7864 Add decls with ATTRIBUTE_CONST.
7865
7866 Minor improvements to make_formatted_string.
7867 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7868 where int is good enough, as vsprintf returns an int.
7869 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7870
7871 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7872
7873 Use make_formatted_string to avoid double length calculation.
7874 * lisp.h (make_formatted_string): New prototype.
7875 * alloc.c (make_formatted_string): New function.
7876 * buffer.c (Fgenerate_new_buffer_name): Use it.
7877 * dbusbind.c (syms_of_dbusbind): Likewise.
7878 * editfns.c (Fcurrent_time_zone): Likewise.
7879 * filelock.c (get_boot_time): Likewise.
7880 * frame.c (make_terminal_frame, set_term_frame_name)
7881 (x_report_frame_params): Likewise.
7882 * image.c (gs_load): Likewise.
7883 * minibuf.c (get_minibuffer): Likewise.
7884 * msdos.c (dos_set_window_size): Likewise.
7885 * process.c (make_process): Likewise.
7886 * xdisp.c (ensure_echo_area_buffers): Likewise.
7887 * xsettings.c (apply_xft_settings): Likewise.
7888
7889 2012-07-09 Glenn Morris <rgm@gnu.org>
7890
7891 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7892 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7893 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7894 * nsterm.h (ns_etc_directory): Add it.
7895 * callproc.c [HAVE_NS]: Include nsterm.h.
7896 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7897
7898 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7899
7900 Move marker debugging code under MARKER_DEBUG.
7901 * marker.c (MARKER_DEBUG): Move marker debugging code under
7902 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7903 for bootstrap with --enable-checking (~3x slowdown reported
7904 by Juanma Barranquero <lekktu@gmail.com>).
7905 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7906
7907 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7908
7909 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7910 See <http://bugs.gnu.org/11825#29>.
7911
7912 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7913
7914 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7915 has no font, use the frame's font. (Bug#11813)
7916 (display_line): Add commentary about displaying truncation glyphs
7917 on GUI frames.
7918 (produce_special_glyphs): Move here from term.c.
7919
7920 * term.c (produce_special_glyphs): Move to xdisp.c.
7921
7922 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7923 section.
7924
7925 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7926
7927 * xdisp.c (display_line): Avoid warning about implicit declaration
7928 of FRAME_FONT.
7929
7930 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7931
7932 * lisp.h: Remove empty conditional.
7933
7934 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7935
7936 * lread.c (load_path_check): Now static.
7937
7938 Fix some minor --with-ns problems found by static checking.
7939 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7940 (x_set_font) [!HAVE_X_WINDOWS]:
7941 * image.c (xpm_load_image) [HAVE_NS]:
7942 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7943 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7944 Remove unused local.
7945 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7946 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7947 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7948 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7949 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7950 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7951 Fix pointer signedness problem.
7952 * xfaces.c (FRAME_X_FONT_TABLE):
7953 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7954
7955 2012-07-07 Glenn Morris <rgm@gnu.org>
7956
7957 * lread.c (load_path_check): New function, split from init_lread.
7958 (init_lread): Reorganize. Motivation:
7959 If EMACSLOADPATH is set, check/warn about that rather than the
7960 defaults, which we are not going to use. Hence we can remove
7961 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7962 Don't warn if site-lisp directories are missing.
7963 If not installed, start from a blank load-path, since
7964 PATH_LOADSEARCH refers to the eventual installation directories.
7965
7966 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7967
7968 Support truncation and continuation glyphs on GUI frames, when
7969 fringes are disabled. (Bug#11832)
7970 * xdisp.c (init_iterator): Get dimensions of truncation and
7971 continuation glyphs even if on GUI frames.
7972 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7973 or both, are absent.
7974 (start_display, move_it_in_display_line_to): Handle the case of a
7975 GUI frame without a fringe to display continuation or truncation
7976 glyphs.
7977 (insert_left_trunc_glyphs): Support GUI frames: make sure
7978 truncation glyphs overwrite enough glyphs from the current line to
7979 have sufficient space in pixels.
7980 (display_line): Support truncation and continuation glyphs on GUI
7981 frames. If some spare pixels are left on the line after inserting
7982 the truncation glyphs, fill that space with a stretch glyph of a
7983 suitably computed width.
7984
7985 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7986 produce_glyphs, to support GUI sessions.
7987
7988 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7989
7990 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7991
7992 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7993
7994 Do not require float-time's arg to fit in time_t (Bug#11825).
7995 This works better on hosts where time_t is unsigned, and where
7996 float-time is applied to the (negative) difference between two times.
7997 * editfns.c (decode_time_components): Last arg is now double *,
7998 not int *, and means to store all the result as a double, without
7999 worrying about whether the seconds part fits in time_t.
8000 All callers changed.
8001 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
8002 All callers changed.
8003 (Ffloat_time): Do not fail merely because the specified time falls
8004 outside of time_t range.
8005
8006 2012-07-07 Glenn Morris <rgm@gnu.org>
8007
8008 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
8009 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
8010 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
8011
8012 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
8013
8014 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
8015 Update dependencies.
8016
8017 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
8018
8019 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8020
8021 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
8022 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
8023 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
8024 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
8025 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
8026 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
8027
8028 * xfont.c (compare_font_names): Redo to omit the need for casts.
8029
8030 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
8031
8032 * xfns.c (Fx_change_window_property): Doc fix.
8033 * w32fns.c (Fx_change_window_property): Doc fix.
8034
8035 * w32fns.c (Fx_window_property): Accept the same arguments as the
8036 X Windows version. Doc fix.
8037 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
8038
8039 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
8040 Eli Zaretskii <eliz@gnu.org>
8041
8042 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
8043 Windows-specific code from nt/config.nt moved here.
8044 Obsolete settings removed.
8045
8046 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8047
8048 * process.c: Avoid unnecessary calls to gettime.
8049 (wait_reading_process_output): Don't get the time of day
8050 when gobbling data immediately and not waiting, as there's no need
8051 for it in that case. This removes a FIXME.
8052
8053 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
8054
8055 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
8056 is defined (Bug#11768).
8057
8058 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8059
8060 Fix marker debugging code.
8061 * marker.c (byte_char_debug_check): Do not perform the check
8062 if buffer is not multibyte.
8063 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8064 Call byte_char_debug_check with correct arguments.
8065
8066 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8067
8068 Compile marker debugging code only if ENABLE_CHECKING is defined.
8069 * marker.c (byte_char_debug_check, count_markers):
8070 Use only if ENABLE_CHECKING is defined.
8071 (byte_debug_flag): Remove.
8072 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8073 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
8074
8075 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8076
8077 Avoid code repetition in marker-related functions.
8078 * marker.c (attach_marker): New function.
8079 (Fset_marker, set_marker_restricted, set_marker_both)
8080 (set_marker_restricted_both): Use it.
8081 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
8082 Consistently rename charno to charpos.
8083 (marker_position): Add eassert.
8084 (marker_byte_position): Convert to eassert.
8085
8086 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8087
8088 Simplify list operations in unchain_overlay and unchain_marker.
8089 * buffer.c (unchain_overlay): Simplify. Add comment.
8090 * marker.c (unchain_marker): Simplify. Fix comments.
8091
8092 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8093
8094 Introduce fast path for the widely used marker operation.
8095 * alloc.c (build_marker): New function.
8096 * lisp.h (build_marker): New prototype.
8097 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
8098 * composite.c (autocmp_chars): Likewise.
8099 * editfns.c (buildmark): Remove.
8100 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
8101 (save_restriction_save): Use build_marker.
8102 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
8103 * window.c (save_window_save): Likewise.
8104
8105 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8106
8107 Do not use Fdelete_overlay in delete_all_overlays
8108 to avoid redundant calls to unchain_overlay.
8109 * buffer.c (drop_overlay): New function.
8110 (delete_all_overlays, Fdelete_overlay): Use it.
8111 * minibuf.c (get_minibuffer): Fix comment.
8112
8113 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8114
8115 Port to OpenBSD 5.1 amd64.
8116 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
8117 This is needed for OpenBSD, and should be harmless on all BSD systems.
8118 Also, include <sys/sysctl.h>, as it should be available on all
8119 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
8120 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
8121 use p_pid member, not kp_proc.pid.
8122
8123 2012-07-06 Glenn Morris <rgm@gnu.org>
8124
8125 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
8126
8127 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8128
8129 More xmalloc and related cleanup.
8130 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
8131 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
8132 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
8133 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
8134 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
8135 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
8136 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
8137 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
8138 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
8139 * xterm.c:
8140 Omit needless casts involving void * pointers and allocation.
8141 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
8142 as the former is more robust if P's type is changed.
8143 Prefer xzalloc to xmalloc + memset 0.
8144 Simplify malloc-or-realloc to realloc.
8145 Don't worry about xmalloc returning a null pointer.
8146 Prefer xstrdup to xmalloc + strcpy.
8147 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
8148 growing it.
8149 * keyboard.c (apply_modifiers_uncached): Prefer local array to
8150 alloca of a constant.
8151
8152 2012-07-05 Eli Zaretskii <eliz@gnu.org>
8153
8154 * xdisp.c (display_line): Fix horizontal pixel coordinates when
8155 hscroll is larger than the line width. Fixes long and futile
8156 looping inside extend_face_to_end_of_line (on a TTY) producing
8157 glyphs that are not needed and thrown away.
8158
8159 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8160
8161 * marker.c (set_marker_restricted_both): Simplify by using
8162 clip_to_bounds.
8163
8164 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8165
8166 * editfns.c (region_limit): Simplify by using clip_to_bounds.
8167
8168 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
8169
8170 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
8171 not defined (Bug#11768).
8172 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
8173 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
8174 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
8175 followed by gtk_box_set_homogeneous (Bug#11768).
8176 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
8177 (update_theme_scrollbar_width, xg_create_scroll_bar):
8178 Use gtk_scrollbar_new (Bug#11768).
8179 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
8180 (is_box_type): New function (Bug#11768).
8181 (xg_tool_item_stale_p): Call is_box_type.
8182 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
8183 with default display (Bug#11768).
8184
8185 2012-07-05 Eli Zaretskii <eliz@gnu.org>
8186
8187 * xdisp.c (window_hscroll_limited): New function.
8188 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
8189 coordinates when window's hscroll is set to insanely large
8190 values. (Bug#11857)
8191
8192 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
8193
8194 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
8195 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
8196
8197 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8198
8199 Cleanup xmalloc.
8200 * lisp.h (xzalloc): New prototype. Omit needless casts.
8201 * alloc.c (xzalloc): New function. Omit needless casts.
8202 * charset.c: Omit needless casts. Convert all calls to
8203 xmalloc with following memset to xzalloc.
8204 * dispnew.c: Likewise.
8205 * fringe.c: Likewise.
8206 * image.c: Likewise.
8207 * sound.c: Likewise.
8208 * term.c: Likewise.
8209 * w32fns.c: Likewise.
8210 * w32font.c: Likewise.
8211 * w32term.c: Likewise.
8212 * xfaces.c: Likewise.
8213 * xfns.c: Likewise.
8214 * xterm.c: Likewise.
8215 * atimer.c: Omit needless casts.
8216 * buffer.c: Likewise.
8217 * callproc.c: Likewise.
8218 * ccl.c: Likewise.
8219 * coding.c: Likewise.
8220 * composite.c: Likewise.
8221 * doc.c: Likewise.
8222 * doprnt.c: Likewise.
8223 * editfns.c: Likewise.
8224 * emacs.c: Likewise.
8225 * eval.c: Likewise.
8226 * filelock.c: Likewise.
8227 * fns.c: Likewise.
8228 * gtkutil.c: Likewise.
8229 * keyboard.c: Likewise.
8230 * lisp.h: Likewise.
8231 * lread.c: Likewise.
8232 * minibuf.c: Likewise.
8233 * msdos.c: Likewise.
8234 * print.c: Likewise.
8235 * process.c: Likewise.
8236 * region-cache.c: Likewise.
8237 * search.c: Likewise.
8238 * sysdep.c: Likewise.
8239 * termcap.c: Likewise.
8240 * terminal.c: Likewise.
8241 * tparam.c: Likewise.
8242 * w16select.c: Likewise.
8243 * w32.c: Likewise.
8244 * w32reg.c: Likewise.
8245 * w32select.c: Likewise.
8246 * w32uniscribe.c: Likewise.
8247 * widget.c: Likewise.
8248 * xdisp.c: Likewise.
8249 * xmenu.c: Likewise.
8250 * xrdb.c: Likewise.
8251 * xselect.c: Likewise.
8252
8253 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8254
8255 * fileio.c (time_error_value): Check the right error number.
8256 Problem reported by Troels Nielsen in
8257 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
8258
8259 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8260
8261 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
8262 This should be fixed in a better way; see Eli Zaretskii in
8263 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
8264 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
8265
8266 * fileio.c (time_error_value): Rename from special_mtime.
8267 The old name's problems were noted by Eli Zaretskii in
8268 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
8269
8270 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
8271 This variable's comment says Emacs needs at least one GDB-visible
8272 symbol of type enum pvec_type, to work around GDB problems.
8273 The symbol's value doesn't matter.
8274
8275 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
8276 that causes compilation to fail on pre-C99 compilers.
8277
8278 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
8279
8280 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
8281 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
8282
8283 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8284
8285 * buffer.c (init_buffer_once): Fix initialization of
8286 headers for buffer_defaults and buffer_local_symbols.
8287 Reported by Juanma Barranquero <lekktu@gmail.com>.
8288
8289 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8290
8291 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
8292 * lisp.h (enum pvec_type): Use fewer bits.
8293 (PSEUDOVECTOR_SIZE_BITS): New constant.
8294 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
8295 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
8296 change in pvec_type.
8297 (PSEUDOVECTOR_TYPEP): New macro.
8298 (TYPED_PSEUDOVECTORP): Use it.
8299 * fns.c (internal_equal): Adapt code to extract pvectype.
8300 * emacs.c (gdb_pvec_type): Update type.
8301 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
8302 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
8303 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
8304 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
8305 (sweep_vectors): Use it. Use local var `total_bytes' instead of
8306 abusing vector->header.next.nbytes.
8307 (live_vector_p): Use PVEC_TYPE.
8308 (mark_object): Adapt code to extract pvectype. Use switch.
8309
8310 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8311
8312 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
8313 Tighten new eassert a bit.
8314
8315 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8316
8317 Fix compilation with --enable-gcc-warnings and -O1
8318 optimization level.
8319 * doprnt.c (doprnt): Change type of tem to int, initialize
8320 to avoid compiler warning. Add eassert.
8321 * search.c (simple_search): Initialize match_byte to avoid
8322 compiler warning. Add eassert.
8323
8324 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8325
8326 Avoid weird behavior with large horizontal scrolls.
8327 Without this change, for example, large hscroll values would
8328 mess up Emacs's display on Fedora 15 x86, presumably due to
8329 overflows in int calculations in the display code.
8330 Also, if buffers had long lines, Emacs would freeze.
8331 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
8332 (set_window_hscroll): New function, containing the old guts of
8333 Fset_window_hscroll. Return the clipped value.
8334 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
8335 This avoids the need to check against PTRDIFF_MAX.
8336
8337 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
8338
8339 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8340
8341 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
8342
8343 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8344
8345 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
8346 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
8347 since GCC 4.4.6 issues a bogus warning for them.
8348
8349 Fix bugs in file timestamp newness comparisons.
8350 * fileio.c (Ffile_newer_than_file_p):
8351 * lread.c (Fload): Use full timestamp resolution of files,
8352 not just the 1-second resolution, so that files that are only
8353 slightly newer still count as newer.
8354 * fileio.c (Ffile_newer_than_file_p): Don't assume file
8355 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
8356
8357 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
8358
8359 * fileio.c: Improve handling of file time marker. (Bug#11852)
8360 (special_mtime): New function.
8361 (Finsert_file_contents, Fverify_visited_file_modtime):
8362 Use it to set special mtime values consistently.
8363
8364 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
8365
8366 * fileio.c (Finsert_file_contents): Properly handle st_mtime
8367 marker for non-existing file. (Bug#11852)
8368
8369 2012-07-03 Glenn Morris <rgm@gnu.org>
8370
8371 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
8372 and did not make it into globals.h).
8373
8374 2012-07-03 Tom Tromey <tromey@redhat.com>
8375
8376 * window.c (Fset_window_margins, Fset_window_fringes)
8377 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
8378 * textprop.c (Fprevious_property_change): No longer static.
8379 * syntax.c (Fsyntax_table_p): No longer static.
8380 * process.c (Fget_process, Fprocess_datagram_address): No longer
8381 static.
8382 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
8383 * keyboard.c (Fcommand_execute): No longer static.
8384 Remove EXFUN.
8385 * insdel.c (Fcombine_after_change_execute): No longer static.
8386 * image.c (Finit_image_library): No longer static.
8387 * fileio.c (Fmake_symbolic_link): No longer static.
8388 * eval.c (Ffetch_bytecode): No longer static.
8389 * editfns.c (Fuser_full_name): No longer static.
8390 * doc.c (Fdocumentation_property, Fsnarf_documentation):
8391 No longer static.
8392 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
8393 static.
8394 * dired.c (Ffile_attributes): No longer static.
8395 * composite.c (Fcomposition_get_gstring): No longer static.
8396 * callproc.c (Fgetenv_internal): No longer static.
8397
8398 * ccl.h: Remove EXFUNs.
8399 * buffer.h: Remove EXFUNs.
8400 * dispextern.h: Remove EXFUNs.
8401 * intervals.h: Remove EXFUNs.
8402 * fontset.h: Remove EXFUN.
8403 * font.h: Remove EXFUNs.
8404 * dosfns.c (system_process_attributes): Remove EXFUN.
8405 * keymap.h: Remove EXFUNs.
8406 * lisp.h: Remove EXFUNs.
8407 * w32term.h: Remove EXFUNs.
8408 * window.h: Remove EXFUNs.
8409 * xsettings.h: Remove EXFUN.
8410 * xterm.h: Remove EXFUN.
8411
8412 2012-07-03 Glenn Morris <rgm@gnu.org>
8413
8414 * lisp.h (Frandom): Make it visible to C.
8415 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
8416 buffer for invisible buffers. (Bug#1229)
8417
8418 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8419
8420 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
8421 values which aren't power of 2.
8422 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
8423 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
8424 accordingly.
8425
8426 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
8427
8428 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
8429
8430 * alloc.c (mark_object): Revert part of last patch to use `switch'.
8431
8432 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8433
8434 * alloc.c (allocate_vector_block): Remove redundant
8435 calls to mallopt if DOUG_LEA_MALLOC is defined.
8436 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
8437 avoid calls to mallopt if zero_vector is returned.
8438
8439 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8440
8441 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8442 is enabled, avoid dereferencing NULL current_sblock if
8443 running undumped.
8444
8445 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8446
8447 Cleanup basic buffer management.
8448 * buffer.h (struct buffer): Change layout to use generic vector
8449 marking code. Fix some comments. Change type of 'clip_changed'
8450 to bitfield. Remove unused #ifndef old.
8451 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8452 (GET_OVERLAYS_AT): Fix indentation.
8453 (for_each_per_buffer_object_at): New macro.
8454 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8455 (Fbuffer_local_variables): Use it.
8456 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8457 * alloc.c (allocate_buffer): Adjust to match new layout of
8458 struct buffer. Fix comment.
8459 (mark_overlay): New function.
8460 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8461 Lisp area of struct buffer.
8462 (mark_object): Use it. Adjust marking of misc objects
8463 and related comments.
8464
8465 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8466
8467 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8468 wrapper that is not needed because the wrapped code is a no-op (zero
8469 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8470 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8471
8472 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8473
8474 * alloc.c (mark_buffer): Simplify. Remove prototype.
8475 (mark_object): Add comment. Reorganize marking of vector-like
8476 objects. Use CHECK_LIVE for all vector-like objects except buffers
8477 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
8478 Avoid redundant calls to mark_vectorlike for bool vectors.
8479
8480 2012-06-30 Glenn Morris <rgm@gnu.org>
8481
8482 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8483
8484 * epaths.in (PATH_SITELOADSEARCH): New.
8485 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8486 This is rather than relying on --enable-locallisppath elements
8487 having "site-lisp" in their names. (Bug#10208#25, 11658)
8488
8489 2012-06-30 Eli Zaretskii <eliz@gnu.org>
8490
8491 * w32proc.c (sys_select): Accept and ignore one more argument.
8492
8493 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8494
8495 * sysselect.h [DOS_NT]: Don't include sys/select.h.
8496 (pselect) [!MS_DOS]: Redirect to sys_select.
8497
8498 * sysdep.c: Don't include dos.h and dosfns.h.
8499
8500 * process.c (sys_select):
8501 * msdos.c (sys_select): Accept one more argument and ignore it.
8502
8503 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8504 adapt data types and code to that.
8505
8506 * dosfns.c:
8507 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8508 which clashes with the gnulib function of the same name.
8509
8510 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8511
8512 * font.c (font_style_to_value, font_style_symbolic)
8513 (font_prop_validate_style): Add type checks for values in
8514 font_style_table.
8515
8516 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8517 argument.
8518 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8519 uses.
8520
8521 2012-06-29 Eli Zaretskii <eliz@gnu.org>
8522
8523 * xdisp.c (try_window_id): Undo last change.
8524
8525 * w32.c (getwd): Adjust commentary about startup_dir.
8526 (init_environment): Always call sys_access, even in non-MSVC
8527 builds. Don't chdir to the directory of the Emacs executable.
8528 This undoes code from 1997 which was justified by the need to
8529 "avoid conflicts when removing and renaming directories". But its
8530 downside was that every relative file name was being interpreted
8531 relative to the directory of the Emacs executable, which can never
8532 be TRT. In particular, it broke sys_access when called with
8533 relative file names.
8534 (sys_access): Map GetLastError to errno.
8535
8536 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8537
8538 * window.h (struct window): Change type of 'fringes_outside_margins'
8539 to bitfield. Fix comment. Adjust users accordingly.
8540 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
8541 Adjust comment.
8542 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8543 to ptrdiff_t.
8544
8545 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
8546
8547 * gnutls.c (emacs_gnutls_handshake):
8548 Add QUIT to make the loop interruptible.
8549
8550 2012-06-29 Glenn Morris <rgm@gnu.org>
8551
8552 * charset.c (init_charset): Make lack of etc/charsets fatal.
8553
8554 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8555
8556 * editfns.c (region_limit): Fix type mismatch.
8557
8558 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8559
8560 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8561 undefined. Convert from xassert to eassert.
8562 * nsmenu.m: Convert from xassert to eassert.
8563 * nsterm.m: Likewise.
8564
8565 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8566
8567 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8568
8569 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8570
8571 Avoid integer overflow on scroll-left and scroll-right.
8572 * window.c (HSCROLL_MAX): New macro.
8573 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8574 overflow when requested scroll falls outside ptrdiff_t range.
8575
8576 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8577
8578 * window.h (struct window): Change type of 'hscroll',
8579 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8580 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8581 Adjust users accordingly.
8582 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8583 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8584 from EMACS_INT to ptrdiff_t.
8585 (make_window): Omit redundant initialization.
8586
8587 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
8588
8589 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8590
8591 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8592
8593 * window.h (struct window): Change type of 'use_time' and
8594 'sequence_number' from Lisp_Object to int.
8595 * frame.c (make_frame): Adjust users accordingly.
8596 * print.c (print_object): Likewise.
8597 * window.c (select_window, Fwindow_use_time, make_parent_window)
8598 (make_window): Likewise.
8599
8600 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8601
8602 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8603 enabled with --enable-checking=[all,glyphs] configure option.
8604 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8605 adjust comments accordingly.
8606 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8607 undefined, adjust comments accordingly.
8608 * image.c: Likewise.
8609 * scroll.c: Likewise.
8610 * w32fns.c: Likewise.
8611 * w32term.c: Likewise.
8612 * xdisp.c: Likewise.
8613 * xfaces.c: Likewise.
8614 * xfns.c: Likewise.
8615 * xterm.c: Likewise.
8616
8617 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8618
8619 Generalize run-time debugging checks.
8620 * dispextern.h (XASSERTS): Remove.
8621 * fontset.c (xassert): Remove.
8622 Convert from xassert to eassert.
8623 * alloc.c: Convert from xassert to eassert.
8624 * bidi.c: Likewise.
8625 * dispnew.c: Likewise.
8626 * fns.c: Likewise.
8627 * fringe.c: Likewise.
8628 * ftfont.c: Likewise.
8629 * gtkutil.c: Likewise.
8630 * image.c: Likewise.
8631 * keyboard.c: Likewise.
8632 * menu.c: Likewise.
8633 * process.c: Likewise.
8634 * scroll.c: Likewise.
8635 * sound.c: Likewise.
8636 * term.c: Likewise.
8637 * w32console.c: Likewise.
8638 * w32fns.c: Likewise.
8639 * w32term.c: Likewise.
8640 * window.c: Likewise.
8641 * xdisp.c: Likewise.
8642 * xfaces.c: Likewise.
8643 * xfns.c: Likewise.
8644 * xselect.c: Likewise.
8645 * xterm.c: Likewise.
8646
8647 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8648
8649 * fns.c (maybe_resize_hash_table): Output message when growing the
8650 purify-hashtable.
8651
8652 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8653
8654 * alloc.c (allocate_string_data): Remove dead code.
8655 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8656 avoid GCC warning about unused macro.
8657
8658 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8659
8660 * alloc.c (allocate_string): Omit intervals initialization.
8661 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8662 as in make_pure_string and make_pure_c_string.
8663
8664 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8665
8666 * alloc.c (allocate_string): Fix last change.
8667
8668 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8669
8670 * alloc.c (allocate_string): Remove two redundant calls
8671 to memset, add explicit initialization where appropriate.
8672
8673 2012-06-27 Glenn Morris <rgm@gnu.org>
8674
8675 * lisp.mk (lisp): Remove paths.elc.
8676
8677 2012-06-27 Chong Yidong <cyd@gnu.org>
8678
8679 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8680
8681 2012-06-26 John Wiegley <johnw@newartisans.com>
8682
8683 * unexmacosx.c (copy_data_segment): Add two section names used
8684 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8685
8686 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8687 when building with Clang.
8688
8689 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8690
8691 * eval.c (Fapply): Allow calling it with a single argument.
8692
8693 2012-06-26 Eli Zaretskii <eliz@gnu.org>
8694
8695 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8696 _stricmp and _strnicmp.
8697 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8698
8699 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8700
8701 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8702 allocated window.
8703 (allocate_process): Likewise for new process.
8704 (allocate_terminal): Change to use offsetof.
8705 (allocate_frame): Likewise.
8706 * frame.c (make_frame): Omit redundant initialization.
8707 * window.c (make_parent_window): Use memset.
8708 (make_window): Omit redundant initialization.
8709 * process.c (make_process): Omit redundant initialization.
8710 * terminal.c (create_terminal): Likewise.
8711
8712 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8713
8714 * term.c (delete_tty): Remove redundant call to memset.
8715
8716 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8717
8718 * alloc.c: Remove build_string.
8719 * lisp.h: Define build_string as static inline. This provides
8720 a better opportunity to optimize away calls to strlen when the
8721 function is called with compile-time constant argument.
8722 * image.c (imagemagick_error): Convert to build_string.
8723 * w32proc.c (sys_spawnve): Likewise.
8724 * xterm.c (x_term_init): Likewise.
8725
8726 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8727
8728 Use sprintf return value instead of invoking strlen on result.
8729 In the old days this wasn't portable, since some sprintf
8730 implementations returned char *. But they died out years ago and
8731 Emacs already assumes sprintf returns int.
8732 Similarly for float_to_string.
8733 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8734 * ccl.c (ccl_driver):
8735 * character.c (string_escape_byte8):
8736 * data.c (Fnumber_to_string):
8737 * doprnt.c (doprnt):
8738 * print.c (print_object):
8739 * xdisp.c (message_dolog):
8740 * xfns.c (syms_of_xfns):
8741 Use sprintf or float_to_string result to avoid need to call strlen.
8742 * data.c (Fnumber_to_string):
8743 Use make_unibyte_string, since the string must be ASCII.
8744 * lisp.h, print.c (float_to_string): Now returns int length.
8745 * term.c (produce_glyphless_glyph):
8746 Use sprintf result rather than recomputing it.
8747
8748 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8749 * Makefile.in (ALL_CFLAGS):
8750 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8751 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8752
8753 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8754
8755 * dispextern.h (xstrcasecmp): Define to library function
8756 strcasecmp if available.
8757 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8758
8759 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8760
8761 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8762 Avoid comma operator.
8763 * menu.c (push_submenu_start, push_submenu_end)
8764 (push_left_right_boundary, push_menu_pane): Likewise.
8765 * msdos.c (dos_rawgetc): Likewise.
8766
8767 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8768
8769 * xfns.c (xic_create_fontsetname): Remove redundant calls
8770 to memset.
8771
8772 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8773
8774 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8775 sprintf already null-terminates its output.
8776
8777 * xfns.c (x_window): Remove redundant cast.
8778
8779 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8780
8781 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8782 `const char *' to `char *' to avoid compiler warning.
8783
8784 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8785
8786 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8787 instead of truncating it to 63 (admittedly a generous limit).
8788
8789 * process.c: Fix spelling and caps in comments.
8790
8791 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8792
8793 * emacs.c (setpgrp): Remove definition, unused.
8794 * sysdep.c (setpgrp): Remove definition, not used in this file.
8795
8796 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
8797
8798 * makefile.w32-in: Update dependencies.
8799
8800 2012-06-24 Eli Zaretskii <eliz@gnu.org>
8801
8802 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8803 (SYSTIME_H): Add nt/inc/sys/time.h.
8804
8805 * systime.h [WINDOWSNT]: Include sys/time.h.
8806
8807 * s/ms-w32.h (struct timespec): Definition moved from
8808 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8809
8810 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8811
8812 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8813 * buffer.h (buffer_slot_type_mismatch):
8814 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8815 * eval.c (unwind_to_catch):
8816 * image.c (my_png_error, my_error_exit):
8817 * keyboard.c (quit_throw_to_read_char, user_error)
8818 (Fexit_recursive_edit, Fabort_recursive_edit):
8819 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8820 (wrong_type_argument, buffer_overflow, __executable_start)
8821 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8822 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8823 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8824 (fatal):
8825 (child_setup) [!DOS_NT]:
8826 * lread.c (end_of_file_error, invalid_syntax):
8827 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8828 * puresize.h (pure_write_error):
8829 * search.c (matcher_overflow):
8830 * sound.c (sound_perror, alsa_sound_perror):
8831 * sysdep.c, syssignal.h (croak):
8832 * term.c (maybe_fatal, vfatal):
8833 * textprop.c (text_read_only):
8834 * undo.c (user_error):
8835 * unexmacosx.c (unexec_error):
8836 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8837 Use _Noreturn rather than NO_RETURN.
8838 No need for separate decl merely because of _Noreturn.
8839 * sound.c (sound_warning, parse_sound):
8840 Remove unnecessary forward decls.
8841
8842 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8843
8844 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8845 * lisp.h (WAIT_READING_MAX): New macro.
8846 * dispnew.c (Fsleep_for, sit_for):
8847 * keyboard.c (kbd_buffer_get_event):
8848 * process.c (Faccept_process_output):
8849 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8850 This improves on the previous patch, which introduced a bug
8851 when time_t is unsigned and as wide as intmax_t.
8852 See <http://bugs.gnu.org/9000#51>.
8853
8854 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8855
8856 * dispnew.c (sit_for, Fsleep_for):
8857 * keyboard.c (kbd_buffer_get_event):
8858 * process.c (Faccept_process_output): Avoid compiler warnings when
8859 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8860
8861 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8862
8863 * makefile.w32-in: Update dependencies.
8864
8865 * w32.c (ltime): Add return type and declare static.
8866 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8867
8868 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8869
8870 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8871 Privately reported by Herbert J. Skuhra.
8872 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8873 All uses changed.
8874 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8875 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8876
8877 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8878
8879 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8880 last argument of make_unibyte_string.
8881
8882 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8883 language ID in the event parameters.
8884
8885 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8886 event.code, not the obscure "character set ID".
8887
8888 2012-06-23 Chong Yidong <cyd@gnu.org>
8889
8890 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8891
8892 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8893
8894 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8895 * w32.c (fdutimens): New function.
8896
8897 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8898
8899 * s/ms-w32.h (pselect): Redirect to sys_select.
8900
8901 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8902
8903 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8904 in the logic of incrementing and decrementing the value of
8905 use_relocatable_buffers.
8906
8907 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8908
8909 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8910 Privately reported by Herbert J. Skuhra.
8911 [__FreeBSD__]: Remove "*/" typo after "#include".
8912 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8913 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8914 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8915 Don't assume EMACS_TIME and struct timeval are the same type.
8916
8917 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8918
8919 Support higher-resolution time stamps (Bug#9000).
8920 The time stamps are only nanosecond-resolution at the C level,
8921 since that's the best that any real-world system supports now.
8922 But they are picosecond-resolution at the Lisp level, as that's
8923 easy, and leaves room for future OS improvements.
8924
8925 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8926 (LIBES): Use it.
8927
8928 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8929 Don't get current time unless it's needed.
8930
8931 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8932 now provides it if it's absent.
8933 (start_atimer): Port to higher-res time stamps.
8934 Check for time stamp overflow. Don't get current time more
8935 often than is needed.
8936
8937 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8938 Include systime.h, not time.h.
8939 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8940
8941 * dired.c: Include stat-time.h.
8942 (Ffile-attributes): File times now have higher resolution.
8943
8944 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8945 (struct image): Timestamp now has higher resolution.
8946
8947 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8948 has at least microseconds now. All uses removed.
8949 (update_frame, update_single_window, update_window, update_frame_1)
8950 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8951 (duration_to_sec_usec): Remove; no longer needed.
8952
8953 * editfns.c (time_overflow): Now extern.
8954 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8955 (float-time, Fformat_time_string, Fcurrent_time_string)
8956 (Fcurrent_time_zone): Accept and generate higher-resolution
8957 time stamps.
8958 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8959 (decode_time_components, lisp_seconds_argument): New functions.
8960 (make_time): Now static.
8961 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8962 Report an error if the time is invalid, rather than having the caller
8963 do that.
8964
8965 * fileio.c: Include <stat-time.h>
8966 (Fcopy_file): Copy higher-resolution time stamps.
8967 Prefer to set the time stamp via a file descriptor if that works.
8968 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8969 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8970 (Fvisited_file_modtime, Fset_visited_file_modtime):
8971 Support higher-resolution time stamps.
8972
8973 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8974
8975 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8976
8977 * image.c (prepare_image_for_display, clear_image_cache)
8978 (lookup_image): Port to higer-resolution time stamps.
8979
8980 * keyboard.c (start_polling, bind_polling_period):
8981 Check for time stamp overflow.
8982 (read_char, kbd_buffer_get_event, timer_start_idle)
8983 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8984 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8985 Port to higher-resolution time stamps. Do not assume time_t is signed.
8986 (decode_timer): New function. Timers are now vectors of length 9,
8987 not 8, to accommodate the picosecond component.
8988 (timer_check_2): Use it.
8989
8990 * nsterm.m (select_timeout, timeval_subtract): Remove.
8991 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8992 as they're a bit more accurate and handle overflow better.
8993 (ns_select): Change prototype to be compatible with pselect.
8994 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8995 * nsterm.h (ns_select): Adjust prototype.
8996
8997 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8998 us-resolution time stamps.
8999 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
9000
9001 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
9002
9003 * lisp.h (time_overflow): New decl.
9004 (wait_reading_process_output): First arg is now intmax_t, not int,
9005 to accommodate larger waits.
9006
9007 * process.h (struct Lisp_Process.read_output_delay):
9008 Now counts nanoseconds, not microseconds.
9009 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
9010 EMACS_HAS_USECS.
9011 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
9012 (wait_reading_process_output):
9013 Port to ns-resolution time stamps.
9014 (Faccept_process_output, wait_reading_process_output):
9015 Check for time stamp overflow. Do not assume time_t is signed.
9016 (select_wrapper): Remove; we now use pselect.
9017 (Fprocess_attributes): Now generates ns-resolution time stamps.
9018
9019 * sysdep.c: Include utimens.h. Don't include utime.h
9020 or worry about struct utimbuf; gnulib does that for us now.
9021 (gettimeofday): Remove; gnulib provides a substitute.
9022 (make_timeval): New function.
9023 (set_file_times): Now sets ns-resolution time stamps.
9024 New arg FD; all uses changed.
9025 (time_from_jiffies, ltime_from_jiffies, get_up_time)
9026 (system_process_attributes):
9027 Now returns ns-resolution time stamp. All uses changed.
9028 Check for time stamp overflow.
9029
9030 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
9031 provides a substitute now.
9032
9033 * systime.h: Include timespec.h rather than sys/time.h and time.h,
9034 since it guarantees struct timespec.
9035 (EMACS_TIME): Now struct timespec, so that we can support
9036 ns-resolution time stamps.
9037 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
9038 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
9039 (EMACS_USECS): Remove.
9040 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
9041 so multiply the arg by 1000 before storing it.
9042 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
9043 New macros.
9044 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
9045 Port to ns-resolution time stamps.
9046 (EMACS_TIME_NEG_P): Remove; replaced by....
9047 (EMACS_TIME_SIGN): New macro.
9048 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
9049 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
9050 (set_file_times, make_time, lisp_time_argument): Adjust signature.
9051 (make_timeval, make_lisp_time, decode_time_components): New decls.
9052 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
9053 that it mishandled time_t overflow. You can't compare by subtracting!
9054 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
9055 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
9056
9057 * term.c: Include <sys/time.h>.
9058 (timeval_to_Time): New function, for proper overflow wraparound.
9059 (term_mouse_position, term_mouse_click): Use it.
9060
9061 * undo.c (record_first_change): Support higher-resolution time stamps
9062 in the undo buffer.
9063 (Fprimitive_undo): Use them when restoring time stamps.
9064
9065 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
9066 (w32_get_internal_run_time):
9067 Port to higher-resolution Emacs time stamps.
9068 (ltime): Now accepts single 64-bit integer, as that's more convenient
9069 for callers.
9070
9071 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
9072
9073 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
9074 for compatibility with pselect. Support ns-resolution time stamps.
9075
9076 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
9077
9078 * xselect.c (wait_for_property_change, x_get_foreign_selection):
9079 Check for time stamp overflow, and support ns-resolution time stamps.
9080
9081 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
9082 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
9083 (timeval_subtract): Remove; no longer needed.
9084 (XTflash, XTring_bell, x_wait_for_event):
9085 Port to ns-resolution time stamps. Don't assume time_t is signed.
9086
9087 2012-06-22 Chong Yidong <cyd@gnu.org>
9088
9089 * xdisp.c (x_consider_frame_title): Revert last change.
9090
9091 2012-06-22 Eli Zaretskii <eliz@gnu.org>
9092
9093 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
9094 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
9095 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
9096 staticidx goes up to 1597 out of 1600 = 0x640.)
9097
9098 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
9099
9100 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
9101 Otherwise, the umask might be mistakenly 0 while handling input signals.
9102
9103 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
9104
9105 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
9106
9107 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
9108
9109 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
9110 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
9111 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
9112 access to `contents' member of Lisp_Vector objects with AREF and ASET
9113 where appropriate.
9114
9115 2012-06-19 Chong Yidong <cyd@gnu.org>
9116
9117 * frame.c (delete_frame): When selecting a frame on a different
9118 text terminal, do not alter the terminal's top-frame.
9119
9120 * xdisp.c (format_mode_line_unwind_data): Record the target
9121 frame's selected window and its terminal's top-frame.
9122 (unwind_format_mode_line): Restore them.
9123 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
9124 Callers changed.
9125 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
9126 since tty frames can be explicitly named.
9127 (prepare_menu_bars): Likewise.
9128
9129 * term.c (Ftty_top_frame): New function.
9130
9131 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9132
9133 Port byte-code-meter to modern targets.
9134 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
9135 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
9136 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
9137 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
9138 (METER_1, METER_2): Simplify.
9139
9140 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
9141
9142 * data.c (Fdefalias): Return `symbol' (bug#11686).
9143
9144 2012-06-18 Martin Rudalics <rudalics@gmx.at>
9145
9146 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
9147 gets killed during executing of this function (Bug#11665).
9148 Try to always return Qt when the buffer has been actually killed.
9149 (Vkill_buffer_query_functions): In doc-string say that functions
9150 run by this hook should not change the current buffer.
9151
9152 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9153
9154 Fix recently-introduced process.c problems found by static checking.
9155 * process.c (write_queue_push, write_queue_pop, send_process):
9156 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
9157 (write_queue_pop): Fix pointer signedness problem.
9158 (send_process): Remove unused local.
9159
9160 2012-06-17 Chong Yidong <cyd@gnu.org>
9161
9162 * xdisp.c (redisplay_internal): No need to redisplay terminal
9163 frames that are not on top.
9164
9165 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
9166
9167 * process.c (make_process): Initialize write_queue.
9168 (write_queue_push, write_queue_pop): New functions.
9169 (send_process): Use them to maintain correct ordering of process
9170 writes (Bug#10815).
9171
9172 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
9173
9174 * lisp.h (eassert): Assume C89 or later.
9175 This removes the need for CHECK.
9176 (CHECK): Remove. Its comments about always evaluating its
9177 argument were confusing, as 'eassert' typically does not evaluate
9178 its argument.
9179
9180 * coding.c (produce_chars): Use ptrdiff_t, not int.
9181
9182 * xterm.c (x_draw_underwave): Check for integer overflow.
9183 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
9184
9185 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
9186
9187 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
9188 referenced (Bug#11583).
9189
9190 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
9191
9192 Implement wave-style variant of underlining.
9193 * dispextern.h (face_underline_type): New enum.
9194 (face): Add field for underline type.
9195 * nsterm.m (ns_draw_underwave): New function.
9196 (ns_draw_text_decoration): Use it.
9197 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
9198 New functions.
9199 (x_draw_glyph_string): Use them.
9200 * xfaces.c (Qline, Qwave): New Lisp objects.
9201 (check_lface_attrs, merge_face_ref)
9202 (Finternal_set_lisp_face_attribute, realize_x_face):
9203 Handle wave-style underline face attributes.
9204 * xterm.c (x_draw_underwave): New function.
9205 (x_draw_glyph_string): Use it.
9206
9207 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
9208
9209 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
9210 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
9211 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
9212 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
9213 ($(BLD)/w32select.$(O)): Update dependencies.
9214
9215 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9216
9217 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
9218 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
9219 * character.c (_fetch_multibyte_char_p): Remove.
9220 * alloc.c: Include "character.h" before "buffer.h".
9221 * bidi.c: Likewise.
9222 * buffer.c: Likewise.
9223 * bytecode.c: Likewise.
9224 * callint.c: Likewise.
9225 * callproc.c: Likewise.
9226 * casefiddle.c: Likewise.
9227 * casetab.c: Likewise.
9228 * category.c: Likewise.
9229 * cmds.c: Likewise.
9230 * coding.c: Likewise.
9231 * composite.c: Likewise.
9232 * dired.c: Likewise.
9233 * dispnew.c: Likewise.
9234 * doc.c: Likewise.
9235 * dosfns.c: Likewise.
9236 * editfns.c: Likewise.
9237 * emacs.c: Likewise.
9238 * fileio.c: Likewise.
9239 * filelock.c: Likewise.
9240 * font.c: Likewise.
9241 * fontset.c: Likewise.
9242 * fringe.c: Likewise.
9243 * indent.c: Likewise.
9244 * insdel.c: Likewise.
9245 * intervals.c: Likewise.
9246 * keyboard.c: Likewise.
9247 * keymap.c: Likewise.
9248 * lread.c: Likewise.
9249 * macros.c: Likewise.
9250 * marker.c: Likewise.
9251 * minibuf.c: Likewise.
9252 * nsfns.m: Likewise.
9253 * nsmenu.m: Likewise.
9254 * print.c: Likewise.
9255 * process.c: Likewise.
9256 * regex.c: Likewise.
9257 * region-cache.c: Likewise.
9258 * search.c: Likewise.
9259 * syntax.c: Likewise.
9260 * term.c: Likewise.
9261 * textprop.c: Likewise.
9262 * undo.c: Likewise.
9263 * unexsol.c: Likewise.
9264 * w16select.c: Likewise.
9265 * w32fns.c: Likewise.
9266 * w32menu.c: Likewise.
9267 * window.c: Likewise.
9268 * xdisp.c: Likewise.
9269 * xfns.c: Likewise.
9270 * xmenu.c: Likewise.
9271 * xml.c: Likewise.
9272 * xselect.c: Likewise.
9273
9274 2012-06-16 Eli Zaretskii <eliz@gnu.org>
9275
9276 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
9277 If all the glyphs of the glyph row came from strings, and we have no
9278 cursor positioning clues, put the cursor on the first glyph of the
9279 row.
9280 (handle_face_prop): Use chunk-relative overlay string index when
9281 indexing into it->string_overlays array. (Bug#11653)
9282 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
9283 the rightmost. (Bug#11720)
9284
9285 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9286
9287 * category.h (CHAR_HAS_CATEGORY): Define as inline.
9288 (CATEGORY_MEMBER): Enforce 1/0 value.
9289 * category.c (_temp_category_set): Remove.
9290
9291 2012-06-16 Eli Zaretskii <eliz@gnu.org>
9292
9293 * window.c (Fdelete_other_windows_internal)
9294 (Fdelete_window_internal): Don't access frame's mouse highlight
9295 info of the initial frame. (Bug#11677)
9296
9297 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
9298
9299 * .gdbinit (xgetint): Fix recently-introduced paren typo.
9300 Assume USE_2_TAGS_FOR_INTS.
9301 (xreload): Adjust $tagmask width to match recent lisp.h change.
9302
9303 Simplify lisp.h in minor ways that should not affect code.
9304 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
9305 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
9306 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
9307 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
9308 (INTTYPEBITS): New macro, for clarity.
9309 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
9310 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
9311 Simplify now that USE_LSB_TAG is always defined.
9312 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
9313 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
9314
9315 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
9316
9317 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
9318
9319 2012-06-13 Glenn Morris <rgm@gnu.org>
9320
9321 * s/bsd-common.h (BSD4_3):
9322 * s/usg5-4-common.h (USG5_4): No longer define; unused.
9323
9324 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
9325
9326 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
9327 instead of union.
9328 (XLI, XIL): Define.
9329 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
9330 Use them.
9331 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
9332 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
9333 * alloc.c (widen_to_Lisp_Object): Remove.
9334 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
9335 * frame.c (delete_frame): Remove outdated comment.
9336 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
9337 USE_LISP_UNION_TYPE.
9338 (Fw32_unregister_hot_key): Likewise.
9339 (Fw32_toggle_lock_key): Likewise.
9340 * w32menu.c (add_menu_item): Likewise.
9341 (w32_menu_display_help): Use XIL instead of checking
9342 USE_LISP_UNION_TYPE.
9343 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
9344 (init_heap): Likewise.
9345 * w32term.c (w32_read_socket): Update comment.
9346
9347 2012-06-13 Glenn Morris <rgm@gnu.org>
9348
9349 * s/usg5-4-common.h, src/s/unixware.h:
9350 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
9351
9352 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
9353
9354 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
9355
9356 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
9357 * alloc.c (make_number) [!defined make_number]:
9358 Remove, as lisp.h always defines this now.
9359 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
9360 (roundup_size): Verify that it is a power of 2.
9361 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
9362 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
9363 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
9364 -DUSE_LSB_TAG=0, to override the automatically-selected default.
9365 USE_LSB_TAG now is always defined to be either 0 or 1.
9366 All uses changed.
9367 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
9368 code works fine either way, and efficiency is not a concern here,
9369 as the union type is for debugging, not for production.
9370 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
9371 Use an inline function on all platforms when using the union type,
9372 since this is simpler and 'static inline' can be used portably
9373 within Emacs now.
9374 (LISP_INITIALLY_ZERO): New macro.
9375 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
9376 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
9377
9378 2012-06-12 Glenn Morris <rgm@gnu.org>
9379
9380 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
9381
9382 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
9383
9384 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
9385 Move BROKEN_SIGIO to configure.
9386
9387 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
9388 Move NO_TERMIO to configure.
9389
9390 2012-06-12 Chong Yidong <cyd@gnu.org>
9391
9392 * image.c (imagemagick_load_image): Use MagickFlattenImage if
9393 MagickMergeImageLayers is undefined. Use pixel pusher loop if
9394 MagickExportImagePixels is undefined.
9395
9396 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
9397
9398 * image.c (imagemagick_load_image): Remove unused label.
9399
9400 2012-06-11 Glenn Morris <rgm@gnu.org>
9401
9402 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9403 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
9404 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
9405 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
9406
9407 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
9408
9409 * alloc.c (make_byte_code): New function.
9410 (Fmake_byte_code): Use it. Don't purify here.
9411 * lread.c (read1): Use it as well to avoid extra allocation.
9412
9413 2012-06-11 Chong Yidong <cyd@gnu.org>
9414
9415 * image.c (imagemagick_load_image): Implement transparency.
9416
9417 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
9418
9419 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
9420 account for preceding backslashes. (Bug#11663)
9421
9422 2012-06-09 Chong Yidong <cyd@gnu.org>
9423
9424 * term.c: Support italics in capable terminals (Bug#9652).
9425 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
9426 (turn_on_face): Output using TS_enter_italic_mode if available.
9427 Don't handle unused blinking and alt-charset cases.
9428 (turn_off_face): Handle italic case; discard unused tty_blinking_p
9429 and tty_alt_charset_p cases.
9430 (tty_capable_p, init_tty): Support italics.
9431
9432 * termchar.h (struct tty_display_info): Add field for italics.
9433 Remove unused blink field.
9434
9435 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
9436 Handle slant.
9437
9438 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
9439 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
9440 tty_alt_charset_p. Add tty_italic_p.
9441
9442 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
9443
9444 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9445 dbus_type_is_basic if available.
9446 (xd_extract_signed, xd_extract_unsigned): Rename from
9447 extract_signed and extract_unsigned, respectively. Adapt callers.
9448
9449 2012-06-09 Chong Yidong <cyd@gnu.org>
9450
9451 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9452
9453 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9454 case (Bug#9752).
9455
9456 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9457
9458 * xdisp.c (vmessage): Treat frame message as multibyte.
9459 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9460 would generate the diagnostic "Making \302\247 buffer-local while
9461 let-bound!".
9462
9463 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9464
9465 * dispnew.c (showing_window_margins_p): Undo last change, which
9466 was done due to an inadvertent commit.
9467 (adjust_frame_glyphs_for_frame_redisplay): Do call
9468 showing_window_margins_p.
9469
9470 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9471
9472 * eval.c (Fmake_var_non_special): New primitive.
9473 (syms_of_eval): Defsubr it.
9474 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9475
9476 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
9477
9478 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9479 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9480
9481 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9482
9483 * alloc.c (allocate_vectorlike): Fix last change.
9484
9485 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9486
9487 Block-based vector allocation of small vectors.
9488 * lisp.h (struct vectorlike_header): New field `nbytes',
9489 adjust comment accordingly.
9490 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
9491 to denote vector blocks. Adjust users (live_vector_p,
9492 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9493 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9494 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9495 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9496 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9497 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9498 (roundup_size): New constant.
9499 (struct vector_block): New data type.
9500 (vector_blocks, vector_free_lists, zero_vector): New variables.
9501 (all_vectors): Rename to `large_vectors'.
9502 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9503 (sweep_vectors): New functions.
9504 (allocate_vectorlike): Return `zero_vector' as the only vector of
9505 0 items. Allocate new vector from block if vector size is less than
9506 or equal to VBLOCK_BYTES_MAX.
9507 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9508 (init_alloc_once): Add call to init_vectors.
9509
9510 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9511
9512 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9513
9514 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9515
9516 * doprnt.c (doprnt): Truncate multibyte char correctly.
9517 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9518 would mishandle a string argument "Xc" if X was a multibyte
9519 character of length 2: it would truncate after X's first byte
9520 rather than including all of X.
9521
9522 2012-06-06 Chong Yidong <cyd@gnu.org>
9523
9524 * buffer.c (word_wrap): Doc fix.
9525
9526 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9527
9528 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9529
9530 2012-06-03 Glenn Morris <rgm@gnu.org>
9531
9532 * xdisp.c (tool-bar-style): Doc fix.
9533
9534 2012-06-03 Ulrich Müller <ulm@gentoo.org>
9535
9536 * Makefile.in (PAXCTL): Define.
9537 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9538 binary via PaX flags if the paxctl utility is available.
9539 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9540 Restore PaX flags to their default. (Bug#11398)
9541
9542 2012-06-03 Chong Yidong <cyd@gnu.org>
9543
9544 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9545 buffer (Bug#11226).
9546
9547 2012-06-03 Chong Yidong <cyd@gnu.org>
9548
9549 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9550 (note_mode_line_or_margin_highlight): If there is no help echo,
9551 use mode-line-default-help-echo. Handle the case where the mouse
9552 position is past the end of the mode line string.
9553
9554 * buffer.c (buffer_local_value_1): New function, split from
9555 Fbuffer_local_value; can return Qunbound.
9556 (Fbuffer_local_value): Use it.
9557 (Vmode_line_format): Docstring tweaks.
9558
9559 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9560
9561 * sysdep.c (system_process_attributes): Improve comment.
9562
9563 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9564
9565 * keyboard.c: Export real-this-command to Elisp.
9566 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9567 and DEFVAR it. Update all users.
9568
9569 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9570
9571 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9572
9573 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9574 Convert pctcpu and pctmem to Lisp float properly.
9575 Let the compiler fold better, as 100.0/0x8000 is exact.
9576
9577 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9578
9579 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9580 cons_block.
9581
9582 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9583
9584 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9585
9586 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9587
9588 For a 'struct window', replace some Lisp_Object fields to
9589 bitfields where appropriate, remove unused fields.
9590 * window.h (struct window): Remove unused 'last_mark_x' and
9591 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
9592 change its type from Lisp_Object to bitfield.
9593 Change type of 'force_start', 'optional_new_start',
9594 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
9595 fields from Lisp_Object to bitfield. Adjust users accordingly.
9596
9597 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9598
9599 Pacify gcc -Wdouble-precision when using Xaw.
9600 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9601 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9602 Use 'float' consistently, rather than 'float' in most places
9603 and 'double' in a couple of places.
9604
9605 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9606
9607 * xdisp.c (handle_stop): Detect whether we have overlay strings
9608 loaded by testing it->current.overlay_string_index to be
9609 non-negative, instead of checking whether n_overlay_strings is
9610 positive. (Bug#11587)
9611
9612 2012-05-31 Chong Yidong <cyd@gnu.org>
9613
9614 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9615
9616 * doc.c (Fsubstitute_command_keys): Doc fix.
9617
9618 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9619
9620 * search.c (search_buffer): Remove calls to
9621 r_alloc_inhibit_buffer_relocation, as it is now called by
9622 maybe_unify_char, which was the cause of relocation of buffer text
9623 in bug#11519.
9624
9625 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9626
9627 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9628 for the duration of call to load_charset, to avoid problems with
9629 callers of maybe_unify_char that access buffer text through C
9630 pointers.
9631
9632 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9633 decrement the inhibition flag, instead of just setting or
9634 resetting it.
9635
9636 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9637
9638 Remove obsolete '#define static' cruft.
9639 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9640 This #undef was "temporary" in 2000; it is no longer needed
9641 now that '#define static' has gone away.
9642 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9643 (gray_bitmap_bits): Remove; no longer needed.
9644 All uses replaced with definiens.
9645 * xterm.c: Include "bitmaps/gray.xbm".
9646
9647 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9648
9649 Clean up __executable_start, monstartup when --enable-profiling.
9650 The following changes affect the code only when profiling.
9651 * dispnew.c (__executable_start): Rename from safe_bcopy.
9652 Define only on platforms that need it.
9653 * emacs.c: Include <sys/gmon.h> when profiling.
9654 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9655 (__executable_start): Remove decl, since lisp.h does it now.
9656 (safe_bcopy): Remove decl; no longer has that name.
9657 (main): Coalesce #if into single bit of code, for simplicity.
9658 Cast pointers to uintptr_t, since standard libraries want integers
9659 and not pointers.
9660 * lisp.h (__executable_start): New decl.
9661
9662 2012-05-31 Glenn Morris <rgm@gnu.org>
9663
9664 * image.c (Fimagemagick_types): Doc fix.
9665
9666 2012-05-30 Jim Meyering <meyering@redhat.com>
9667
9668 * callproc.c (Fcall_process_region): Include directory component
9669 in mkstemp error message (Bug#11586).
9670
9671 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9672
9673 * alloc.c, lisp.h (make_pure_vector): Now static.
9674
9675 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9676
9677 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9678 Move to byte-run.el.
9679 (Fautoload): Do the hash-doc more carefully.
9680 * data.c (Fdefalias): Purify definition, except for keymaps.
9681 (Qdefun): Move from eval.c.
9682 * lisp.h (Qdefun): Remove.
9683 * lread.c (read1): Tiny simplification.
9684
9685 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
9686
9687 Do not create empty overlays with the evaporate property (Bug#9642).
9688 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9689 Bug#9642, but explicitly check that the buffer the overlay would
9690 be moved to is live and rearrange lines to make sure that errors
9691 will not put the overlay in an inconsistent state.
9692 (Fdelete_overlay): Cosmetics.
9693
9694 2012-05-28 Eli Zaretskii <eliz@gnu.org>
9695
9696 * w32term.c (my_bring_window_to_top): New function.
9697 (x_raise_frame): Use handle returned by DeferWindowPos, which
9698 could be different from the original one.
9699 Call my_bring_window_to_top instead of my_set_foreground_window.
9700 (Bug#11513)
9701
9702 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9703 by calling BringWindowToTop.
9704
9705 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9706 (WM_EMACS_END): Increase by one.
9707
9708 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9709
9710 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9711 This avoids undefined behavior that might cause the eassert
9712 to not catch an out-of-range value.
9713
9714 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
9715
9716 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9717 Update dependencies.
9718
9719 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9720
9721 * bidi.c (bidi_mirror_char): Fix last change.
9722
9723 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9724
9725 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9726 when referring to sectname field in printf format.
9727
9728 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9729
9730 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9731 Only r_alloc_inhibit_buffer_relocation needed to be added;
9732 the others were already declared.
9733
9734 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9735 before checking whether it's out of range. Put the check inside
9736 eassert. See
9737 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9738
9739 2012-05-27 Ken Brown <kbrown@cornell.edu>
9740
9741 * callproc.c (Fcall_process): Restore a line that was accidentally
9742 commented out in the 2011-02-13 change (bug#11547).
9743
9744 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9745
9746 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9747 defined on ralloc.c.
9748
9749 * buffer.c [REL_ALLOC]: Remove prototypes of
9750 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9751 they are now on lisp.h.
9752
9753 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9754
9755 * search.c (search_buffer): Use it to inhibit relocation of buffer
9756 text while re_search_2 is doing its job, because re_search_2 is
9757 passed C pointers to buffer text. (Bug#11519)
9758
9759 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9760 Update value to 24.
9761
9762 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9763 state after an additional call to move_it_in_display_line_to, keep
9764 the values of it->max_ascent and it->max_descent found for the
9765 entire line.
9766 (pos_visible_p): Revert the comparison against bottom_y to what it
9767 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9768 (Bug#11464)
9769
9770 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9771
9772 Fix coding-related core dumps with gcc -ftrapv.
9773 The code was computing A - B, where A and B are pointers, and B is
9774 random garbage. This can lead to core dumps on platforms that
9775 have special pointer registers, and it also leads to core dumps on
9776 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9777 A - B only when B is initialized properly.
9778 * coding.c (coding_set_source, coding_set_destination): Return void.
9779 (coding_change_source, coding_change_destinations): New functions,
9780 with the old behaviors of coding_set_source and coding_set_destination.
9781 All callers that need an offset changed to use these new functions.
9782
9783 2012-05-26 Glenn Morris <rgm@gnu.org>
9784
9785 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9786
9787 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9788
9789 Extend mouse support on W32 text-mode console.
9790 * xdisp.c (draw_row_with_mouse_face):
9791 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9792
9793 * w32console.c: Include window.h.
9794 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9795 New functions.
9796 (initialize_w32_display): Initialize mouse-highlight data.
9797
9798 * w32inevt.c: Include termchar.h and window.h.
9799 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9800 moves, call note_mouse_highlight. If help_echo changed, call
9801 gen_help_event to produce help-echo message in the echo area.
9802 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9803 highlight info.
9804
9805 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9806
9807 * lread.c (read1): Simplify slightly to avoid an overflow warning
9808 with GCC 4.7.0 on x86-64.
9809
9810 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9811
9812 * bidi.c (bidi_mirror_char): Revert last change: an int is
9813 definitely wide enough here.
9814
9815 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
9816
9817 Fix integer width and related bugs (Bug#9874).
9818 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9819 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9820 (string_bytes, check_sblock, allocate_string_data):
9821 (compact_small_strings, Fmake_bool_vector, make_string)
9822 (make_unibyte_string, make_multibyte_string)
9823 (make_string_from_bytes, make_specified_string)
9824 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9825 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9826 (mark_vectorlike):
9827 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9828 (allocate_pseudovector):
9829 Use int, not EMACS_INT, where int is wide enough.
9830 (inhibit_garbage_collection, Fgarbage_collect):
9831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9832 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9833 int might not be wide enough.
9834 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9835 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9836 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9837 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9838 (bidi_level_of_next_char, bidi_move_to_visually_next):
9839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9840 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9841 (Fkill_buffer, Fset_buffer_major_mode)
9842 (advance_to_char_boundary, Fbuffer_swap_text)
9843 (Fset_buffer_multibyte, overlays_at, overlays_in)
9844 (overlay_touches_p, struct sortvec, record_overlay_string)
9845 (overlay_strings, recenter_overlay_lists)
9846 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9847 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9848 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9849 (Foverlay_recenter, last_overlay_modification_hooks_used)
9850 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9851 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9852 (validate_region): Omit unnecessary test for b <= e,
9853 since that's guaranteed by the previous test.
9854 (adjust_overlays_for_delete): Avoid pos + length overflow.
9855 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9856 (report_overlay_modification):
9857 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9858 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9859 Omit pointer cast, which isn't needed anyway, and doesn't work
9860 after the EMACS_INT -> ptrdiff_t change.
9861 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9862 * buffer.h: Adjust decls to match defn changes elsewhere.
9863 (struct buffer_text, struct buffer):
9864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9865 Use EMACS_INT, not int, where int might not be wide enough.
9866 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9867 not int, to avoid needless 32-bit limit on 64-bit hosts.
9868 (exec_byte_code): Use tighter memory-full test, one that checks
9869 for alloca overflow. Don't compute the address of the object just
9870 before an array, as that's not portable. Use EMACS_INT, not
9871 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9872 * callint.c (Fcall_interactively):
9873 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9874 * callproc.c (call_process_kill, Fcall_process):
9875 Don't assume pid_t fits into an Emacs fixnum.
9876 (call_process_cleanup, Fcall_process, child_setup):
9877 Don't assume pid_t fits into int.
9878 (call_process_cleanup, Fcall_process, delete_temp_file)
9879 (Fcall_process_region):
9880 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9881 (Fcall_process): Simplify handling of volatile integers.
9882 Use int, not EMACS_INT, where int will do.
9883 * casefiddle.c (casify_object, casify_region, operate_on_word)
9884 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9885 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9886 (casify_object): Avoid integer overflow when overallocating buffer.
9887 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9888 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9889 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9890 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9891 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9892 integers are now checked earlier. All uses replaced with XINT.
9893 (ccl_driver):
9894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9895 For CCL_MapSingle, check that content and value are in int range.
9896 (ccl_driver, Fregister_code_conversion_map):
9897 Check that Vcode_version_map_vector is a vector.
9898 (resolve_symbol_ccl_program): Check that vector header is in range.
9899 Always copy the vector, so that we can check its contents reliably
9900 now rather than having to recheck each instruction as it's being
9901 executed. Check that vector words fit in 'int'.
9902 (ccl_get_compiled_code, Fregister_ccl_program)
9903 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9904 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9905 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9906 contents are in range.
9907 (Fccl_execute_on_string): Check that status is in range.
9908 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9909 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9910 Accept and return EMACS_INT, not int, because callers can pass values
9911 out of 'int' range.
9912 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9913 (multibyte_chars_in_text, parse_str_as_multibyte)
9914 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9915 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9916 (string_escape_byte8, Fget_byte):
9917 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9918 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9919 avoid mishandling large integers.
9920 * character.h: Adjust decls to match defn changes elsewhere.
9921 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9922 (Ffind_charset_region):
9923 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9924 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9925 (load_charset_map_from_vector, Fdefine_charset_internal):
9926 Don't assume fixnum fits in int.
9927 (load_charset_map_from_vector, Fmap_charset_chars):
9928 Remove now-unnecessary CHECK_NATNUMs.
9929 (Fdefine_charset_internal): Check ranges here, more carefully.
9930 Don't rely on undefined behavior with signed left shift overflow.
9931 Don't assume unsigned int fits into fixnum, or that fixnum fits
9932 into unsigned int. Don't require max_code to be a valid fixnum;
9933 that's not true for gb10830 4-byte on a 32-bit host. Allow
9934 invalid_code to be a cons, for the same reason. Require code_offset
9935 to be a character. Avoid int overflow if max_char is close
9936 to INT_MAX.
9937 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9938 this is intended anyway and avoids some undefined behavior.
9939 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9940 INDEX_TO_CODE_POINT, as that's what it expects.
9941 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9942 * charset.h (DECODE_CHAR): Return int, not unsigned;
9943 this is what was intended anyway, and it avoids undefined behavior.
9944 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9945 integer-overflow issues.
9946 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9947 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9948 where the argument is EMACS_INT, and this behavior is not intended.
9949 * chartab.c (Fmake_char_table, Fset_char_table_range)
9950 (uniprop_get_decoder, uniprop_get_encoder):
9951 Don't assume fixnum fits in int.
9952 * cmds.c (move_point): New function, that does the gist of
9953 Fforward_char and Fbackward_char, but does so while checking
9954 for integer overflow more accurately.
9955 (Fforward_char, Fbackward_char): Use it.
9956 (Fforward_line, Fend_of_line, internal_self_insert)
9957 (internal_self_insert):
9958 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9959 Fix a FIXME, by checking for integer overflow when calculating
9960 target_clm and actual_clm.
9961 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9962 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9963 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9964 (coding_alloc_by_making_gap, alloc_destination)
9965 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9966 (encode_coding_utf_16, detect_coding_emacs_mule)
9967 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9968 (detect_coding_iso_2022, decode_coding_iso_2022)
9969 (encode_invocation_designation, encode_designation_at_bol)
9970 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9971 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9972 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9973 (encode_coding_ccl, encode_coding_raw_text)
9974 (detect_coding_charset, decode_coding_charset)
9975 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9976 (produce_composition, produce_charset, produce_annotation)
9977 (decode_coding, handle_composition_annotation)
9978 (handle_charset_annotation, consume_chars, decode_coding_gap)
9979 (decode_coding_object, encode_coding_object, detect_coding_system)
9980 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9981 (code_convert_region, code_convert_string)
9982 (Fdefine_coding_system_internal)
9983 (coding_set_source, coding_set_destination):
9984 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9985 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9986 (Fdefine_coding_system_internal):
9987 Don't assume fixnums fit in int.
9988 (decode_coding_gap, decode_coding_object, encode_coding_object)
9989 (Fread_coding_system, Fdetect_coding_region)
9990 (Funencodable_char_position, Fcheck_coding_systems_region)
9991 (get_translation, handle_composition_annotation, consume_chars):
9992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9993 (consume_chars): Rewrite to not calculate an address outside buffer.
9994 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9995 Don't access memory outside of the args array.
9996 (Fdefine_coding_system_internal): Check for charset-id overflow.
9997 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9998 result of ENCODE_CHAR.
9999 * coding.h: Adjust decls to match defn changes elsewhere.
10000 (struct coding_system):
10001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10002 * composite.c (get_composition_id, find_composition)
10003 (run_composition_function, update_compositions)
10004 (compose_text, composition_gstring_put_cache)
10005 (composition_gstring_p, composition_gstring_width)
10006 (fill_gstring_header, fill_gstring_body, autocmp_chars)
10007 (composition_compute_stop_pos, composition_reseat_it)
10008 (composition_update_it, struct position_record)
10009 (find_automatic_composition, composition_adjust_point)
10010 (Fcomposition_get_gstring, Ffind_composition_internal):
10011 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10012 (update_compositions):
10013 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10014 * composite.h: Adjust decls to match defn changes elsewhere.
10015 (struct composition):
10016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10017 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
10018 Do not attempt to compute the address of the object just before a
10019 buffer; this is not portable.
10020 (Faref, Faset):
10021 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10022 (Faset): Use int, not EMACS_INT, where int is wide enough.
10023 (Fstring_to_number): Don't assume fixnums fit in int.
10024 (Frem): Don't assume arg is nonnegative.
10025 * dbusbind.c (xd_append_arg): Check for integers out of range.
10026 (Fdbus_call_method): Don't overflow the timeout int.
10027 (extract_signed, extract_unsigned): New functions.
10028 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
10029 (xd_get_connection_references): Return ptrdiff_t, not int.
10030 All uses changed.
10031 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
10032 (xd_read_message_1):
10033 Use int, not unsigned, where the dbus API uses int.
10034 (Fdbus_message_internal): Don't overflow mtype.
10035 (syms_of_dbusbind): Allocate right-sized buffer for integers.
10036 * dired.c (directory_files_internal, file_name_completion, scmp)
10037 (file_name_completion_stat):
10038 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10039 (file_name_completion): Don't overflow matchcount.
10040 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
10041 * dispextern.h: Adjust decls to match defn changes elsewhere.
10042 (struct text_pos, struct glyph, struct bidi_saved_info)
10043 (struct bidi_string_data, struct bidi_it, struct composition_it)
10044 (struct it):
10045 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10046 (struct display_pos, struct composition_it, struct it):
10047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10048 * dispnew.c (increment_matrix_positions)
10049 (increment_row_positions, mode_line_string)
10050 (marginal_area_string):
10051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10052 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
10053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10054 (duration_to_sec_usec): New function, to check for overflow better.
10055 (Fsleep_for, sit_for): Use it.
10056 * doc.c (get_doc_string, store_function_docstring):
10057 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10058 (get_doc_string, Fsnarf_documentation):
10059 Use int, not EMACS_INT, where int is wide enough.
10060 (get_doc_string):
10061 Use SAFE_ALLOCA, not alloca.
10062 Check for overflow when converting EMACS_INT to off_t.
10063 * doprnt.c (doprnt):
10064 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10065 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
10066 Don't assume uid_t fits into fixnum.
10067 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
10068 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
10069 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
10070 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
10071 (general_insert_function)
10072 (Finsert_char, make_buffer_string, make_buffer_string_both)
10073 (update_buffer_properties, Fbuffer_substring)
10074 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
10075 (Fsubst_char_in_region, check_translation)
10076 (Ftranslate_region_internal, save_restriction_restore, Fformat)
10077 (transpose_markers, Ftranspose_regions):
10078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10079 (clip_to_bounds): Move to lisp.h as an inline function).
10080 (Fconstrain_to_field): Don't assume integers are nonnegative.
10081 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
10082 (Fsubst_char_in_region, Fsave_restriction):
10083 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10084 (Femacs_pid): Don't assume pid_t fits into fixnum.
10085 (lo_time): Use int, not EMACS_INT, when int suffices.
10086 (lisp_time_argument): Check for usec out of range.
10087 (Fencode_time): Don't assume fixnum fits in int.
10088 (Fuser_login_name, Fuser_full_name): Signal an error
10089 if a uid argument is out of range, rather than relying on
10090 undefined behavior.
10091 (Fformat_time_string): Remove now-unnecessary check.
10092 lisp_time_argument checks for out-of-range usec now.
10093 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
10094 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
10095 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
10096 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
10097 (init_cmdargs, Fdump_emacs):
10098 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10099 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
10100 the bottom (typically) 32 bits of the fixnum.
10101 * eval.c (specpdl_size, call_debugger):
10102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10103 (when_entered_debugger, Fbacktrace_debug):
10104 Don't assume fixnum can fit in int.
10105 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
10106 the object just before a buffer; this is not portable.
10107 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
10108 (grow_specpdl, unbind_to):
10109 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10110 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
10111 (grow_specpdl): Simplify allocation by using xpalloc.
10112 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
10113 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
10114 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
10115 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10116 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
10117 (a_write, e_write):
10118 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10119 (Fcopy_file, non_regular_nbytes, read_non_regular)
10120 (Finsert_file_contents):
10121 Use int, not EMACS_INT, where int is wide enough.
10122 (READ_BUF_SIZE): Verify that it fits in int.
10123 (Finsert_file_contents): Check that counts are in proper range,
10124 rather than assuming fixnums fit into ptrdiff_t etc.
10125 Don't assume fixnums fit into int.
10126 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
10127 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
10128 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
10129 (string_char_to_byte, string_byte_to_char)
10130 (string_make_multibyte, string_to_multibyte)
10131 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
10132 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
10133 (substring_both, Fdelete, internal_equal, Ffillarray)
10134 (Fclear_string, mapcar1)
10135 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
10136 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
10137 (larger_vector, make_hash_table, maybe_resize_hash_table)
10138 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
10139 (Fmaphash, secure_hash):
10140 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10141 (concat): Check for string index and length overflow.
10142 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
10143 (Frequire):
10144 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10145 (larger_vector): New API (vec, incr_min, size_max) replaces old
10146 one (vec, new_size, init). This catches size overflow.
10147 INIT was removed because it was always Qnil.
10148 All callers changed.
10149 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
10150 the upper bound on a hash table index size.
10151 (make_hash_table, maybe_resize_hash_table): Use it.
10152 (secure_hash): Computer start_byte and end_byte only after
10153 they're known to be in ptrdiff_t range.
10154 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
10155 (Ffont_get_glyphs, Ffont_at):
10156 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10157 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
10158 (Flist_fonts, Fopen_font):
10159 Don't assume fixnum can fit in int.
10160 (check_gstring): Don't assume index can fit in int.
10161 (font_match_p): Check that fixnum is a character, not a nonnegative
10162 fixnum, since the later code needs to stuff it into an int.
10163 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
10164 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
10165 conversion overflow issues.
10166 (Fopen_font): Check for integer out of range.
10167 (Ffont_get_glyphs): Don't assume index can fit in int.
10168 * font.h: Adjust decls to match defn changes elsewhere.
10169 * fontset.c (reorder_font_vector): Redo score calculation to avoid
10170 integer overflow.
10171 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
10172 printmax_t, where ptrdiff_t is wide enough.
10173 (Finternal_char_font):
10174 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10175 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
10176 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
10177 (Fset_frame_position, x_set_frame_parameters)
10178 (x_set_line_spacing, x_set_border_width)
10179 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
10180 Check that fixnums are in proper range for system types.
10181 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
10182 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10183 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
10184 Use SAFE_ALLOCA_LISP, not alloca.
10185 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
10186 intptr_t is wide enough.
10187 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
10188 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
10189 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
10190 Check for fixnum out of range.
10191 * ftfont.c (ftfont_list): Don't assume index fits in int.
10192 Check that fixnums are in proper range for system types.
10193 (ftfont_shape_by_flt):
10194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10195 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10197 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
10198 Check that fixnums are in proper range for system types.
10199 * gnutls.h: Adjust decls to match defn changes elsewhere.
10200 * gtkutil.c (xg_dialog_run):
10201 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10202 (update_frame_tool_bar):
10203 Check that fixnums are in proper range for system types.
10204 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
10205 (lookup_image): Check that fixnums are in range for system types.
10206 * indent.c (last_known_column, last_known_column_point):
10207 (current_column_bol_cache):
10208 (skip_invisible, current_column, check_display_width):
10209 (check_display_width, scan_for_column, current_column_1)
10210 (Findent_to, Fcurrent_indentation, position_indentation)
10211 (indented_beyond_p, Fmove_to_column, compute_motion):
10212 (Fcompute_motion, Fvertical_motion):
10213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10214 (last_known_column_modified): Use EMACS_INT, not int.
10215 (check_display_width):
10216 (Fcompute_motion):
10217 Check that fixnums and floats are in proper range for system types.
10218 (compute_motion): Don't assume index or fixnum fits in int.
10219 (compute_motion, Fcompute_motion):
10220 Use int, not EMACS_INT, when it is wide enough.
10221 (vmotion): Omit local var start_hpos that is always 0; that way
10222 we don't need to worry about overflow in expressions involving it.
10223 * indent.h: Adjust decls to match defn changes elsewhere.
10224 (struct position):
10225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10226 Use int, not EMACS_INT, where int is wide enough.
10227 Remove unused members ovstring_chars_done and tab_offset;
10228 all uses removed.
10229 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
10230 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
10231 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
10232 (make_gap, copy_text, insert, insert_and_inherit)
10233 (insert_before_markers, insert_before_markers_and_inherit)
10234 (insert_1, count_combining_before, count_combining_after)
10235 (insert_1_both, insert_from_string)
10236 (insert_from_string_before_markers, insert_from_string_1)
10237 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
10238 (adjust_after_replace, adjust_after_insert, replace_range)
10239 (replace_range_2, del_range, del_range_1, del_range_byte)
10240 (del_range_both, del_range_2, modify_region)
10241 (prepare_to_modify_buffer, signal_before_change)
10242 (signal_after_change, Fcombine_after_change_execute):
10243 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10244 * intervals.c (traverse_intervals, rotate_right, rotate_left)
10245 (balance_an_interval, split_interval_right, split_interval_left)
10246 (find_interval, next_interval, update_interval)
10247 (adjust_intervals_for_insertion, delete_node, delete_interval)
10248 (interval_deletion_adjustment, adjust_intervals_for_deletion)
10249 (static_offset_intervals, offset_intervals)
10250 (merge_interval_right, merge_interval_left, make_new_interval)
10251 (graft_intervals_into_buffer, temp_set_point_both)
10252 (temp_set_point, set_point, adjust_for_invis_intang)
10253 (set_point_both, move_if_not_intangible, get_property_and_range)
10254 (get_local_map, copy_intervals, copy_intervals_to_string)
10255 (compare_string_intervals, set_intervals_multibyte_1):
10256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10257 * intervals.h: Adjust decls to match defn changes elsewhere.
10258 (struct interval):
10259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10260 * keyboard.c (this_command_key_count, this_single_command_key_start)
10261 (before_command_key_count, before_command_echo_length, echo_now)
10262 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
10263 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
10264 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
10265 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
10266 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10267 (last_non_minibuf_size, last_point_position, echo_truncate)
10268 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
10269 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
10270 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
10271 (stuff_buffered_input):
10272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10273 (last_auto_save, command_loop_1, read_char):
10274 Use EMACS_INT, not int, to avoid integer overflow.
10275 (record_char): Avoid overflow in total_keys computation.
10276 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
10277 * keyboard.h: Adjust decls to match defn changes elsewhere.
10278 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
10279 (Fkey_description, Fdescribe_vector, Flookup_key):
10280 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10281 (click_position): New function, to check that positions are in range.
10282 (Fcurrent_active_maps):
10283 (describe_command):
10284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10285 (Faccessible_keymaps, Fkey_description):
10286 (preferred_sequence_p):
10287 Don't assume fixnum can fit into int.
10288 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
10289 Check for integer overflow in size calculations.
10290 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
10291 avoid mishandling large integers.
10292 * lisp.h: Adjust decls to match defn changes elsewhere.
10293 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
10294 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
10295 (struct Lisp_Marker):
10296 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10297 (clip_to_bounds): Now an inline function, moved here from editfns.c.
10298 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
10299 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
10300 All callers changed.
10301 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
10302 Assume the arg has valid form, since it always does.
10303 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
10304 unsigned integer system type.
10305 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
10306 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
10307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10308 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
10309 (duration_to_sec_usec): New decl.
10310 * lread.c (read_from_string_index, read_from_string_index_byte)
10311 (read_from_string_limit, readchar, unreadchar, openp)
10312 (read_internal_start, read1, oblookup):
10313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10314 (Fload, readevalloop, Feval_buffer, Feval_region):
10315 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10316 (openp): Check for out-of-range argument to 'access'.
10317 (read1): Use int, not EMACS_INT, where int is wide enough.
10318 Don't assume fixnum fits into int.
10319 Fix off-by-one error that can read outside a buffer.
10320 (read_filtered_event): Use duration_to_sec_usec
10321 to do proper overflow checking on durations.
10322 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
10323 in size calculation.
10324 (Fexecute_kbd_macro):
10325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10326 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
10327 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
10328 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
10329 (set_marker_both, set_marker_restricted_both, marker_position)
10330 (marker_byte_position, Fbuffer_has_markers_at):
10331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10332 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
10333 * menu.c (ensure_menu_items): Rename from grow_menu_items.
10334 It now merely ensures that the menu is large enough, without
10335 necessarily growing it, as this avoids some integer overflow issues.
10336 All callers changed.
10337 (keymap_panes, parse_single_submenu, Fx_popup_menu):
10338 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10339 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
10340 Use SAFE_ALLOCA_LISP, not alloca.
10341 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
10342 to EMACS_INT. Check that fixnums are in proper range for system types.
10343 * minibuf.c (minibuf_prompt_width, string_to_object)
10344 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
10345 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
10346 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10347 (get_minibuffer, read_minibuf_unwind):
10348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10349 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
10350 this simplifies overflow checking. All callers changed.
10351 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
10352 (Ftest_completion):
10353 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10354 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
10355 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
10356 Check that fixnums are in proper range for system types.
10357 (Fx_create_frame, Fx_show_tip):
10358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10359 * nsfont.m (ns_findfonts, nsfont_list_family):
10360 Don't assume fixnum fits in long.
10361 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
10362 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10363 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
10364 wide enough.
10365 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
10366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10367 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
10368 (PRINTDECLARE, PRINTPREPARE):
10369 (strout, print_string):
10370 (print, print_preprocess, print_check_string_charset_prop)
10371 (print_object):
10372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10373 (PRINTDECLARE):
10374 (temp_output_buffer_setup, Fprin1_to_string, print_object):
10375 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10376 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
10377 (printchar, strout): Use xpalloc to catch size calculation overflow.
10378 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
10379 (print_error_message): Use SAFE_ALLOCA, not alloca.
10380 (print_object): Use int, not EMACS_INT, where int is wide enough.
10381 (print_depth, new_backquote_output, print_number_index):
10382 Use ptrdiff_t, not int, where int might not be wide enough.
10383 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
10384 (Fset_process_window_size, Fformat_network_address)
10385 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
10386 (sigchld_handler):
10387 Check that fixnums are in proper range for system types.
10388 (Fsignal_process): Simplify by avoiding a goto.
10389 Check for process-ids out of pid_t range rather than relying on
10390 undefined behavior.
10391 (process_tick, update_tick): Use EMACS_INT, not int.
10392 (Fformat_network_address, read_process_output, send_process)
10393 (Fprocess_send_region, status_notify):
10394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10395 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
10396 (wait_reading_process_output, read_process_output, exec_sentinel):
10397 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10398 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
10399 (Faccept_process_output): Use duration_to_sec_usec to do proper
10400 overflow checking on durations.
10401 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
10402 Don't assume pid_t fits in int.
10403 * process.h (struct Lisp_Process): Members tick and update_tick
10404 are now of type EMACS_INT, not int.
10405 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
10406 configured --with-wide-int.
10407 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
10408 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
10409 * search.c (looking_at_1, string_match_1):
10410 (fast_string_match, fast_c_string_match_ignore_case)
10411 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
10412 (scan_newline, find_before_next_newline, search_command)
10413 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
10414 (set_search_regs, wordify):
10415 (Freplace_match):
10416 (Fmatch_data):
10417 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10418 (string_match_1, search_buffer, set_search_regs):
10419 (Fmatch_data):
10420 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10421 (wordify): Check for overflow in size calculation.
10422 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
10423 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
10424 Check that fixnums are in proper range for system types.
10425 * sound.c (struct sound_device)
10426 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
10427 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10428 (Fplay_sound_internal):
10429 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10430 * syntax.c (struct lisp_parse_state, find_start_modiff)
10431 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
10432 (Fparse_partial_sexp):
10433 Don't assume fixnums can fit in int.
10434 (struct lisp_parse_state, find_start_pos, find_start_value)
10435 (find_start_value_byte, find_start_begv)
10436 (update_syntax_table, char_quoted, dec_bytepos)
10437 (find_defun_start, prev_char_comend_first, back_comment):
10438 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
10439 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
10440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10441 (Finternal_describe_syntax_value): Check that match_lisp is a
10442 character, not an integer, since the code stuffs it into int.
10443 (scan_words, scan_sexps_forward):
10444 Check that fixnums are in proper range for system types.
10445 (Fforward_word):
10446 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10447 (scan_sexps_forward):
10448 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10449 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10450 * syntax.h: Adjust decls to match defn changes elsewhere.
10451 (struct gl_state_s):
10452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10453 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10454 MOST_POSITIVE_FIXNUM.
10455 * sysdep.c (wait_for_termination_1, wait_for_termination)
10456 (interruptible_wait_for_termination, mkdir):
10457 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10458 (emacs_read, emacs_write):
10459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10460 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10461 and double all fit in int.
10462 * term.c (set_tty_color_mode):
10463 Check that fixnums are in proper range for system types.
10464 * termhooks.h (struct input_event):
10465 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10466 * textprop.c (validate_interval_range, interval_of)
10467 (Fadd_text_properties, set_text_properties_1)
10468 (Fremove_text_properties, Fremove_list_of_text_properties)
10469 (Ftext_property_any, Ftext_property_not_all)
10470 (copy_text_properties, text_property_list, extend_property_ranges)
10471 (verify_interval_modification):
10472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10473 (Fnext_single_char_property_change)
10474 (Fprevious_single_char_property_change):
10475 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10476 (copy_text_properties):
10477 Check for integer overflow in index calculation.
10478 * undo.c (last_boundary_position, record_point, record_insert)
10479 (record_delete, record_marker_adjustment, record_change)
10480 (record_property_change):
10481 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10482 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10483 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10484 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10485 (Fx_hide_tip, Fx_file_dialog):
10486 * w32menu.c (set_frame_menubar):
10487 Use ptrdiff_t, not int, for consistency with rest of code.
10488 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10489 (select_window, Fdelete_other_windows_internal)
10490 (window_scroll_pixel_based, window_scroll_line_based)
10491 (Frecenter, Fset_window_configuration):
10492 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10493 (Fset_window_hscroll, run_window_configuration_change_hook)
10494 (set_window_buffer, temp_output_buffer_show, scroll_command)
10495 (Fscroll_other_window, Frecenter):
10496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10497 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10498 Don't assume fixnum fits in int.
10499 (Fset_window_scroll_bars):
10500 Check that fixnums are in proper range for system types.
10501 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10502 (string_pos, c_string_pos, number_of_chars, init_iterator)
10503 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10504 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10505 (compute_display_string_end, handle_face_prop)
10506 (face_before_or_after_it_pos, handle_invisible_prop)
10507 (handle_display_prop, handle_display_spec, handle_single_display_spec)
10508 (display_prop_intangible_p, string_buffer_position_lim)
10509 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10510 (get_overlay_strings_1, get_overlay_strings)
10511 (iterate_out_of_display_property, forward_to_next_line_start)
10512 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10513 (get_next_display_element, set_iterator_to_next)
10514 (get_visually_first_element, compute_stop_pos_backwards)
10515 (handle_stop_backwards, next_element_from_buffer)
10516 (move_it_in_display_line_to, move_it_in_display_line)
10517 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10518 (add_to_log, message_dolog, message_log_check_duplicate)
10519 (message2, message2_nolog, message3, message3_nolog
10520 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10521 (current_message_1, truncate_echo_area, truncate_message_1)
10522 (set_message, set_message_1, store_mode_line_noprop)
10523 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10524 (text_outside_line_unchanged_p, check_point_in_composition)
10525 (reconsider_clip_changes)
10526 (redisplay_internal, set_cursor_from_row, try_scrolling)
10527 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10528 (redisplay_window, find_last_unchanged_at_beg_row)
10529 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10530 (trailing_whitespace_p, find_row_edges, display_line)
10531 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10532 (display_mode_element, store_mode_line_string)
10533 (pint2str, pint2hrstr, decode_mode_spec)
10534 (display_count_lines, display_string, draw_glyphs)
10535 (x_produce_glyphs, x_insert_glyphs)
10536 (rows_from_pos_range, mouse_face_from_buffer_pos)
10537 (fast_find_string_pos, mouse_face_from_string_pos)
10538 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10539 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10540 (safe_call, init_from_display_pos, handle_fontified_prop)
10541 (handle_single_display_spec, load_overlay_strings)
10542 (with_echo_area_buffer, setup_echo_area_for_printing)
10543 (display_echo_area, echo_area_display)
10544 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10545 (update_tool_bar, hscroll_window_tree, redisplay_internal)
10546 (redisplay_window, dump_glyph_row, display_mode_line)
10547 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
10548 (handle_display_spec, display_prop_string_p):
10549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10550 (handle_single_display_spec, build_desired_tool_bar_string)
10551 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10552 (get_specified_cursor_type):
10553 Check that fixnums are in proper range for system types.
10554 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10555 (Flookup_image_map):
10556 Don't assume fixnums fit in int.
10557 (compare_overlay_entries):
10558 Avoid mishandling comparisons due to subtraction overflow.
10559 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10560 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10561 (handle_tool_bar_click):
10562 Use int, not unsigned, since we prefer signed and the signedness
10563 doesn't matter here.
10564 (get_next_display_element, next_element_from_display_vector):
10565 Use int, not EMACS_INT, when int is wide enough.
10566 (start_hourglass): Use duration_to_sec_usec to do proper
10567 overflow checking on durations.
10568 * xfaces.c (Fbitmap_spec_p):
10569 Check that fixnums are in proper range for system types.
10570 (compare_fonts_by_sort_order):
10571 Avoid mishandling comparisons due to subtraction overflow.
10572 (Fx_family_fonts, realize_basic_faces):
10573 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10574 (Fx_family_fonts):
10575 Don't assume fixnum fits in int.
10576 Use SAFE_ALLOCA_LISP, not alloca.
10577 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10578 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10579 (face_at_buffer_position, face_for_overlay_string)
10580 (face_at_string_position):
10581 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10582 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10583 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10584 (Fx_show_tip):
10585 Check that fixnums are in proper range for system types.
10586 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10587 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10588 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10589 (Fx_change_window_property): Don't assume fixnums fit in int.
10590 * xfont.c (xfont_chars_supported):
10591 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10592 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10593 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10594 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10595 * xml.c (parse_region):
10596 * xrdb.c (magic_file_p):
10597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10598 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10599 (x_get_local_selection, x_reply_selection_request)
10600 (x_handle_selection_request, wait_for_property_change):
10601 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10602 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10603 short is wide enough.
10604 (x_send_client_event): Don't assume fixnum fits in int.
10605 * xterm.c (x_x_to_emacs_modifiers):
10606 Don't assume EMACS_INT overflows nicely into int.
10607 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10608 may come from Lisp.
10609 (handle_one_xevent): NATNUMP can eval its arg twice.
10610 (x_connection_closed):
10611 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10612 * xterm.h: Adjust decls to match defn changes elsewhere.
10613 (struct scroll_bar): Use struct vectorlike_header
10614 rather than rolling our own approximation.
10615 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10616
10617 2012-05-25 Glenn Morris <rgm@gnu.org>
10618
10619 * lisp.mk (lisp): Update for more files being compiled now.
10620
10621 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10622
10623 * lread.c: Remove `read_pure' which makes no difference.
10624 (read_pure): Remove var.
10625 (unreadpure): Remove function.
10626 (readevalloop): Don't call read_list with -1 flag.
10627 (read1, read_vector): Don't test read_pure any more.
10628 (read_list): Simplify.
10629
10630 * fileio.c, character.h: Minor style tweaks.
10631
10632 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10633
10634 * window.h (clip_changed): Remove useless declaration.
10635
10636 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
10637
10638 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10639 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10640
10641 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10642
10643 Remove src/m/*.
10644 This directory predates autoconf and is no longer needed nowadays.
10645 Move its few remaining bits of functionality to where they're needed.
10646 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10647 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10648 * m/template.h: Remove.
10649 * Makefile.in (M_FILE): Remove. All uses removed.
10650 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10651 * lisp.h (USE_LSB_TAG):
10652 * mem-limits.h (EXCEEDS_LISP_PTR):
10653 Use VAL_MAX, not VALBITS, in #if.
10654 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10655 (EMACS_UINT): Define unconditionally now.
10656 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10657 (BITS_PER_EMACS_INT): New constants, replacing
10658 what used to be in config.h, but not useful in #if.
10659 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10660 define them any more.
10661 (VAL_MAX): New macro.
10662 (VALMASK): Use it.
10663 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10664 BITS_PER_EMACS_INT, in #if.
10665 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10666 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10667 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10668 * s/ms-w32.h (DATA_START):
10669 Move here from removed file m/intel386.h.
10670 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10671 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10672
10673 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10674
10675 Assume C89 or later.
10676 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10677 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10678 (xrealloc):
10679 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10680 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10681 * textprop.c, tparam.c (NULL): Remove.
10682 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10683 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10684 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10685 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10686 * xterm.c (input_signal_count): Assume volatile works.
10687
10688 2012-05-21 Ken Brown <kbrown@cornell.edu>
10689
10690 * xgselect.c (xg_select): Fix first argument in call to 'select'
10691 (bug#11508).
10692
10693 2012-05-20 Ken Brown <kbrown@cornell.edu>
10694
10695 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
10696 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
10697
10698 2012-05-19 Ken Brown <kbrown@cornell.edu>
10699
10700 * xfns.c (x_in_use): Remove `static' qualifier.
10701 * xterm.h (x_in_use): Declare.
10702 * xgselect.c: Include xterm.h.
10703 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10704 and `display_arg' (bug#9754).
10705
10706 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10707
10708 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10709
10710 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10711 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10712
10713 2012-05-18 Eli Zaretskii <eliz@gnu.org>
10714
10715 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10716
10717 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10718 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10719
10720 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10721 reference to image_cache->refcount.
10722 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10723
10724 2012-05-17 Juri Linkov <juri@jurta.org>
10725
10726 * search.c (Fword_search_regexp, Fword_search_backward)
10727 (Fword_search_forward, Fword_search_backward_lax)
10728 (Fword_search_forward_lax): Move functions to isearch.el
10729 (bug#10145, bug#11381).
10730
10731 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10732
10733 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10734
10735 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10736
10737 * lread.c (init_obarray): Declare Qt and Qnil as special.
10738
10739 2012-05-14 Glenn Morris <rgm@gnu.org>
10740
10741 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10742 Put "libexec" before "bin", for the sake of init_callproc_1.
10743
10744 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10745
10746 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10747
10748 * unexaix.c: Port to more-recent AIX compilers.
10749 (report_error, report_error_1, make_hdr, copy_sym)
10750 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10751 Make arguments const char *, not char *, to avoid violations of C
10752 standard and to fix some AIX warnings reported by Gilles Pion.
10753
10754 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10755
10756 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10757 already have overlays loaded.
10758 (handle_single_display_spec): Before returning without displaying
10759 fringe bitmap, synchronize the bidi iterator with the main display
10760 iterator, by calling iterate_out_of_display_property.
10761 (iterate_out_of_display_property): Detect buffer iteration by
10762 testing that it->string is a Lisp string.
10763 (get_next_display_element): When the current object is exhausted,
10764 and there's something on it->stack, call set_iterator_to_next to
10765 proceed with what's on the stack, instead of returning zero.
10766 (set_iterator_to_next): If called at the end of a Lisp string,
10767 proceed to consider_string_end without incrementing string
10768 position. Don't increment display vector index past the end of
10769 the display vector. (Bug#11417)
10770 (pos_visible_p): Don't report a position visible when move_it_to
10771 stopped at the last line of window, which happens to be scanned
10772 backwards by the bidi iteration. (Bug#11464)
10773
10774 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10775
10776 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10777 and right-margin display specs even if the spec is invalid or we
10778 are on a TTY, and thus unable to display on the fringes.
10779 That's because the text with the property will not be displayed anyway,
10780 so we need to signal to the caller that this is a "replacing"
10781 display spec. This fixes display when the spec is invalid or we
10782 are on a TTY.
10783
10784 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10785
10786 * unexaix.c (make_hdr): Fix typo in prototype.
10787 This bug broke the build on AIX. Problem reported by Gilles Pion.
10788
10789 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
10790
10791 * keyboard.c (kbd_buffer_get_event): Read special events also in
10792 batch mode. (Bug#11415)
10793
10794 2012-05-12 Glenn Morris <rgm@gnu.org>
10795
10796 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10797
10798 2012-05-12 Eli Zaretskii <eliz@gnu.org>
10799
10800 * lisp.mk (lisp): Add newcomment.elc.
10801
10802 2012-05-12 Glenn Morris <rgm@gnu.org>
10803
10804 * Makefile.in (MKDIR_P): New, set by configure.
10805 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10806
10807 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10808
10809 Remove unused function hourglass_started.
10810 * dispextern.h (hourglass_started):
10811 * w32fns.c (hourglass_started):
10812 * xdisp.c (hourglass_started): Remove.
10813
10814 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
10815
10816 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10817 Update dependencies.
10818
10819 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10820
10821 * xgselect.c (xg_select): Put maxfds+1 into a var.
10822 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10823
10824 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10825
10826 2012-05-10 Dave Abrahams <dave@boostpro.com>
10827
10828 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10829 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10830
10831 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10832
10833 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10834 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
10835 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10836 Initialize xd_registered_buses.
10837
10838 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10839
10840 Untag more efficiently if USE_LSB_TAG.
10841 This is based on a proposal by YAMAMOTO Mitsuharu in
10842 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10843 For an admittedly artificial (nth 8000 longlist) benchmark on
10844 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10845 Emacs's overall text size by 1%.
10846 * lisp.h (XUNTAG): New macro.
10847 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10848 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10849 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10850 * eval.c (Fautoload):
10851 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10852 * frame.h (XFRAME): Use XUNTAG.
10853
10854 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10855 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10856 Remove unportable assumptions about print widths of types like
10857 dbus_uint32_t.
10858 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10859 intptr_t when converting between pointer and integer, to avoid GCC
10860 warnings about wrong width.
10861
10862 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10863
10864 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10865 stack for each reader_thread, instead of defaulting to 8MB
10866 determined by the linker. This avoids failures in creating
10867 subprocesses on Windows 7, see the discussion in this thread:
10868 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10869
10870 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10871
10872 Fix up display of the *Minibuf-0* buffer in the mini window.
10873 * keyboard.c (read_char): Don't clear the echo area if there's no
10874 message to clear.
10875 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10876 contents of *Minibuf-0*) if there's no message displayed in its stead.
10877
10878 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10879
10880 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10881 batch mode.
10882
10883 2012-05-06 Chong Yidong <cyd@gnu.org>
10884
10885 * lisp.mk (lisp): Update.
10886
10887 2012-05-05 Jim Meyering <meyering@redhat.com>
10888
10889 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10890
10891 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10892
10893 * data.c (PUT_ERROR): New macro.
10894 (syms_of_data): Use it. Add new error type `user-error'.
10895 * undo.c (user_error): New function.
10896 (Fprimitive_undo): Use it.
10897 * print.c (print_error_message): Adjust print style for `user-error'.
10898 * keyboard.c (user_error): New function.
10899 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10900
10901 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10902
10903 Do not limit current-time-string to years 1000..9999.
10904 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10905 (Fcurrent_time_string): Support any year that is supported by the
10906 underlying localtime representation. Don't use asctime, as it
10907 has undefined behavior for years outside the range -999..9999.
10908
10909 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10910
10911 Fix race conditions involving setenv, gmtime, localtime, asctime.
10912 Without this fix, interrupts could mess up code that uses these
10913 nonreentrant functions, since setting TZ invalidates existing
10914 tm_zone or tzname values, and since most of these functions return
10915 pointers to static storage.
10916 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10917 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10918 Grow the critical sections to include not just invoking
10919 localtime/gmtime, but also accessing these functions' results
10920 including their tm_zone values if any, and any related TZ setting.
10921 (format_time_string): Last arg is now struct tm *, not struct tm **,
10922 so that the struct tm is saved in the critical section.
10923 All callers changed. Simplify allocation of initial buffer, partly
10924 motivated by the fact that memory allocation needs to be outside
10925 the critical section.
10926
10927 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10928
10929 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10930 with RESET_INTERVAL.
10931
10932 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10933 Remove duplicated buffer name initialization.
10934
10935 2012-05-02 Jim Meyering <jim@meyering.net>
10936
10937 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10938
10939 * xfns.c (x_window): Use xstrdup (Bug#11375).
10940
10941 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10942
10943 * xdisp.c (pos_visible_p): If already at a newline from the
10944 display string before the 'while' loop, don't walk back the glyphs
10945 from it3.glyph_row. Solves assertion violation when the display
10946 string begins with a newline (egg.el). (Bug#11367)
10947
10948 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10949
10950 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10951 Move to simple.el.
10952
10953 2012-05-01 Glenn Morris <rgm@gnu.org>
10954
10955 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10956 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10957 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10958 All were removed before 23.1.
10959
10960 * dispnew.c: Remove HAVE_LIBNCURSES test;
10961 it is always true on relevant platforms.
10962
10963 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10964 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10965
10966 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10967
10968 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10969
10970 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10971 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10972 Remove.
10973
10974 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10975
10976 Do not avoid creating empty evaporating overlays (Bug#9642).
10977 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10978 That is, do not delete an evaporating overlay if it becomes
10979 empty after its bounds are adjusted to fit within its buffer.
10980 This fix caused other problems, and I'm reverting it until we get
10981 to the bottom of them.
10982
10983 2012-04-27 Chong Yidong <cyd@gnu.org>
10984
10985 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10986
10987 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10988
10989 * xdisp.c (pos_visible_p): If the window start position is beyond
10990 ZV, start the display from buffer beginning. Prevents assertion
10991 violation in init_iterator when the minibuffer window is scrolled
10992 via the scroll bar.
10993
10994 * window.c (window_scroll_pixel_based): Likewise.
10995
10996 2012-04-27 Chong Yidong <cyd@gnu.org>
10997
10998 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10999
11000 2012-04-27 Glenn Morris <rgm@gnu.org>
11001
11002 * fileio.c (Fcopy_file, Fset_file_selinux_context):
11003 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
11004
11005 2012-04-27 Eli Zaretskii <eliz@gnu.org>
11006
11007 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
11008 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
11009
11010 2012-04-26 Eli Zaretskii <eliz@gnu.org>
11011
11012 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
11013 display element, check also the underlying string or buffer
11014 character. (Bug#11341)
11015
11016 * w32menu.c: Include w32heap.h.
11017 (add_menu_item): If the call to AppendMenuW (via
11018 unicode_append_menu) fails, disable Unicode menus only if we are
11019 running on Windows 9X/Me.
11020
11021 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
11022
11023 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
11024 (xgetint): Add missing shift for LSB tags.
11025
11026 2012-04-24 Martin Rudalics <rudalics@gmx.at>
11027
11028 * keyboard.c (read_char): Don't wipe echo area for select window
11029 events: These might get delayed via `mouse-autoselect-window'
11030 (Bug#11304).
11031
11032 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
11033
11034 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
11035 manipulation of :loaded-from data.
11036
11037 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
11038
11039 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
11040 now a cons (bug#11311).
11041
11042 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
11043
11044 Do not create empty overlays with the evaporate property (Bug#9642).
11045 * buffer.c (Fmove_overlay): Delete an evaporating overlay
11046 if it becomes empty after its bounds are adjusted to fit within
11047 its buffer. Without this fix, in a nonempty buffer (let ((o
11048 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
11049 yields an empty overlay that has the evaporate property, which is
11050 not supposed to happen.
11051
11052 Fix minor GTK3 problems found by static checking.
11053 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11054 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11055 (struct _EmacsFixedClass, emacs_fixed_get_type):
11056 Move decls here from emacsgtkfixed.h, since they needn't be public.
11057 (emacs_fixed_get_type): Now static.
11058 (emacs_fixed_class_init): Omit unused local.
11059 (emacs_fixed_child_type): Remove; unused.
11060 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11061 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11062 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
11063 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
11064 (EMACS_FIXED_GET_CLASS): Remove; unused.
11065 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
11066
11067 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
11068 Problem reported by Juanma Barranquero for Windows -Wunused-function.
11069
11070 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11071
11072 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
11073 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
11074 (__malloc_size_t, __malloc_ptrdiff_t):
11075 Remove. All uses removed, replaced by the definiens if needed,
11076 since we can assume C89 or better now.
11077 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
11078 (protect_malloc_state, align, get_contiguous_space)
11079 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
11080 (malloc_atfork_handler_child, malloc_enable_thread)
11081 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
11082 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
11083 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
11084 (special_realloc, _realloc_internal_nolock, _realloc_internal)
11085 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
11086 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
11087 Define using prototypes, not old style.
11088 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
11089 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
11090 (align): Don't assume that signed integer overflow wraps around.
11091 Omit unused local var.
11092 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
11093 (_free_internal_nolock, memalign, mallochook, reallochook):
11094 Omit no-longer-needed casts.
11095 (valloc): Use getpagesize, not __getpagesize.
11096 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
11097 (struct hdr): The 'magic' member is now size_t, not unsigned long.
11098
11099 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
11100
11101 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
11102
11103 Move functions from C to Lisp. Make non-blocking method calls
11104 the default. Implement further D-Bus standard interfaces.
11105
11106 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
11107 (QCdbus_request_name_allow_replacement)
11108 (QCdbus_request_name_replace_existing)
11109 (QCdbus_request_name_do_not_queue)
11110 (QCdbus_request_name_reply_primary_owner)
11111 (QCdbus_request_name_reply_in_queue)
11112 (QCdbus_request_name_reply_exists)
11113 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
11114 (QCdbus_registered_serial, QCdbus_registered_method)
11115 (QCdbus_registered_signal): New Lisp objects.
11116 (XD_DEBUG_MESSAGE): Use sizeof.
11117 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
11118 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
11119 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
11120 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
11121 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
11122 (xd_signature, xd_append_arg): Allow float for integer types.
11123 (xd_get_connection_references): New function.
11124 (xd_get_connection_address): Rename from xd_initialize.
11125 Return cached address.
11126 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
11127 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
11128 level.
11129 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
11130 Return number of refcounts.
11131 (Fdbus_get_unique_name): Make stronger parameter check.
11132 (Fdbus_message_internal): New defun.
11133 (Fdbus_call_method, Fdbus_call_method_asynchronously)
11134 (Fdbus_method_return_internal, Fdbus_method_error_internal)
11135 (Fdbus_send_signal, Fdbus_register_service)
11136 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
11137 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
11138 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
11139 (Vdbus_compiled_version, Vdbus_runtime_version)
11140 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
11141 (Vdbus_message_type_method_return, Vdbus_message_type_error)
11142 (Vdbus_message_type_signal): New defvars.
11143 (Vdbus_registered_buses, Vdbus_registered_objects_table):
11144 Adapt docstring.
11145
11146 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11147
11148 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
11149 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
11150 Do not assume ptrdiff_t is the same width as 'int'.
11151
11152 * alloc.c: Handle unusual debugging option combinations.
11153 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
11154 since the two debugging options are incompatible.
11155 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
11156 is defined.
11157 (mem_init, mem_insert, mem_insert_fixup):
11158 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
11159 (NEED_MEM_INSERT): Remove; no longer needed.
11160
11161 2012-04-22 Leo Liu <sdl.web@gmail.com>
11162
11163 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
11164
11165 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11166
11167 * sysdep.c [__FreeBSD__]: Minor cleanups.
11168 (list_system_processes, system_process_attributes) [__FreeBSD__]:
11169 Use Emacs indenting style more consistently. Avoid some casts.
11170 Use 'double' consistently rather than mixing 'float' and 'double'.
11171
11172 2012-04-21 Eduard Wiebe <usenet@pusto.de>
11173
11174 * sysdep.c (list_system_processes, system_process_attributes):
11175 Add implementation for FreeBSD (Bug#5243).
11176
11177 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
11178
11179 * lisp.mk (lisp): Update.
11180
11181 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
11182
11183 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
11184 It is never used otherwise.
11185
11186 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
11187
11188 * print.c (print_preprocess): Only check print_depth if print-circle
11189 is nil.
11190 (print_object): Check for cycles even when print-circle is nil and
11191 print-gensym is t, but only check print_depth if print-circle is nil.
11192
11193 2012-04-20 Chong Yidong <cyd@gnu.org>
11194
11195 * process.c (wait_reading_process_output): If EIO occurs on a pty,
11196 set the status to "failed" and ensure that sentinel is run.
11197
11198 2012-04-20 Glenn Morris <rgm@gnu.org>
11199
11200 * process.c (Fset_process_inherit_coding_system_flag)
11201 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
11202 (Fmake_network_process, Fmake_serial_process): Doc fix.
11203
11204 2012-04-20 Eli Zaretskii <eliz@gnu.org>
11205
11206 * xdisp.c (string_buffer_position_lim): Limit starting position to
11207 BEGV.
11208 (set_cursor_from_row): If called for a mode-line or header-line
11209 row, return zero immediately.
11210 (try_cursor_movement): If inside continuation line, don't back up
11211 farther than the first row after the header line, if any.
11212 Don't consider the header-line row as "partially visible", even if
11213 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
11214
11215 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
11216
11217 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
11218 (bug#11238).
11219
11220 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
11221 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
11222
11223 configure: new option --enable-gcc-warnings (Bug#11207)
11224 * Makefile.in (C_WARNINGS_SWITCH): Remove.
11225 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
11226 (ALL_CFLAGS): Use new macros rather than old.
11227 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
11228 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
11229 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
11230 -Wunused-result, -Wunused-variable. This should go away once
11231 the Emacs and Gnulib regex code is merged.
11232 (xmalloc, xrealloc): Now static.
11233
11234 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
11235
11236 * dired.c (Fsystem_groups): Remove unused local.
11237
11238 2012-04-17 Glenn Morris <rgm@gnu.org>
11239
11240 * dired.c (Fsystem_users): Doc fix.
11241
11242 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
11243
11244 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
11245 (syms_of_dired): Add them.
11246
11247 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
11248
11249 Fix minor alloc.c problems found by static checking.
11250 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
11251 New extern decls, to avoid calling undeclared functions.
11252 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
11253 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
11254 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
11255 (NEED_MEM_INSERT): New macro.
11256 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
11257 Remove one incorrect comment and fix another.
11258
11259 Fix minor ralloc.c problems found by static checking.
11260 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11261 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
11262 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
11263 (r_alloc_sbrk): Now static.
11264
11265 Improve ralloc.c interface checking.
11266 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11267 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
11268 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
11269 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
11270 [REL_ALLOC]: ... to here, to check interface.
11271 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
11272 Remove decls. This fixes an "It stinks!".
11273
11274 * alloc.c (which_symbols): Fix alignment issue / type clash.
11275
11276 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
11277
11278 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
11279 (struct Lisp_Misc_Any): Likewise.
11280 (struct Lisp_Free): Likewise.
11281 * alloc.c (union aligned_Lisp_Symbol): Define.
11282 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
11283 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
11284 (union aligned_Lisp_Misc): Define.
11285 (MARKER_BLOCK_SIZE, struct marker_block): Use union
11286 aligned_Lisp_Misc instead of union Lisp_Misc.
11287 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
11288
11289 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
11290
11291 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
11292 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
11293 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
11294 * s/netbsd.h, s/sol2-6.h:
11295 Remove definition of GC_MARK_STACK, since the default now works.
11296 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
11297 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
11298 no longer the default.
11299 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
11300
11301 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
11302
11303 * lread.c (lisp_file_lexically_bound_p):
11304 Fix hang at ";-*-\n" (bug#11238).
11305
11306 2012-04-14 Eli Zaretskii <eliz@gnu.org>
11307
11308 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
11309 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
11310
11311 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
11312
11313 * nsterm.m (constrainFrameRect): Always constrain when there is only
11314 one screen (Bug#10962).
11315
11316 2012-04-13 Ken Brown <kbrown@cornell.edu>
11317
11318 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
11319
11320 2012-04-13 Reuben Thomas <rrt@sc3d.org>
11321
11322 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
11323
11324 2012-04-11 Daniel Colascione <dancol@dancol.org>
11325
11326 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
11327 against is gone. It's better to use vfork now so that when Cygwin
11328 gains a new, working vfork, we use it automatically (bug#10398).
11329
11330 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11331
11332 * window.c (save_window_save): Obey window-point-insertion-type.
11333
11334 2012-04-11 Glenn Morris <rgm@gnu.org>
11335
11336 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
11337
11338 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11339
11340 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
11341
11342 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
11343
11344 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
11345 (force_quit_count): New var.
11346 (handle_interrupt): Use it.
11347
11348 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
11349
11350 * w32.c (w32_delayed_load): Record the full path of the library
11351 being loaded (bug#10424).
11352
11353 2012-04-09 Glenn Morris <rgm@gnu.org>
11354
11355 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
11356 not just in the obarray, before snarfing them. (Bug#11036)
11357
11358 * Makefile.in ($(leimdir)/leim-list.el):
11359 Pass EMACS rather than BUILT_EMACS.
11360
11361 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
11362
11363 * process.c (make_process):
11364 * process.h: Add integer `gnutls_handshakes_tried' member to
11365 process struct.
11366
11367 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
11368 Add convenience `GNUTLS_LOG2i' macro.
11369
11370 * gnutls.c (gnutls_log_function2i): Convenience log function.
11371 (emacs_gnutls_read): Use new log functions,
11372 `gnutls_handshakes_tried' process member, and
11373 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
11374 attempts per process (connection).
11375
11376 2012-04-09 Chong Yidong <cyd@gnu.org>
11377
11378 * eval.c (Fuser_variable_p, user_variable_p_eh)
11379 (lisp_indirect_variable): Functions deleted.
11380 (Fdefvar): Caller changed.
11381
11382 * callint.c (Finteractive, Fcall_interactively):
11383 * minibuf.c (Fread_variable): Callers changed.
11384
11385 2012-04-09 Eli Zaretskii <eliz@gnu.org>
11386
11387 * xdisp.c (set_cursor_from_row): If the display string appears in
11388 the buffer at position that is closer to point than the position
11389 after the display string, display the cursor on the first glyph of
11390 the display string. Fixes cursor display when a 'display' text
11391 property immediately follows invisible text. (Bug#11094)
11392
11393 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
11394
11395 composite.c: use 'double' consistently
11396 * composite.c (get_composition_id): Use 'double' consistently
11397 instead of converting 'float' to 'double' and vice versa; this is
11398 easier to understand and avoids a GCC warning.
11399
11400 2012-04-09 Glenn Morris <rgm@gnu.org>
11401
11402 * Makefile.in: Generate leim-list with bootstrap-emacs, in
11403 preparation for dumping it with emacs. (Bug#4789)
11404 (leimdir): New variable.
11405 ($(leimdir)/leim-list.el): New rule.
11406 (emacs$(EXEEXT)): Depend on leim-list.el.
11407
11408 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
11409 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
11410 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
11411
11412 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
11413
11414 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
11415 proper alignment.
11416
11417 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
11418
11419 * xml.c (init_libxml2_functions) [WINDOWSNT]:
11420 Remove unused local variable.
11421
11422 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11423
11424 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
11425 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
11426 (mark_memory): Mark Lisp_Objects only if pointers might hide in
11427 objects, as mark_maybe_pointer will catch them otherwise.
11428 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
11429 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
11430
11431 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11432
11433 Fix typo that broke non-Windows builds.
11434 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
11435
11436 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11437
11438 Support building on MS-Windows with libxml2.
11439
11440 * makefile.w32-in (OBJ2): Add xml.$(O).
11441 (GLOBAL_SOURCES): Add xml.c.
11442 ($(BLD)/xml.$(O)): New dependency list.
11443
11444 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11445 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11446 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11447 [!WINDOWSNT]: New macros.
11448 (init_libxml2_functions, libxml2_loaded_p): New functions.
11449 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11450 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11451 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11452 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11453 linked in).
11454 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11455 Call init_libxml2_functions before calling libxml2 functions.
11456 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11457
11458 * emacs.c: Don't include libxml/parser.h.
11459 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11460 xmlCleanupParser directly.
11461
11462 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11463
11464 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11465
11466 * indent.c (Fvertical_motion): If there is a display string at
11467 point, use it.vpos to compute how many lines to backtrack after
11468 move_it_to point. (Bug#11133)
11469
11470 2012-04-06 Eli Zaretskii <eliz@gnu.org>
11471
11472 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11473 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11474 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11475 macros related to unification of CJK characters. For the details,
11476 see the discussion following the message here:
11477 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
11478
11479 2012-04-04 Chong Yidong <cyd@gnu.org>
11480
11481 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11482
11483 2012-04-01 Eli Zaretskii <eliz@gnu.org>
11484
11485 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11486 instead of alloca. (Bug#11138)
11487
11488 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11489
11490 * w32menu.c (is_simple_dialog): Properly check lisp types.
11491 (Bug#11141)
11492
11493 2012-03-31 Eli Zaretskii <eliz@gnu.org>
11494
11495 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11496 position we get to after a call to move_it_to fails the
11497 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11498 only if we wind up in a string from display property. (Bug#11063)
11499
11500 * window.c (Fdelete_other_windows_internal): Invalidate the row
11501 and column information about mouse highlight, so that redisplay
11502 restores it after reallocating the glyph matrices. (Bug#7464)
11503
11504 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11505 string comes from a `display' text property, use the buffer
11506 position of that property as if we actually saw that position in
11507 the row's glyphs.
11508 (move_it_by_lines): Remove the assertion that
11509 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11510 violated when there's a before-string at the beginning of a line.
11511 (Bug#11063)
11512
11513 2012-03-30 Eli Zaretskii <eliz@gnu.org>
11514
11515 * xdisp.c (append_space_for_newline): If the default face was
11516 remapped, use the remapped face for the appended newline.
11517 (extend_face_to_end_of_line): Use the remapped default face for
11518 extending the face to the end of the line.
11519 (display_line): Call extend_face_to_end_of_line when the default
11520 face was remapped. (Bug#11068)
11521
11522 2012-03-29 Eli Zaretskii <eliz@gnu.org>
11523
11524 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11525
11526 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11527
11528 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11529
11530 2012-03-27 Glenn Morris <rgm@gnu.org>
11531
11532 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11533 Doc fixes.
11534
11535 2012-03-26 Kenichi Handa <handa@m17n.org>
11536
11537 * dispextern.h (struct glyph): Fix previous change. Change the
11538 bit length of glyphless.ch to 25 (Bug#11082).
11539
11540 2012-03-26 Chong Yidong <cyd@gnu.org>
11541
11542 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11543 (command_loop_1): Use it; inhibit selection update for
11544 handle-select-window too (Bug#8996).
11545
11546 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11547
11548 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
11549
11550 2012-03-25 Kenichi Handa <handa@m17n.org>
11551
11552 * dispextern.h (struct glyph): Change the bit length of
11553 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11554
11555 2012-03-24 Eli Zaretskii <eliz@gnu.org>
11556
11557 * s/ms-w32.h (tzname): Include time.h before redirecting to
11558 _tzname. Fixes the MSVC build. (Bug#9960)
11559
11560 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11561
11562 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11563 characters.
11564
11565 * xterm.c (XTread_socket): Only modify handling_signal if
11566 !SYNC_INPUT. (Bug#11080)
11567
11568 2012-03-23 Eli Zaretskii <eliz@gnu.org>
11569
11570 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11571 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11572 when fetching a multibyte character consumes more bytes than
11573 CHAR_BYTES returns, due to unification of CJK characters in
11574 string_char. (Bug#11073)
11575
11576 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11577
11578 * process.c (wait_reading_process_output): Handle pty disconnect
11579 by refraining from sending oneself a SIGCHLD (bug#10933).
11580
11581 2012-03-22 Chong Yidong <cyd@gnu.org>
11582
11583 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11584
11585 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
11586 Mark string as coming from a prefix property.
11587 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11588 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11589
11590 2012-03-21 Chong Yidong <cyd@gnu.org>
11591
11592 * xfaces.c (Vface_remapping_alist): Doc fix.
11593
11594 2012-03-20 Eli Zaretskii <eliz@gnu.org>
11595
11596 * w32proc.c (Fw32_set_console_codepage)
11597 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11598 Doc fixes.
11599
11600 2012-03-20 Chong Yidong <cyd@gnu.org>
11601
11602 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11603 to reflect default non-nil value of redisplay-dont-pause.
11604
11605 2012-03-19 Kenichi Handa <handa@m17n.org>
11606
11607 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11608 it fit in a valid range (Bug#11003).
11609
11610 2012-03-18 Eli Zaretskii <eliz@gnu.org>
11611
11612 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11613 that is not from display property, accept the row as a "cursor
11614 row" if one of the string's character has a non-nil `cursor'
11615 property. Fixes cursor positioning when there are newlines in
11616 overlay strings, e.g. in icomplete.el. (Bug#11035)
11617
11618 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11619
11620 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11621
11622 2012-03-12 Chong Yidong <cyd@gnu.org>
11623
11624 * eval.c (inhibit_lisp_code): Rename from
11625 inhibit_window_configuration_change_hook; move from window.c.
11626
11627 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11628 * window.c (run_window_configuration_change_hook)
11629 (syms_of_window): Callers changed.
11630
11631 2012-03-11 Chong Yidong <cyd@gnu.org>
11632
11633 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11634
11635 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11636
11637 2012-03-10 Chong Yidong <cyd@gnu.org>
11638
11639 * frame.c (other_visible_frames): Don't assume the selected frame
11640 is visible (Bug#10955).
11641
11642 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11643
11644 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11645
11646 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11647
11648 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11649 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11650 zero (Bug#10954).
11651
11652 2012-03-03 Glenn Morris <rgm@gnu.org>
11653
11654 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
11655
11656 2012-03-02 Eli Zaretskii <eliz@gnu.org>
11657
11658 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11659 position past the first glyph_row that ends at ZV. (Bug#10902)
11660 (redisplay_window, next_element_from_string): Fix typos in
11661 comments.
11662 (redisplay_window): Pass to move_it_vertically the margin in
11663 pixels, not in screen lines.
11664
11665 2012-03-02 Glenn Morris <rgm@gnu.org>
11666
11667 * buffer.c (buffer-list-update-hook): Doc fix.
11668
11669 2012-02-29 Eli Zaretskii <eliz@gnu.org>
11670
11671 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11672 push_it before setting up the iterator for the first overlay
11673 string, even if we have an empty string loaded.
11674 (next_overlay_string): If there's an empty string on the iterator
11675 stack, pop the stack. (Bug#10903)
11676
11677 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11678
11679 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11680 Suggested by Stefan Monnier in
11681 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11682 * alloc.c (widen_to_Lisp_Object): New static function.
11683 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11684 and widening them to Lisp_Objects. This would work even if
11685 USE_LSB_TAG is defined and wide integers are used, which might
11686 happen in a future version of Emacs.
11687
11688 2012-02-25 Chong Yidong <cyd@gnu.org>
11689
11690 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11691 Doc fix.
11692
11693 * xselect.c (Fx_selection_exists_p): Doc fix.
11694 (x_clipboard_manager_save_all): Print an informative message
11695 before saving to clipboard manager.
11696
11697 2012-02-24 Chong Yidong <cyd@gnu.org>
11698
11699 * keyboard.c (process_special_events): Handle all X selection
11700 requests in kbd_buffer, not just the next one (Bug#8869).
11701
11702 2012-02-23 Chong Yidong <cyd@gnu.org>
11703
11704 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11705 call when setting menu-bar-lines and tool-bar-lines parameters.
11706 (unwind_create_frame_1): New helper function.
11707
11708 * window.c (inhibit_window_configuration_change_hook): New var.
11709 (run_window_configuration_change_hook): Obey it.
11710 (syms_of_window): Initialize it.
11711
11712 2012-02-22 Chong Yidong <cyd@gnu.org>
11713
11714 * xterm.c (x_draw_image_relief): Add missing type check for
11715 Vtool_bar_button_margin (Bug#10743).
11716
11717 2012-02-21 Chong Yidong <cyd@gnu.org>
11718
11719 * fileio.c (Vfile_name_handler_alist): Doc fix.
11720
11721 * buffer.c (Fget_file_buffer): Protect against invalid file
11722 handler return value.
11723
11724 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11725
11726 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11727 when computing $valmask.
11728
11729 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11730 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11731 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11732 It's useless in that case, and it can cause problems on hosts
11733 that allocate halves of EMACS_INT values separately.
11734 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11735 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11736 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11737 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11738 it avoids undefined behavior on hosts where shifting right by more
11739 than the word width has undefined behavior.
11740
11741 2012-02-19 Chong Yidong <cyd@gnu.org>
11742
11743 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11744 (Funhandled_file_name_directory, Ffile_name_as_directory)
11745 (Fdirectory_file_name, Fexpand_file_name)
11746 (Fsubstitute_in_file_name): Protect against invalid file handler
11747 return values (Bug#10845).
11748
11749 2012-02-18 Eli Zaretskii <eliz@gnu.org>
11750
11751 * .gdbinit (pitx): Fix incorrect references to fields of the
11752 iterator stack.
11753
11754 2012-02-17 Chong Yidong <cyd@gnu.org>
11755
11756 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11757
11758 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11759
11760 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11761 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11762
11763 2012-02-15 Chong Yidong <cyd@gnu.org>
11764
11765 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11766 marked as special. Also, starting docstrings with * is obsolete.
11767
11768 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11769
11770 * gnutls.c (emacs_gnutls_write): Fix last change.
11771
11772 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11773
11774 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11775 send_process.
11776
11777 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11778
11779 * keymap.c (Fsingle_key_description): Handle char ranges.
11780
11781 2012-02-12 Chong Yidong <cyd@gnu.org>
11782
11783 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11784 as that creates a dangerous corner case.
11785
11786 * window.c (Fdelete_window_internal): Invalidate the mouse
11787 highlight (Bug#9904).
11788
11789 2012-02-12 Glenn Morris <rgm@gnu.org>
11790
11791 * xselect.c (Fx_own_selection_internal)
11792 (Fx_get_selection_internal, Fx_disown_selection_internal)
11793 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11794 * nsselect.m (Fx_own_selection_internal)
11795 (Fx_disown_selection_internal, Fx_selection_exists_p)
11796 (Fx_selection_owner_p, Fx_get_selection_internal):
11797 Sync docs and argument specs with the xselect.c versions.
11798
11799 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11800
11801 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11802
11803 2012-02-11 Eli Zaretskii <eliz@gnu.org>
11804
11805 * w32select.c (Fx_selection_exists_p): Sync doc string and
11806 argument list with xselect.c. (Bug#10783)
11807
11808 * w16select.c (Fx_selection_exists_p): Sync doc string and
11809 argument list with xselect.c. (Bug#10783)
11810
11811 2012-02-10 Glenn Morris <rgm@gnu.org>
11812
11813 * fns.c (Fsecure_hash): Doc fix.
11814
11815 2012-02-09 Kenichi Handa <handa@m17n.org>
11816
11817 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11818
11819 2012-02-07 Chong Yidong <cyd@gnu.org>
11820
11821 * buffer.c (Fbuffer_local_variables)
11822 (buffer_lisp_local_variables): Handle unbound vars correctly;
11823 don't let Qunbound leak into Lisp.
11824
11825 2012-02-07 Glenn Morris <rgm@gnu.org>
11826
11827 * image.c (Fimagemagick_types): Doc fix.
11828
11829 * image.c (imagemagick-render-type): Change it from a lisp object
11830 to an integer. Move the doc here from the lisp manual.
11831 Treat all values not equal to 0 the same.
11832
11833 2012-02-06 Chong Yidong <cyd@gnu.org>
11834
11835 * doc.c (store_function_docstring): Avoid applying docstring of
11836 alias to base function (Bug#2603).
11837
11838 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11839
11840 * .gdbinit (pp1, pv1): Remove redundant defines.
11841 (pr): Use pp.
11842
11843 2012-02-04 Chong Yidong <cyd@gnu.org>
11844
11845 * nsterm.m: Declare a global (Bug#10694).
11846
11847 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11848
11849 * w32.c (get_emacs_configuration_options):
11850 Include --enable-checking, if specified, in the return value.
11851
11852 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11853
11854 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11855 after rounding frame sizes. (Bug#9723)
11856
11857 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11858
11859 * keyboard.c (adjust_point_for_property): Don't position point
11860 before BEGV. (Bug#10696)
11861
11862 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11863
11864 Handle overflow when computing char display width (Bug#9496).
11865 * character.c (char_width): Return EMACS_INT, not int.
11866 (char_width, c_string_width): Check for overflow when
11867 computing the width; this is possible now that individual
11868 characters can have unbounded width. Problem introduced
11869 by merge from Emacs 23 on 2012-01-19.
11870
11871 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11872
11873 * dbusbind.c (Fdbus_register_method): Mention the return value
11874 :ignore in the docstring.
11875
11876 2012-02-02 Glenn Morris <rgm@gnu.org>
11877
11878 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11879
11880 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11881 Unconditionally set to t. (Bug#10673)
11882 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11883 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11884 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11885
11886 2012-02-02 Kenichi Handa <handa@m17n.org>
11887
11888 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11889 0, do not call append_composite_glyph.
11890
11891 2012-02-02 Kenichi Handa <handa@m17n.org>
11892
11893 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11894 NULL (Bug#6988).
11895 (x_produce_glyphs): If the component of a composition is a null
11896 string, set it->pixel_width to 1 to avoid zero-width glyph.
11897
11898 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11899
11900 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11901 first 2 arguments are identical. This makes inserting large
11902 output from a subprocess an order of magnitude faster on
11903 MS-Windows, where all sbrk'ed memory is always contiguous.
11904
11905 2012-01-31 Glenn Morris <rgm@gnu.org>
11906
11907 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11908 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11909 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11910
11911 2012-01-29 Glenn Morris <rgm@gnu.org>
11912
11913 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11914
11915 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11916
11917 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11918
11919 2012-01-28 Chong Yidong <cyd@gnu.org>
11920
11921 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11922
11923 2012-01-26 Chong Yidong <cyd@gnu.org>
11924
11925 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11926
11927 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11928 repeat counts (Bug#10507).
11929
11930 2012-01-26 Glenn Morris <rgm@gnu.org>
11931
11932 * lread.c (syms_of_lread): Doc fix.
11933
11934 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11935
11936 * coding.c (encode_designation_at_bol): Change return value to
11937 EMACS_INT.
11938
11939 2012-01-25 Chong Yidong <cyd@gnu.org>
11940
11941 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11942
11943 2012-01-21 Chong Yidong <cyd@gnu.org>
11944
11945 * floatfns.c (Fcopysign): Make the second argument non-optional,
11946 since nil is not allowed anyway.
11947
11948 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11949
11950 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11951 (send_process): Likewise.
11952
11953 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11954
11955 * window.c (save_window_save, Fcurrent_window_configuration)
11956 (Vwindow_persistent_parameters): Do not use Qstate.
11957 Rewrite doc-strings.
11958
11959 2012-01-19 Kenichi Handa <handa@m17n.org>
11960
11961 * character.c (char_width): New function.
11962 (Fchar_width, c_string_width, lisp_string_width):
11963 Use char_width (Bug#9496).
11964
11965 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11966
11967 * window.c (Vwindow_persistent_parameters): New variable.
11968 (Fset_window_configuration, save_window_save): Handle persistent
11969 window parameters.
11970
11971 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11972
11973 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11974 thrashing the stack of the thread. (Bug#9087)
11975
11976 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11977
11978 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11979
11980 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11981
11982 * xdisp.c (rows_from_pos_range): Handle the case where the
11983 highlight ends on a newline. (Bug#10464)
11984 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11985 he end column for display of highlight that ends on a newline
11986 before a R2L line.
11987
11988 2012-01-11 Glenn Morris <rgm@gnu.org>
11989
11990 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11991 from load-path also when installation-directory is nil. (Bug#10208)
11992
11993 2012-01-10 Glenn Morris <rgm@gnu.org>
11994
11995 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11996
11997 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11998 Update template values to be closer to their typical values these days.
11999
12000 2012-01-09 Eli Zaretskii <eliz@gnu.org>
12001
12002 * xdisp.c (rows_from_pos_range): Accept additional argument
12003 DISP_STRING, and accept any glyph in a row whose object is that
12004 string as eligible for mouse highlight. Fixes mouse highlight of
12005 display strings from overlays. (Bug#10464)
12006
12007 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
12008
12009 emacs: fix an auto-save permissions race condition (Bug#10400)
12010 * fileio.c (auto_saving_dir_umask): New static var.
12011 (Fmake_directory_internal): Use it.
12012 (do_auto_save_make_dir): Set it, instead of invoking chmod after
12013 creating the directory. The old code temporarily assigns
12014 too-generous permissions to the directory.
12015 (do_auto_save_eh): Clear it.
12016 (Fdo_auto_save): Catch all errors, not just file errors, so
12017 that the var is always cleared.
12018
12019 2012-01-07 Eli Zaretskii <eliz@gnu.org>
12020
12021 * search.c (scan_buffer): Pass character positions to
12022 know_region_cache, not byte positions. (Bug#6540)
12023
12024 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
12025
12026 * w32.c (sys_rename): Report EXDEV when rename of a directory
12027 fails because the target is on another logical disk. (Bug#10284)
12028
12029 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
12030
12031 * xterm.c (x_embed_request_focus): New function.
12032
12033 * xterm.h: Add prototype.
12034
12035 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
12036
12037 2012-01-05 Glenn Morris <rgm@gnu.org>
12038
12039 * emacs.c (emacs_copyright): Update short copyright year to 2012.
12040
12041 2012-01-01 Eli Zaretskii <eliz@gnu.org>
12042
12043 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
12044 Load gnutls_transport_set_lowat only if GnuTLS version is below
12045 2.11.1.
12046 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
12047 GnuTLS versions below 2.11.1.
12048
12049 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
12050
12051 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
12052 to the doc string advising against its use for altering the way
12053 windows are scrolled.
12054
12055 2011-12-28 Kenichi Handa <handa@m17n.org>
12056
12057 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
12058 coding-system ASCII compatible only when it does not produce BOM
12059 on encoding (Bug#10383).
12060
12061 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
12062
12063 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
12064 can scroll.
12065 (create_and_show_popup_menu): Always use menu_position_func for
12066 Gtk3 (Bug#10361).
12067
12068 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
12069
12070 * callint.c (Fcall_interactively): Don't truncate prompt string.
12071
12072 2011-12-23 Eli Zaretskii <eliz@gnu.org>
12073
12074 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
12075 property that ends at ZV, so that the bidi iteration could be
12076 resumed from there (after widening). (Bug#10360)
12077
12078 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
12079
12080 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
12081
12082 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
12083
12084 * nsterm.m (x_free_frame_resources):
12085 Release f->output_data.ns->miniimage.
12086 (ns_index_color): Fix indentation. Do not retain
12087 color_table->colors[i].
12088
12089 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
12090 before returning.
12091
12092 * nsfns.m (x_set_background_color): Assign return value from
12093 ns_index_color to face-background instead of NSColor*.
12094 (ns_implicitly_set_icon_type): Fix indentation.
12095 Change assignment in for loop to comparison.
12096
12097 * emacs.c (ns_pool): New variable.
12098 (main): Assign ns_pool.
12099 (Fkill_emacs): Call ns_release_autorelease_pool.
12100
12101 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
12102 autorelease fdesc, release fdAttrs and tdict.
12103 (ns_get_covering_families): Release charset.
12104 (ns_findfonts): Release NSFontDescriptor created with new.
12105 (ns_uni_to_glyphs): Fix indentation.
12106 (setString): Release attrStr before assigning new value.
12107
12108 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12109
12110 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
12111 and NS_IMPL_COCOA.
12112 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
12113 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
12114
12115 2011-12-18 David Reitter <reitter@cmu.edu>
12116
12117 * nsterm.m (ns_term_init): Subscribe for notifications
12118 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
12119 to method trackingNotification in EmacsMenu.
12120
12121 * nsmenu.m (trackingMenu): New variable.
12122 (trackingNotification): New method (from Aquamacs).
12123 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
12124 from Aquamacs (Bug#7030).
12125
12126 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12127
12128 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
12129 (symbol_to_nsstring): Fix indentation.
12130 (ns_symbol_to_pb): New function.
12131 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
12132 (Fns_rotate_cut_buffers_internal): Remove.
12133 (Fns_store_selection_internal): Rename from
12134 Fns_store_cut_buffer_internal.
12135 (ns_get_foreign_selection, Fx_own_selection_internal)
12136 (Fx_disown_selection_internal, Fx_selection_exists_p)
12137 (Fns_get_selection_internal, Fns_store_selection_internal):
12138 Use ns_symbol_to_pb and check if return value is nil.
12139 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
12140 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
12141 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
12142 renamed to Sns_store_selection_internal.
12143 (ns_handle_selection_request): Move code to Fx_own_selection_internal
12144 and remove this function.
12145 (ns_handle_selection_clear): Remove, never used.
12146 (Fx_own_selection_internal): Move code from ns_handle_selection_request
12147 here.
12148
12149 2011-12-17 Ken Brown <kbrown@cornell.edu>
12150
12151 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
12152 GID is unknown (Bug#10257).
12153
12154 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
12155
12156 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
12157 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
12158 which caused a build failure on GNU/Linux IA-64. This problem was
12159 introduced by my 2011-10-07 patch.
12160
12161 2011-12-15 Juri Linkov <juri@jurta.org>
12162
12163 * image.c (imagemagick_error): New function. (Bug#10112)
12164 (imagemagick_load_image): Comment out `MagickSetResolution' call.
12165 Use `imagemagick_error' where ImageMagick functions return
12166 `MagickFalse'.
12167 (Fimagemagick_types): Add `Fnreverse' to return the list in the
12168 proper order.
12169
12170 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12171
12172 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
12173 fill background (Bug#8992).
12174
12175 2011-12-13 Martin Rudalics <rudalics@gmx.at>
12176
12177 * window.c (Vwindow_combination_resize)
12178 (Vwindow_combination_limit): Use t instead of non-nil in
12179 doc-strings.
12180 (Vrecenter_redisplay): Add first sentence of doc-string on
12181 separate line.
12182 (Frecenter): Fix doc-string typo.
12183
12184 2011-12-11 Kenichi Handa <handa@m17n.org>
12185
12186 * coding.c (Funencodable_char_position): Pay attention to the
12187 buffer text relocation (Bug#9389).
12188
12189 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12190
12191 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
12192 gtk_init (Bug#10100).
12193
12194 2011-12-10 Eli Zaretskii <eliz@gnu.org>
12195
12196 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
12197 IT->string is nil. (Bug#10263)
12198
12199 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12200
12201 * nsterm.h (x_free_frame_resources): Declare.
12202
12203 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
12204 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
12205
12206 * nsterm.h (ns_get_defaults_value): Declare.
12207
12208 * nsterm.m (ns_default): Call ns_get_defaults_value.
12209
12210 2011-12-09 Eli Zaretskii <eliz@gnu.org>
12211
12212 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
12213 (Bug#10170)
12214
12215 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12216
12217 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
12218 that where the value of an _OBJC_* symbol points to is in the .bss
12219 section (Bug#10240).
12220
12221 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12222
12223 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
12224 after the loop to call ccl_driver at least once (Bug#8619).
12225
12226 2011-12-08 Kenichi Handa <handa@m17n.org>
12227
12228 * ftfont.c (get_adstyle_property): Fix previous change
12229 (Bug#10233).
12230
12231 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
12232
12233 * w32.c (init_environment): If no_site_lisp, remove site-lisp
12234 dirs from the default value of EMACSLOADPATH (bug#10208).
12235
12236 2011-12-07 Glenn Morris <rgm@gnu.org>
12237
12238 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
12239 installation and source directories as well. (Bug#10208)
12240
12241 2011-12-06 Chong Yidong <cyd@gnu.org>
12242
12243 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
12244
12245 2011-12-06 Glenn Morris <rgm@gnu.org>
12246
12247 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
12248 as an error, not just -1. (Bug#10217)
12249
12250 2011-12-05 Chong Yidong <cyd@gnu.org>
12251
12252 * keyboard.c (process_special_events): New function.
12253 (swallow_events, Finput_pending_p): Use it (Bug#10195).
12254
12255 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
12256
12257 * coding.c (encode_designation_at_bol): Don't use uninitialized
12258 local variable (Bug#9318).
12259
12260 2011-12-05 Kenichi Handa <handa@m17n.org>
12261
12262 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
12263 return Qnil (Bug#8046, Bug#10193).
12264
12265 2011-12-05 Kenichi Handa <handa@m17n.org>
12266
12267 * coding.c (encode_designation_at_bol): New args charbuf_end and
12268 dst. Return the number of produced bytes. Callers changed.
12269 (coding_set_source): Return how many bytes coding->source was
12270 relocated.
12271 (coding_set_destination): Return how many bytes
12272 coding->destination was relocated.
12273 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
12274 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
12275
12276 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12277
12278 * coding.c (CODING_CHAR_CHARSET_P): New macro.
12279 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
12280 macro (Bug#9318).
12281
12282 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
12283
12284 The following changes are to fix Bug#9318.
12285
12286 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
12287 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
12288 (encode_coding_iso_2022, encode_coding_sjis)
12289 (encode_coding_big5, encode_coding_charset): Use the above macros.
12290
12291 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
12292
12293 * lisp.h (process_quit_flag): Fix external declaration.
12294
12295 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
12296
12297 Don't macro-inline non-performance-critical code.
12298 * eval.c (process_quit_flag): New function.
12299 * lisp.h (QUIT): Use it.
12300
12301 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
12302
12303 * nsfns.m (get_geometry_from_preferences): New function.
12304 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
12305
12306 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
12307
12308 * emacs.c (Qkill_emacs): Define.
12309 (syms_of_emacs): Initialize it.
12310 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
12311 Qquit_flag to `kill-emacs' instead.
12312 (quit_throw_to_read_char): Add parameter `from_signal'.
12313 All callers changed. Call Fkill_emacs if requested and safe.
12314 * lisp.h (QUIT): Call Fkill_emacs if requested.
12315
12316 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
12317
12318 * widget.c (update_wm_hints): Return if wmshell is null.
12319 (widget_update_wm_size_hints): New function.
12320
12321 * widget.h (widget_update_wm_size_hints): Declare.
12322
12323 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
12324 widget_update_wm_size_hints (Bug#10104).
12325
12326 2011-12-03 Eli Zaretskii <eliz@gnu.org>
12327
12328 * xdisp.c (handle_invisible_prop): If the invisible text ends just
12329 before a newline, prepare the bidi iterator for consuming the
12330 newline, and keep the current paragraph direction. (Bug#10183)
12331 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
12332
12333 2011-12-02 Juri Linkov <juri@jurta.org>
12334
12335 * search.c (Fword_search_regexp): New Lisp function created from
12336 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
12337 (Fword_search_backward, Fword_search_forward)
12338 (Fword_search_backward_lax, Fword_search_forward_lax):
12339 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
12340 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
12341
12342 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
12343
12344 * fileio.c (Finsert_file_contents): Move after-change-function call
12345 to before the "handled:" label, since all "goto handled" appear in
12346 cases where the *-change-functions have already been properly called
12347 (bug#10117).
12348
12349 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
12350
12351 * keyboard.c (interrupt_signal): Don't call kill-emacs when
12352 waiting for input. (Bug#10169)
12353
12354 2011-11-30 Eli Zaretskii <eliz@gnu.org>
12355
12356 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
12357 verifies glyph row's hash code--we have just reallocated the
12358 glyphs, so their contents can be complete garbage. (Bug#10164)
12359
12360 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
12361
12362 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
12363
12364 2011-11-30 Eli Zaretskii <eliz@gnu.org>
12365
12366 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
12367 attributes are tested _before_ calling verify_row_hash, to protect
12368 against GCC re-ordering of the tests. (Bug#10164)
12369
12370 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
12371
12372 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
12373
12374 * xterm.c (handle_one_xevent): Only set async_visible and friends
12375 if net_wm_state_hidden_seen is non-zero (Bug#10002)
12376 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
12377 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
12378
12379 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
12380
12381 Remove GCPRO-related macros that exist only to avoid shadowing locals.
12382 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
12383 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
12384 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12385 All uses changed to use GCPRO1 etc.
12386 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
12387 Revert to old implementation (i.e., before 2011-03-11).
12388
12389 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12390
12391 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
12392 of scroll runs so as to avoid assigning disabled bogus rows and
12393 unnecessary graphics copy operations.
12394
12395 2011-11-27 Eli Zaretskii <eliz@gnu.org>
12396
12397 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
12398 (snprintf) [_MSC_VER]: Redirect to _snprintf.
12399 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
12400 (malloc, free, realloc, calloc): Redirect to e_* only when
12401 compiling Emacs.
12402
12403 * lisp.h (GCTYPEBITS): Move before first use.
12404 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
12405 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
12406 this macro definition.
12407
12408 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
12409 _MSC_VER.
12410
12411 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
12412
12413 * gtkutil.c (xg_create_frame_widgets):
12414 Call gtk_window_set_has_resize_grip (FALSE) if that function is
12415 present with Gtk+ 2.0.
12416
12417 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12418
12419 * fileio.c (Finsert_file_contents): Undo previous change; see
12420 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12421
12422 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12423
12424 Rename locals to avoid shadowing.
12425 * fileio.c (Finsert_file_contents):
12426 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
12427 * process.c (wait_reading_process_output):
12428 Rename inner 'proc' to 'p' to avoid shadowing.
12429 Indent for consistency with usual Emacs style.
12430
12431 2011-11-25 Eli Zaretskii <eliz@gnu.org>
12432
12433 * xdisp.c (redisplay_window): If cursor row is not fully visible
12434 after recentering, and scroll-conservatively is set to a large
12435 number, scroll window by a few more lines to make the cursor fully
12436 visible and out of scroll-margin. (Bug#10105)
12437 (start_display): Don't move to the next line if the display should
12438 start at a newline that is part of a display vector or an overlay
12439 string. (Bug#10119)
12440
12441 2011-11-24 Juri Linkov <juri@jurta.org>
12442
12443 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12444 after the `MagickPingImage' call. (Bug#10112)
12445
12446 2011-11-23 Chong Yidong <cyd@gnu.org>
12447
12448 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12449
12450 2011-11-23 Martin Rudalics <rudalics@gmx.at>
12451
12452 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12453 making another buffer current. (Bug#10114)
12454
12455 2011-11-23 Glenn Morris <rgm@gnu.org>
12456
12457 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12458
12459 2011-11-23 Chong Yidong <cyd@gnu.org>
12460
12461 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12462 using it (Bug#5984).
12463
12464 2011-11-22 Eli Zaretskii <eliz@gnu.org>
12465
12466 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12467 and header-lines, as they don't have one computed for them.
12468 (Bug#10098)
12469
12470 * .gdbinit (prow): Make displayed values more self-explaining.
12471 Add row's hash code.
12472
12473 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12474
12475 * process.c (wait_reading_process_output): Fix asynchrounous
12476 GnuTLS socket handling on some versions of the GnuTLS library.
12477 (wait_reading_process_output): Add comment and URL.
12478
12479 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12480
12481 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12482
12483 2011-11-21 Chong Yidong <cyd@gnu.org>
12484
12485 * window.c (Fnext_window, Fprevious_window): Doc fix.
12486
12487 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12488
12489 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12490
12491 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12492
12493 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12494
12495 2011-11-20 Martin Rudalics <rudalics@gmx.at>
12496
12497 * window.c (Fset_window_combination_limit): Rename argument
12498 STATUS to LIMIT.
12499 (Vwindow_combination_limit): Remove "status" from doc-string.
12500
12501 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12502
12503 * m/ibms390.h: Remove.
12504 * m/ibms390x.h: Don't include "ibms390.h".
12505
12506 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12507
12508 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12509 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12510
12511 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12512
12513 * casetab.c (Fset_case_table):
12514 * charset.c (Fcharset_after): Fix typos.
12515
12516 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
12517
12518 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12519 Otherwise, valgrind does not work on some platforms.
12520 Problem reported by Andreas Schwab in
12521 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12522 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12523 is set, removing the need for VIRT_ADDRESS_VARIES.
12524 (PURE_P): Use a more-efficient implementation that needs just one
12525 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12526 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12527 to 4 (xorl, subq, cmpq, setbe).
12528 * alloc.c (pure): Always extern now, since that's the
12529 VIRT_ADDR_VARIES behavior.
12530 (PURE_POINTER_P): Use a single comparison, not two, for
12531 consistency with the new puresize.h.
12532 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12533 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12534 Remove VIRT_ADDR_VARIES no longer needed.
12535
12536 2011-11-19 Eli Zaretskii <eliz@gnu.org>
12537
12538 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12539 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12540 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12541 behave as if the cursor position were at the window margin.
12542
12543 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12544 and the cursor position is out of bounds, behave as if the cursor
12545 position were at the window margin. (Bug#10075)
12546
12547 2011-11-18 Chong Yidong <cyd@gnu.org>
12548
12549 * window.c (Fwindow_combination_limit): Make first argument
12550 non-optional, since it is meaningless for live windows like the
12551 selected window.
12552
12553 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12554
12555 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12556
12557 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12558
12559 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12560 (graft_intervals_into_buffer): Simplify.
12561
12562 2011-11-18 Eli Zaretskii <eliz@gnu.org>
12563
12564 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12565 hash values of the two rows.
12566 (copy_row_except_pointers): Preserve the used[] arrays and the
12567 hash values of the two rows. (Bug#10035)
12568 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
12569
12570 * xdisp.c (row_hash): New function, body extracted from
12571 compute_line_metrics.
12572 (compute_line_metrics): Call row_hash, instead of computing the
12573 hash code inline.
12574
12575 * dispnew.c (verify_row_hash): Call row_hash for computing the
12576 hash code of a row, instead of duplicating code from xdisp.c.
12577
12578 * dispextern.h (row_hash): Add prototype.
12579
12580 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12581
12582 * frame.c (delete_frame): Don't delete the terminal when the last
12583 X frame is closed if emacs is built with GTK toolkit.
12584
12585 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
12586
12587 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12588
12589 2011-11-17 Martin Rudalics <rudalics@gmx.at>
12590
12591 * window.c (Vwindow_splits): Rename to
12592 Vwindow_combination_resize. Suggested by Juri Linkov.
12593 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12594 of Vwindow_splits.
12595
12596 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
12597
12598 * nsfns.m (Fns_font_name):
12599 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
12600
12601 2011-11-16 Martin Rudalics <rudalics@gmx.at>
12602
12603 * window.h (window): Rename slot "nest" to "combination_limit".
12604 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12605 (Fset_window_nest): Rename to Fset_window_combination_limit.
12606 (Vwindow_nest): Rename to Vwindow_combination_limit.
12607 (recombine_windows, make_parent_window, make_window)
12608 (Fsplit_window_internal, saved_window)
12609 (Fset_window_configuration, save_window_save): Rename all
12610 occurrences of window_nest to window_combination_limit.
12611
12612 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
12613
12614 * image.c (imagemagick_load_image): Fix typo.
12615
12616 2011-11-14 Eli Zaretskii <eliz@gnu.org>
12617
12618 * xdisp.c (display_line): Move the call to
12619 highlight_trailing_whitespace before the call to
12620 compute_line_metrics, since the latter needs to see the final
12621 faces of all the glyphs to compute ROW's hash value.
12622 Fixes assertion violations in row_equal_p. (Bug#10035)
12623
12624 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
12625
12626 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12627 just return (bug#10044).
12628
12629 2011-11-12 Eli Zaretskii <eliz@gnu.org>
12630
12631 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12632 with user-defined heap size. Bump the default size of the temacs
12633 heap to 27MB, to avoid memory warning when running temacs.
12634 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12635
12636 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12637 current_matrix and desired_matrix. (Bug#9990)
12638 (verify_row_hash) [XASSERTS]: New function.
12639 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12640 that the hash value of glyph rows is correct.
12641
12642 2011-11-12 Martin Rudalics <rudalics@gmx.at>
12643
12644 * window.h (window): Remove splits slot.
12645 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12646 (Fdelete_other_windows_internal, make_parent_window)
12647 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12648 (Fset_window_configuration, save_window_save): Don't deal with
12649 split status of windows.
12650 (saved_window): Remove splits slot.
12651 (Vwindow_splits): Rewrite doc-string.
12652
12653 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12654
12655 * xfns.c (unwind_create_frame):
12656 * nsfns.m (unwind_create_frame):
12657 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12658 Vframe_list (Bug#9999).
12659
12660 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12661
12662 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
12663
12664 2011-11-11 Kenichi Handa <handa@m17n.org>
12665
12666 * callproc.c (Fcall_process): Set the member dst_multibyte of
12667 process_coding.
12668
12669 2011-11-11 Johan Bockgård <bojohan@gnu.org>
12670
12671 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12672 avoid a crash (bug#9496).
12673
12674 2011-11-09 Chong Yidong <cyd@gnu.org>
12675
12676 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12677 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12678
12679 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12680
12681 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12682
12683 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12684
12685 Avoid some portability problems by eschewing 'extern inline' functions.
12686 The trivial performance wins aren't worth the portability hassles; see
12687 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12688 et seq.
12689 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12690 (window_box_width, window_box_left, window_box_left_offset)
12691 (window_box_right, window_box_right_offset): Undo previous change,
12692 by removing the "extern"s.
12693 * intervals.c (adjust_intervals_for_insertion)
12694 (adjust_intervals_for_deletion): Undo previous change,
12695 making these static again.
12696 (offset_intervals, temp_set_point_both, temp_set_point)
12697 (copy_intervals_to_string): No longer inline.
12698 * xdisp.c (window_text_bottom_y, window_box_width)
12699 (window_box_height, window_box_left_offset)
12700 (window_box_right_offset, window_box_left, window_box_right)
12701 (window_box): No longer inline.
12702
12703 2011-11-08 Chong Yidong <cyd@gnu.org>
12704
12705 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12706 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12707 Signal an error if not a live window.
12708 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12709 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12710
12711 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
12712
12713 * lisp.h (syms_of_abbrev): Remove declaration.
12714 Reported by CHENG Gao <chenggao@royau.me>.
12715
12716 2011-11-07 Eli Zaretskii <eliz@gnu.org>
12717
12718 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12719 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12720 of temacs in GUI mode.
12721
12722 2011-11-07 Martin Rudalics <rudalics@gmx.at>
12723
12724 * window.h: Declare delete_all_child_windows instead of
12725 delete_all_subwindows.
12726 * window.c (Fwindow_nest, Fset_window_nest)
12727 (Fset_window_new_total, Fset_window_new_normal)
12728 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12729 (delete_all_subwindows): Rename to delete_all_child_windows.
12730 (Fdelete_other_windows_internal, Fset_window_configuration):
12731 Call delete_all_child_windows instead of delete_all_subwindows.
12732 * frame.c (delete_frame): Call delete_all_child_windows instead
12733 of delete_all_subwindows.
12734
12735 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12736
12737 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12738 This is also needed for porting to any host where GC_MARK_STACK is
12739 not GC_MAKE_GCPROS_NOOPS.
12740 (which_symbols): Use it.
12741
12742 2011-11-07 Kenichi Handa <handa@m17n.org>
12743
12744 * coding.c (coding_set_destination): Check coding->src_pos only
12745 when coding->src_object is a buffer (bug#9910).
12746
12747 * process.c (send_process): Set the member src_multibyte of coding
12748 to 0 (bug#9911) when sending a unibyte text.
12749
12750 * callproc.c (Fcall_process): Set the member src_multibyte of
12751 process_coding to 0 (bug#9912).
12752
12753 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12754
12755 * xmenu.c (cleanup_widget_value_tree): New function.
12756 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12757 calling free_menubar_widget_value_tree directly (Bug#9830).
12758
12759 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12760
12761 Fix some portability problems with 'inline'.
12762 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12763 (window_box_width, window_box_left, window_box_left_offset)
12764 (window_box_right, window_box_right_offset): Declare extern.
12765 Otherwise, these inline functions do not conform to C99 and
12766 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12767 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12768 * intervals.c (adjust_intervals_for_insertion)
12769 (adjust_intervals_for_deletion): Now extern, because otherwise the
12770 extern inline functions 'offset_intervals' couldn't refer to it.
12771 (static_offset_intervals): Remove.
12772 (offset_intervals): Rewrite using the old contents of
12773 static_offset_intervals. The old version didn't conform to C99
12774 because an extern inline function contained a reference to an
12775 identifier with static linkage.
12776
12777 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12778
12779 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12780 GC.
12781
12782 2011-11-06 Eli Zaretskii <eliz@gnu.org>
12783
12784 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12785 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12786 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12787 return Qleft_to_right.
12788
12789 2011-11-06 Chong Yidong <cyd@gnu.org>
12790
12791 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12792 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12793 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12794 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12795 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12796 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12797 (Fwindow_vscroll): Doc fix.
12798 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12799 argument, since it makes no sense to pass a live window and for
12800 consistency with window-child.
12801
12802 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12803
12804 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12805 support MSVC.
12806
12807 2011-11-05 Jason Rumney <jasonr@gnu.org>
12808
12809 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12810 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12811 fonts (Bug#6029).
12812 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12813 bitwise arithmetic preventing use of unicode-sip and non-truetype
12814 opentype fonts.
12815
12816 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12817
12818 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12819 "emacs"-only part.
12820
12821 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12822 initialization code to keep similarity to xfns.c after changes
12823 from 2011-11-05.
12824
12825 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12826
12827 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12828 (unwind_create_frame): New function (Bug#9943).
12829 (Fx_create_frame): Restructure code to be more similar to the one in
12830 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12831 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12832 Move terminal->reference_count++ just before making the frame official
12833 (Bug#9943).
12834
12835 * nsterm.m (x_free_frame_resources): New function.
12836 (x_destroy_window): Move code to x_free_frame_resources.
12837
12838 * xfns.c (unwind_create_frame): Fix comment.
12839 (Fx_create_frame, x_create_tip_frame):
12840 Move terminal->reference_count++ just before making the frame
12841 official. Move initialization of image_cache_refcount and
12842 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12843
12844 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12845
12846 Support MSVC build with newer versions of Visual Studio.
12847 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12848 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12849 nt/gmake.defs.
12850
12851 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12852 which are not supported by MSVC.
12853 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12854 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12855 bitfields.
12856 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12857 types in bitfields.
12858 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12859
12860 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12861
12862 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12863
12864 Support MSVC build with newer versions of Visual Studio.
12865 * w32.c: Don't include w32api.h for MSVC.
12866 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12867
12868 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12869 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12870 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12871 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12872 e_* cousins.
12873 (alloca) [_MSC_VER]: Define to _alloca.
12874
12875 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12876
12877 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12878
12879 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12880
12881 * xdisp.c (note_mouse_highlight): If either of
12882 previous/next-single-property-change returns nil, treat that as
12883 the beginning or the end of the buffer. (Bug#9955)
12884
12885 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12886
12887 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12888 label is not null (Bug#9951).
12889 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12890 may be NULL.
12891
12892 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12893
12894 * window.c (Fwindow_body_size): Mention in the doc string that the
12895 return value is in frame's canonical units. (Bug#9949)
12896
12897 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12898
12899 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12900
12901 * w32fns.c (unwind_create_frame): If needed, free the glyph
12902 matrices of the partially constructed frame. (Bug#9943)
12903 * xfns.c (unwind_create_frame): Likewise.
12904
12905 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12906
12907 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12908 Don't stop backward scan on the continuation glyph, even though
12909 its CHARPOS is positive.
12910 (mouse_face_from_buffer_pos, note_mouse_highlight):
12911 Rename cover_string to disp_string.
12912
12913 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12914
12915 * window.c (temp_output_buffer_show): Don't use
12916 Vtemp_buffer_show_specifiers.
12917 (Vtemp_buffer_show_specifiers): Remove unused variable.
12918
12919 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12920
12921 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12922 past the beginning of the current glyph matrix.
12923
12924 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12925
12926 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12927 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12928 HAVE_GTK3 (Bug#9869).
12929
12930 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12931 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12932
12933 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12934
12935 * xterm.c: Declare x_handle_net_wm_state to return int.
12936 (handle_one_xevent): Check if we are iconified but don't have
12937 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12938 (get_current_wm_state): Return non-zero if not hidden,
12939 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12940 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12941 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12942 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12943
12944 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12945
12946 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12947 so that this new function doesn't get optimized away by a
12948 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12949
12950 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12951
12952 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12953
12954 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12955
12956 Fix the `xbytecode' command.
12957 * .gdbinit (xprintbytestr): New command.
12958 (xwhichsymbols): Rename from `which'; all callers changed.
12959 (xbytecode): Print the byte-code string as well.
12960
12961 2011-10-29 Kim Storm <storm@cua.dk>
12962
12963 * alloc.c (which_symbols): New function.
12964
12965 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12966
12967 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12968 line. (Bug#9903)
12969
12970 2011-10-29 Glenn Morris <rgm@gnu.org>
12971
12972 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12973 Not clear what it was for, and it causes various bugs. (Bug#9839)
12974
12975 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12976
12977 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12978 possible random value that matches one of those tested as
12979 condition to clear the mouse face.
12980
12981 2011-10-28 Chong Yidong <cyd@gnu.org>
12982
12983 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12984
12985 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12986
12987 * window.c (make_window): Initialize phys_cursor_on_p.
12988
12989 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12990
12991 * lisp.h (struct Lisp_Symbol): Update comments.
12992
12993 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12994
12995 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12996
12997 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12998
12999 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
13000 <oslsachem@gmail.com> for helping to debug this.
13001
13002 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
13003 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
13004 (g_b_init_get_glyph_outline_w): New static variables.
13005 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
13006 (GetGlyphOutlineW_Proc): New typedefs.
13007 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
13008 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
13009 New functions.
13010 (w32font_open_internal, compute_metrics):
13011 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
13012 instead of calling the "wide" APIs directly.
13013
13014 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
13015
13016 * w32.h (syms_of_w32font): Add prototype.
13017
13018 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
13019
13020 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
13021 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
13022 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
13023 (Fmove_to_window_line): Doc fix.
13024
13025 2011-10-27 Chong Yidong <cyd@gnu.org>
13026
13027 * process.c (make_process): Set gnutls_state to NULL.
13028
13029 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
13030 non-NULL, regardless of GNUTLS_INITSTAGE.
13031 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
13032 an error. Set process slots as soon as we allocate them.
13033
13034 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
13035
13036 2011-10-27 Chong Yidong <cyd@gnu.org>
13037
13038 * gnutls.c (emacs_gnutls_deinit): New function.
13039 Deallocate credentials structures as well as calling gnutls_deinit.
13040 (Fgnutls_deinit, Fgnutls_boot): Use it.
13041
13042 * process.c (make_process): Initialize GnuTLS credentials to NULL.
13043 (deactivate_process): Call emacs_gnutls_deinit.
13044
13045 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
13046
13047 * image.c (x_create_x_image_and_pixmap):
13048 * w32.c (sys_rename, w32_delayed_load):
13049 * w32font.c (fill_in_logfont):
13050 * w32reg.c (x_get_string_resource): Silence compiler warnings.
13051
13052 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
13053
13054 * w32fns.c (w32_default_color_map): New function,
13055 extracted from Fw32_default_color_map.
13056 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
13057
13058 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
13059
13060 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
13061
13062 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
13063
13064 * keyboard.c (test_undefined): New function (bug#9751).
13065 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
13066
13067 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
13068
13069 * sysdep.c (init_sys_modes): Fix the check for the controlling
13070 terminal (Bug#6649).
13071
13072 2011-10-20 Eli Zaretskii <eliz@gnu.org>
13073
13074 * dispextern.h (struct bidi_it): New member next_en_type.
13075
13076 * bidi.c (bidi_line_init): Initialize the next_en_type member.
13077 (bidi_resolve_explicit_1): When next_en_pos is valid for the
13078 current character, check also for next_en_type being WEAK_EN.
13079 (bidi_resolve_weak): Don't enter the expensive loop if the current
13080 position is before next_en_pos. Record the bidi type of the first
13081 non-ET, non-BN character we find, in addition to its position.
13082 (bidi_level_of_next_char): Invalidate next_en_type when
13083 next_en_pos is over-stepped.
13084
13085 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
13086
13087 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
13088 * editfns.c: Rewrite current-time-zone so that it invokes
13089 the equivalent of (format-time-string "%Z") to get the time zone name.
13090 This fixes a bug when the time zone name contains characters that
13091 need converting from the system time locale to Emacs internal format.
13092 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
13093 that patch fixed format-time-string to do the conversion, but
13094 I forgot to fix current-time-zone.
13095 (format_time_string): New function, containing most of
13096 what Fformat_time_string used to contain.
13097 (Fformat_time_string): Rewrite in terms of format_time_string.
13098 This doesn't change this function's behavior.
13099 (current-time-zone): Rewrite to use format_time_string.
13100 This fixes the bug reported by Michael Schierl in
13101 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
13102 Jason Rumney's 2007-06-07 change worked around this bug, but
13103 didn't fix it.
13104 * systime.h (tzname, timezone): Remove no-longer-used declarations.
13105
13106 2011-10-19 Eli Zaretskii <eliz@gnu.org>
13107
13108 * xdisp.c (start_display): If the character at POS is displayed
13109 via a display vector, reset IT->current.dpvec_index to zero.
13110 (try_window_reusing_current_matrix): If a line ends in a display
13111 vector or the next line starts in a display vector, continue
13112 redrawing the window even though the character position of
13113 start_row was reached.
13114 (Bug#9771, part 2)
13115
13116 2011-10-18 Chong Yidong <cyd@gnu.org>
13117
13118 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
13119 with nobreak-char-display too.
13120
13121 2011-10-18 Eli Zaretskii <eliz@gnu.org>
13122
13123 Fix part 3 of bug#9771.
13124 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
13125 (bidi_resolve_neutral): Don't enter the expensive loop looking for
13126 non-neutral characters if the current character is a paragraph
13127 separator (a.k.a. Newline). This avoids running the same
13128 expensive loop twice, once when we consume the preceding newline
13129 and the other time when the line actually needs to be displayed.
13130 Avoid the loop when we see neutrals on the base embedding level
13131 following a character whose directionality is the same as the
13132 paragraph's. This avoids running the expensive loop when a line
13133 ends in a long sequence of neutrals, like control characters.
13134 Add assertion against STRONG_AL type. Slightly rearrange code
13135 that determines the type of a neutral given the first non-neutral
13136 that follows it.
13137 (bidi_level_of_next_char): Set next_en_pos to zero when
13138 invalidating its info.
13139
13140 2011-10-17 Eli Zaretskii <eliz@gnu.org>
13141
13142 * xdisp.c (push_display_prop): Determine whether to record string
13143 or buffer position by IT->string, not by IT->method. Allow
13144 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
13145 (move_it_vertically_backward): Don't look for character position
13146 immediately after the newline when in a continuation line.
13147 (Bug#9771, part 1)
13148
13149 2011-10-15 Martin Rudalics <rudalics@gmx.at>
13150
13151 * window.c (coordinates_in_window): Rewrite and delabelize
13152 vertical border check. (Bug#5357) (Bug#9618)
13153
13154 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
13155
13156 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
13157 errors in XSetWindowBorder (bug#9310).
13158
13159 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
13160
13161 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
13162 avoid crash when xmalloc overrun checking is enabled.
13163
13164 2011-10-13 Eli Zaretskii <eliz@gnu.org>
13165
13166 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
13167 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
13168 cursor motion with <left> and <right> arrow keys.
13169
13170 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
13171 some callers set that themselves.
13172
13173 2011-10-12 Eli Zaretskii <eliz@gnu.org>
13174
13175 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
13176 display string and the previous row comes from the same string and
13177 is empty. (Bug#9739) (Bug#9738)
13178
13179 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
13180
13181 * doc.c (get_doc_string): Encode file name (bug#9735).
13182
13183 2011-10-12 Eli Zaretskii <eliz@gnu.org>
13184
13185 * bidi.c (bidi_level_of_next_char):
13186 * xdisp.c (get_visually_first_element): Remove old incorrect
13187 comments regarding the Unicode Line Separator character.
13188
13189 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
13190
13191 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
13192
13193 * alloc.c (Fgc_status): Do not access beyond zombies array
13194 boundary if nzombies > MAX_ZOMBIES.
13195 * alloc.c (dump_zombies): Add missing format specifier.
13196
13197 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
13198
13199 * xdisp.c (set_cursor_from_row): Simplify conditionals,
13200 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
13201
13202 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
13203 Some packages use them to denote characters with modifiers.
13204
13205 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
13206
13207 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
13208 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
13209 matching a pp-number. Rename parameter var to var1.
13210
13211 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
13212
13213 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
13214
13215 2011-10-08 Glenn Morris <rgm@gnu.org>
13216
13217 * callint.c (Fcall_interactively): Give a more explicit error for the
13218 'c' case with a non-character input. (Bug#8479)
13219
13220 2011-10-08 Eli Zaretskii <eliz@gnu.org>
13221
13222 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
13223 lines.
13224 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
13225 lines that are hscrolled on the left.
13226
13227 * dispnew.c (buffer_posn_from_coords): Account for a possible
13228 presence of header-line. (Bug#4426)
13229
13230 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
13231
13232 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
13233 Don't advertise functionality which we discourage or doesn't work.
13234
13235 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
13236
13237 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
13238 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
13239 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
13240 this makes Emacs dump core during garbage collection on rare
13241 occasions. sizeof is obviously inferior to offsetof here, so
13242 stick with offsetof.
13243 (GC_POINTER_ALIGNMENT): New macro.
13244 (mark_memory): Omit 3rd (offset) arg; caller changed.
13245 Don't assume EMACS_INT alignment is the same as pointer alignment.
13246
13247 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
13248
13249 * keyboard.c (read_key_sequence_remapped): New var.
13250 (read_key_sequence): Compute remapping in the right buffer.
13251 (command_loop_1): Use read_key_sequence's remapping directly.
13252
13253 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
13254
13255 * dired.c (file_name_completion): Don't expand file name.
13256 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
13257 before checking file name handler.
13258
13259 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
13260 they've been requested explicitly (bug#9591).
13261
13262 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
13263
13264 * keymap.c (Fsingle_key_description): Use make_specified_string
13265 instead of build_string to build string from push_key_description.
13266 (Bug#5193)
13267
13268 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13269
13270 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
13271 This fixes a Y2038 bug on 64-bit hosts.
13272 * buffer.c (reset_buffer):
13273 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
13274 (Fclear_buffer_auto_save_failure):
13275 Use 0, not -1, to represent an unset failure time, since time_t
13276 might not be signed.
13277
13278 Remove dependency on glibc malloc internals.
13279 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13280 Move back here from lisp.h, but with their new implementations.
13281 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13282 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
13283 * charset.c (charset_table_init): New static var.
13284 (syms_of_charset): Use it instead of xmalloc. This removes a
13285 dependency on glibc malloc internals. See Eli Zaretskii's comment in
13286 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
13287 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13288 Move back to alloc.c.
13289 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13290 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
13291
13292 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
13293
13294 * nsterm.m (windowDidResize): Call x_set_window_size only when
13295 ns_in_resize is true. Otherwise set pixelwidth/height and
13296 call change_frame_size (Bug#9628).
13297
13298 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13299
13300 Port --enable-checking=all to Fedora 14 x86-64.
13301 * charset.c (syms_of_charset): Also account for glibc malloc's
13302 internal overhead when calculating the initial malloc maximum.
13303
13304 Port --enable-checking=all to Fedora 14 x86.
13305 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13306 Move to lisp.h.
13307 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
13308 (overrun_check_realloc, overrun_check_free):
13309 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
13310 That way, xmalloc returns a properly-aligned pointer even if
13311 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
13312 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
13313 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
13314 into account when calculating the initial malloc maximum.
13315 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13316 Move here from alloc.c, so that charset.c can use it too.
13317 Properly align; the old code wasn't right for common 32-bit hosts
13318 when configured with --enable-checking=all.
13319 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13320 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
13321
13322 2011-09-29 Eli Zaretskii <eliz@gnu.org>
13323
13324 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
13325 use EDOM.
13326
13327 2011-09-28 Eli Zaretskii <eliz@gnu.org>
13328
13329 * xdisp.c (compute_display_string_end): If there's no display
13330 string at CHARPOS, return -1.
13331
13332 * bidi.c (bidi_fetch_char): When compute_display_string_end
13333 returns a negative value, treat the character as a normal
13334 character not covered by a display string. (Bug#9624)
13335
13336 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
13337
13338 * lread.c (Fread_from_string): Fix typo in docstring.
13339
13340 2011-09-27 Eli Zaretskii <eliz@gnu.org>
13341
13342 * xdisp.c (handle_invisible_prop): If invisible text ends on a
13343 newline, reseat the iterator instead of bidi-iterating there one
13344 character at a time. (Bug#9610)
13345 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
13346 TO_CHARPOS if the bidi iterator is at base embedding level.
13347
13348 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
13349
13350 * lread.c (readevalloop): Use correct code for NBSP.
13351 (read1): Likewise. (Bug#9608)
13352
13353 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
13354
13355 * dbusbind.c (Fdbus_register_signal): When service is not
13356 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
13357
13358 2011-09-25 Glenn Morris <rgm@gnu.org>
13359
13360 * buffer.c (truncate-lines): Doc fix.
13361
13362 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
13363
13364 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
13365 (Fset_window_next_buffers): Doc fix.
13366
13367 2011-09-24 Glenn Morris <rgm@gnu.org>
13368
13369 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
13370
13371 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
13372
13373 Fix minor problems found by static checking.
13374 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
13375 * indent.c (Fvertical_motion): Fix == vs = typo.
13376
13377 2011-09-24 Eli Zaretskii <eliz@gnu.org>
13378
13379 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
13380 Default value is now t. Doc fix.
13381
13382 * indent.c (Fvertical_motion): Compute and apply the overshoot
13383 logic when moving up, not only when moving down. Fix the
13384 confusing name and values of the it_overshoot_expected variable;
13385 logic changes accordingly. (Bug#9254) (Bug#9549)
13386
13387 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
13388 CHARPOS is covered by a display string which includes newlines.
13389 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
13390 is covered by a display string with embedded newlines.
13391
13392 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
13393
13394 * dbusbind.c (Fdbus_register_signal): Add match rule to
13395 Vdbus_registered_objects_table. (Bug#9581)
13396 (Fdbus_register_method, Vdbus_registered_objects_table):
13397 Fix docstring.
13398
13399 2011-09-24 Jim Meyering <meyering@redhat.com>
13400
13401 do not ignore write error for any output size
13402 The previous change was incomplete.
13403 While it makes emacs --batch detect the vast majority of stdout
13404 write failures, errors were still ignored whenever the output size is
13405 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
13406 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
13407 && echo FAIL: ignored write error
13408 FAIL: ignored write error
13409 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
13410 && echo FAIL: ignored write error
13411 FAIL: ignored write error
13412 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
13413
13414 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
13415
13416 * emacs.c (Fkill_emacs): In noninteractive mode exit
13417 non-successfully if a write error occurred on stdout. (Bug#9574)
13418
13419 2011-09-21 Eli Zaretskii <eliz@gnu.org>
13420
13421 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
13422 the xassert test.
13423
13424 * dispextern.h (struct it): Update the comment documenting what
13425 can it->OBJECT be.
13426
13427 2011-09-20 Eli Zaretskii <eliz@gnu.org>
13428
13429 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
13430 a display string, extend search for cursor position to end of row.
13431 (find_row_edges): If the row ends in a newline from a display
13432 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
13433 Handle the case of a display string with multiple newlines.
13434 (Fcurrent_bidi_paragraph_direction): Fix search for previous
13435 non-empty line. Fixes confusing cursor motion with arrow keys at
13436 the beginning of a line that starts with whitespace.
13437
13438 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13439
13440 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13441 (bug#9493).
13442
13443 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
13444
13445 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13446 boolean (Bug#9154).
13447
13448 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13449
13450 * xdisp.c (display_line): Record maximum and minimum buffer
13451 positions even if no glyphs were produced (e.g., by a zero-width
13452 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13453 buffer positions that will be removed from the glyph row because
13454 they don't fit.
13455 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13456 column is beyond frame width: don't subtract 1 "pixel" when
13457 computing width of the stretch.
13458 (reseat_at_next_visible_line_start): Undo the change made on
13459 2011-09-17 that saved paragraph information and restored it after
13460 the call to `reseat'. (Bug#9545)
13461
13462 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13463
13464 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13465 and turn window cursor on if cleared (Bug#9415).
13466
13467 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
13468
13469 * search.c (boyer_moore): Take unibyte characters from pattern
13470 literally. (Bug#9458)
13471
13472 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13473
13474 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13475
13476 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13477
13478 Fix minor problem found by static checking.
13479 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13480 initialized, to pacify gcc -Wuninitialized.
13481
13482 * fileio.c: Report proper errno when syscall falls.
13483 (Finsert_file_contents): Save and restore errno,
13484 so that report_file_error outputs the correct diagnostic.
13485 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13486
13487 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13488
13489 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13490
13491 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13492
13493 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13494 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13495
13496 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13497
13498 * xdisp.c (reseat_at_next_visible_line_start): Keep information
13499 about the current paragraph and restore it after the call to reseat.
13500
13501 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13502 (bidi_find_paragraph_start): Search back for paragraph beginning
13503 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13504 (bidi_move_to_visually_next): Only trigger paragraph-related
13505 computations when the last character is a newline or at EOB, not
13506 just any NEUTRAL_B. (Bug#9470)
13507
13508 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13509 truncated lines if point is covered by a display string. (Bug#9524)
13510
13511 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13512
13513 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13514 (cons_to_x_long): New function.
13515 (lisp_data_to_selection_data): Use it. Correct the test for
13516 short-versus-long data; it was negated. Break out of vector
13517 loop, for efficiency, when a long datum is discovered.
13518
13519 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13520
13521 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13522
13523 2011-09-16 Eli Zaretskii <eliz@gnu.org>
13524
13525 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13526 GCC PR/17406) by declaring this function with external scope.
13527
13528 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13529
13530 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13531 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13532
13533 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13534
13535 * editfns.c (Fformat): Correctly handle text properties on "%%".
13536
13537 2011-09-15 Eli Zaretskii <eliz@gnu.org>
13538
13539 * xterm.c (x_draw_composite_glyph_string_foreground):
13540 * w32term.c (x_draw_composite_glyph_string_foreground):
13541 * term.c (encode_terminal_code):
13542 * composite.c (composition_update_it, get_composition_id):
13543 * xdisp.c (get_next_display_element)
13544 (fill_composite_glyph_string): Add comments about special meaning
13545 of TAB characters in a composition.
13546
13547 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13548
13549 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
13550 This occurs when processing a multibyte format.
13551 Problem reported by Wolfgang Jenker.
13552
13553 2011-09-15 Johan Bockgård <bojohan@gnu.org>
13554
13555 * xdisp.c (try_cursor_movement): Only check for exact match if
13556 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13557
13558 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13559
13560 Remove unused external symbols.
13561 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13562 * xdisp.c (calc_pixel_width_or_height): Now static.
13563 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13564 * indent.c (check_display_width):
13565 * w32term.c: Fix comment to match code.
13566 * xterm.c, xterm.h (x_catching_errors): Remove.
13567
13568 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13569
13570 * xselect.c: Use signed conversions more consistently (Bug#9498).
13571 (selection_data_to_lisp_data): Assume incoming selection data are
13572 signed integers, not unsigned. This is to be consistent with
13573 outgoing selection data, which was modified to use signed integers
13574 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13575 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13576 expects long, not unsigned long.
13577
13578 2011-09-14 Eli Zaretskii <eliz@gnu.org>
13579
13580 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13581 computation of loop end. Reported by Johan Bockgård
13582 <bojohan@gnu.org>.
13583
13584 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
13585
13586 * frame.c (Fother_visible_frames_p): Function deleted.
13587
13588 2011-09-12 Eli Zaretskii <eliz@gnu.org>
13589
13590 * indent.c (compute_motion): Process display vector front to back
13591 rather than the other way around. (Bug#2496)
13592
13593 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13594
13595 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13596
13597 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
13598
13599 * minibuf.c (Fread_from_minibuffer): Doc fix.
13600
13601 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13602
13603 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13604 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13605
13606 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13607
13608 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13609 value for non-existent files.
13610
13611 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13612
13613 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13614 set its "size" to -1. This will set the modtime_size field of
13615 the corresponding buffer to -1, which is what
13616 verify-visited-file-modtime expects for files that do not exist.
13617 (Bug#9139)
13618
13619 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13620
13621 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13622 here ...
13623 * lisp.h: ... from here. push_key_description is no longer
13624 defined in keyboard.c, so its declaration should not be in
13625 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13626 logically belongs with push_key_description.
13627
13628 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13629
13630 * buffer.h: Include <sys/types.h> instead of <time.h>.
13631 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13632 Problem reported by Herbert J. Skuhra.
13633
13634 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13635
13636 * xml.c (parse_region): Make the parsing work for
13637 non-comment-starting XML files again (bug#9144).
13638
13639 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13640
13641 * image.c (gif_load): Fix calculation of bottom and right corner.
13642 (Bug#9468)
13643
13644 2011-09-10 Eli Zaretskii <eliz@gnu.org>
13645
13646 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13647 redisplay in small windows.
13648
13649 2011-09-09 Eli Zaretskii <eliz@gnu.org>
13650
13651 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13652
13653 2011-09-08 Martin Rudalics <rudalics@gmx.at>
13654
13655 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13656 Operate on live windows only.
13657
13658 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
13659
13660 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13661
13662 2011-09-07 Eli Zaretskii <eliz@gnu.org>
13663
13664 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13665 only under bidi iteration.
13666
13667 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13668
13669 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13670
13671 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13672
13673 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13674 Without this fix, the command to link temacs failed due to an
13675 undefined symbol __builtin_isnan. This is because
13676 /usr/include/iso/math_c99.h #defines isnan(x) to
13677 __builtin_isnan(x), but the bundled gcc, which identifies itself
13678 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13679 a __builtin_isnan.
13680 * floatfns.c (isnan): #undef, and then #define to a clone of
13681 what's in data.c.
13682 (Fisnan): Always define, since it's always available now.
13683 (syms_of_floatfns): Always define isnan at the Lisp level.
13684
13685 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13686
13687 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13688
13689 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13690
13691 * fileio.c: Fix bugs with large file offsets (Bug#9428).
13692 The previous code assumed that file offsets (off_t values) fit in
13693 EMACS_INT variables, which is not true on typical 32-bit hosts.
13694 The code messed up by falsely reporting buffer overflow in cases
13695 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13696 when "big" contains more than 2**29 bytes, even though this
13697 inserts just one byte and does not overflow the buffer.
13698 (Finsert_file_contents): Store file offsets as off_t
13699 values, not as EMACS_INT values. Check for overflow when
13700 converting between EMACS_INT and off_t. When checking for
13701 buffer overflow or for overlap, take the offsets into account.
13702 Don't use EMACS_INT for small values where int suffices.
13703 When checking for overlap, fix a typo: ZV was used where
13704 ZV_BYTE was intended.
13705 (Fwrite_region): Don't assume off_t fits into 'long'.
13706 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13707
13708 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
13709
13710 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13711
13712 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13713
13714 sprintf-related integer and memory overflow issues (Bug#9412).
13715
13716 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13717 (esprintf, exprintf, evxprintf): New functions.
13718 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13719 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13720 (modify_event_symbol): Do not assume that the length of
13721 name_alist_or_stem is safe to alloca and fits in int.
13722 (Fexecute_extended_command): Likewise for function name and binding.
13723 (Frecursion_depth): Wrap around reliably on integer overflow.
13724 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13725 since some callers pass EMACS_INT values.
13726 (Fsingle_key_description): Don't crash if symbol name contains more
13727 than MAX_ALLOCA bytes.
13728 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13729 (get_minibuffer): Arg is now EMACS_INT, not int.
13730 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13731 (esprintf, exprintf, evxprintf): New decls.
13732 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13733
13734 * dbusbind.c (signature_cat): New function.
13735 (xd_signature, Fdbus_register_signal):
13736 Do not overrun buffer; instead, report string overflow.
13737
13738 * dispnew.c (add_window_display_history): Don't overrun buffer.
13739 Truncate instead; this is OK since it's just a log.
13740
13741 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13742 even if the time zone offset is outlandishly large.
13743 Don't mishandle offset == INT_MIN.
13744
13745 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13746 when creating daemon; the previous buffer-overflow check was incorrect.
13747
13748 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13749 which has the guts of the old verror function.
13750
13751 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13752 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13753
13754 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13755 (font_unparse_xlfd): Don't blindly alloca long strings.
13756 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13757 fits in int, when using sprintf. Use single snprintf to count
13758 length of string rather than counting it via multiple sprintfs;
13759 that's simpler and more reliable.
13760 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13761 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13762 sprintf, in case result does not fit in int.
13763
13764 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13765 (fontset_from_font): Print it.
13766
13767 * frame.c (tty_frame_count): Now printmax_t, not int.
13768 (make_terminal_frame, set_term_frame_name): Print it.
13769 (x_report_frame_params): In X, window IDs are unsigned long,
13770 not signed long, so print them as unsigned.
13771 (validate_x_resource_name): Check for implausibly long names,
13772 and don't assume name length fits in 'int'.
13773 (x_get_resource_string): Don't blindly alloca invocation name;
13774 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13775 not fit in int.
13776
13777 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13778 (xg_check_special_colors, xg_set_geometry):
13779 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13780
13781 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13782 Use esprintf, not sprintf, in case result does not fit in int.
13783
13784 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13785 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13786 it as a large positive number.
13787 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13788 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13789
13790 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13791 in case result does not fit in int.
13792
13793 * print.c (float_to_string): Detect width overflow more reliably.
13794 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13795 buffer overrun. Don't assume list length fits in 'int'. Treat
13796 print length of 0 as 0, not as infinity; to be consistent with other
13797 uses of print length in this function. Don't overflow print length
13798 index. Don't assume hash table size fits in 'long', or that
13799 vectorlike size fits in 'unsigned long'.
13800
13801 * process.c (make_process): Use printmax_t, not int, to format
13802 process-name gensyms.
13803
13804 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13805
13806 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13807 to avoid potential buffer overrun.
13808
13809 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13810 if X resource line is longer than 512 bytes.
13811
13812 * xfns.c (x_window): Make sprintf buffer a bit bigger
13813 to avoid potential buffer overrun.
13814
13815 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13816
13817 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13818
13819 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13820
13821 Integer overflow fixes for scrolling, etc.
13822 Without these, Emacs silently mishandles large integers sometimes.
13823 For example, "C-u 4294967297 M-x recenter" was treated as if
13824 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13825
13826 * xdisp.c (try_window_id): Check Emacs fixnum range before
13827 converting to 'int'.
13828
13829 * window.c (window_scroll_line_based, Frecenter):
13830 Check that an Emacs fixnum is in range before assigning it to 'int'.
13831 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13832 values converted from Emacs fixnums.
13833 (Frecenter): Don't wrap around a line count if it is out of 'int'
13834 range; instead, treat it as an extreme value.
13835 (Fset_window_configuration, compare_window_configurations):
13836 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13837
13838 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13839 that can exceed INT_MAX. Check that EMACS_INT value is in range
13840 before assigning it to the (possibly-narrower) index.
13841 (match_limit): Don't assume that a fixnum can fit in 'int'.
13842
13843 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13844 exceed INT_MAX.
13845
13846 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13847 (Fvertical_motion): Don't wrap around LINES values that don't fit
13848 in 'int'. Instead, treat them as extreme values. This is good
13849 enough for windows, which can't have more than INT_MAX lines anyway.
13850
13851 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13852
13853 * Require libxml/parser.h to avoid compilation warning.
13854
13855 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13856
13857 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13858 since this reportedly can destroy thread storage.
13859
13860 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13861
13862 * syntax.c (find_defun_start): Update all cache variables if
13863 exiting early (Bug#9401).
13864
13865 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13866
13867 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13868
13869 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13870 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13871 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13872
13873 * term.c (tty_append_glyph): New function.
13874 (produce_stretch_glyph): Static function and its prototype deleted.
13875
13876 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13877 Add prototypes.
13878
13879 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13880
13881 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13882 when checking :margin (Bug#9390).
13883 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13884 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13885 so that the name doesn't mislead. All uses changed.
13886
13887 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13888
13889 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13890 set_tty_hooks.
13891
13892 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13893
13894 * xdisp.c (move_it_to): Don't bail out early when reaching
13895 position beyond to_charpos, if we are scanning backwards.
13896 (move_it_vertically_backward): When DY == 0, make sure we get to
13897 the first character in the line after the newline.
13898
13899 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13900
13901 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13902 (ccl_driver): Do not generate an out-of-range pointer.
13903 (Fccl_execute_on_string): Remove unnecessary check for
13904 integer overflow, noted by Stefan Monnier in
13905 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13906 Remove a FIXME that didn't need fixing.
13907 Simplify the newly-introduced buffer reallocation code.
13908
13909 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13910
13911 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13912
13913 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13914
13915 Integer and memory overflow issues (Bug#9196).
13916
13917 * doc.c (get_doc_string): Rework so that
13918 get_doc_string_buffer_size is the actual buffer size, rather than
13919 being 1 less than the actual buffer size; this makes xpalloc more
13920 convenient.
13921
13922 * image.c (x_allocate_bitmap_record, cache_image):
13923 * xselect.c (Fx_register_dnd_atom):
13924 Simplify previous changes by using xpalloc.
13925
13926 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13927 since either will do and ptrdiff_t is convenient with xpalloc.
13928
13929 * charset.c (charset_table_size)
13930 (struct charset_sort_data.priority): Now ptrdiff_t.
13931 (charset_compare): Don't overflow if priorities differ greatly.
13932 (Fsort_charsets): Don't assume list length fits in int.
13933 Check for size-calculation overflow when allocating sort data.
13934 (syms_of_charset): Allocate an initial charset table that is
13935 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13936
13937 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13938
13939 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13940 The actual value is always <= INT_MAX, and leaving it unsigned made
13941 overflow checking harder.
13942
13943 * dispextern.h (struct glyph_matrix.rows_allocated)
13944 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13945 with xpalloc. The values are still always <= INT_MAX.
13946
13947 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13948
13949 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13950 (SAFE_NALLOCA): New macro.
13951
13952 * region-cache.c (struct boundary.pos, find_cache_boundary)
13953 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13954 (set_cache_region, invalidate_region_cache)
13955 (revalidate_region_cache, know_region_cache, region_cache_forward)
13956 (region_cache_backward, pp_cache):
13957 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13958 so that ptrdiff_t * can be passed to xpalloc.
13959 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13960 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13961 (pp_cache): Don't assume cache_len fits in int.
13962 * region-cache.h: Adjust extern decls to match.
13963
13964 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13965 EMACS_INT, since either will do, for xpalloc.
13966
13967 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13968 (xnmalloc, xnrealloc, xpalloc): New functions.
13969
13970 * bidi.c (bidi_shelve_header_size): New constant.
13971 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13972 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13973
13974 * bidi.c (bidi_cache_shrink):
13975 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13976 (overlay_strings):
13977 Don't update size of array until after memory allocation succeeds,
13978 because xmalloc/xrealloc may not return.
13979 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13980 now that we have proper integer overflow checking.
13981 (record_overlay_string, overlay_strings): Catch overflows when
13982 calculating size of overlay_str_buf.
13983
13984 * callproc.c (Fcall_process): Check for size overflow when
13985 calculating size of args2.
13986 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13987 Normally we prefer signed values, but sticking with ptrdiff_t would
13988 require adding more-complicated checks.
13989
13990 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13991 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13992 Redo buffer-overflow calculations to avoid integer overflow.
13993 Add a FIXME comment where memory seems to be over-allocated.
13994
13995 * character.c (Fstring): Check for size-calculation overflow.
13996
13997 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13998 unnecessary integer overflow. Check for size overflow.
13999 (encode_coding_object): Don't update size until xmalloc succeeds.
14000
14001 * composite.c (get_composition_id): Check for overflow in glyph
14002 length calculations.
14003
14004 Integer and memory overflow fixes for display code.
14005 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
14006 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
14007 (scrolling_window): Check for overflow in size calculations.
14008 (line_draw_cost, realloc_glyph_pool, add_row_entry):
14009 Don't assume glyph table len fits in int.
14010 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
14011 (row_table_size): Now ptrdiff_t, not int.
14012 (scrolling_window): Avoid overflow in size calculations.
14013 Don't update size until allocation succeeds.
14014 * fns.c (concat): Check for overflow in size calculations.
14015 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
14016 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14017 (NEXT_ALMOST_PRIME_LIMIT): New constant.
14018
14019 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
14020 (get_doc_string): Check for size calculation overflow.
14021 Don't update size until allocation succeeds.
14022 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
14023 EMACS_INT, where ptrdiff_t will do.
14024 (Fsubstitute_command_keys): Check for string overflow.
14025
14026 * editfns.c (set_time_zone_rule): Don't assume environment length
14027 fits in int.
14028 (message_length): Now ptrdiff_t, not int.
14029 (Fmessage_box): Don't update size until allocation succeeds.
14030 Don't assume message length fits in int.
14031 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
14032
14033 * emacs.c (main): Do not reallocate argv, since there is a null at
14034 the end that can be overwritten, and this way there's no need to
14035 worry about size-calculation overflow.
14036 (sort_args): Check for size-calculation overflow.
14037
14038 * eval.c (init_eval_once, grow_specpdl): Don't update size until
14039 alloc succeeds.
14040 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
14041
14042 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
14043 (x_set_scroll_bar_width, x_figure_window_size):
14044 Check for integer overflow.
14045 (x_set_alpha): Do not assume XINT fits in int.
14046
14047 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
14048 This is for the members text_lines, text_cols, total_lines, total_cols,
14049 where the system imposes an 'int' limit.
14050
14051 * fringe.c (Fdefine_fringe_bitmap):
14052 Don't update size until alloc works.
14053
14054 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
14055 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
14056
14057 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
14058 Check for size-calculation overflow.
14059 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
14060 do, as we prefer signed integers.
14061 (id_to_widget.max_size, id_to_widget.used)
14062 (xg_store_widget_in_map, xg_remove_widget_from_map)
14063 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
14064 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
14065 Use and return ptrdiff_t, not int.
14066 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
14067 * gtkutil.h: Change prototypes to match the above.
14068
14069 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
14070 are duplicate now that they've been promoted to lisp.h.
14071 (x_allocate_bitmap_record, x_alloc_image_color)
14072 (make_image_cache, cache_image, xpm_load):
14073 Don't update size until alloc is done.
14074 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
14075 (x_detect_edges):
14076 Check for size calculation overflow.
14077 (ct_colors_allocated_max): New constant.
14078 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
14079 overflow.
14080
14081 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
14082 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
14083 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
14084 Use ptrdiff_t, not int, to count maps.
14085 (read_char_minibuf_menu_prompt): Check for overflow in size
14086 calculations. Don't update size until allocation succeeds.
14087 Redo calculations to avoid overflow.
14088 * keyboard.h: Change prototypes to match the above.
14089
14090 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
14091 to count maps.
14092 (current_minor_maps): Check for size calculation overflow.
14093 * keymap.h: Change prototypes to match the above.
14094
14095 * lread.c (read1, init_obarray): Don't update size until alloc done.
14096
14097 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
14098 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
14099
14100 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
14101 Now ptrdiff_t, not int.
14102 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
14103 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
14104
14105 * process.c (Fnetwork_interface_list): Check for overflow
14106 in size calculation.
14107
14108 * region-cache.c (move_cache_gap): Check for size calculation overflow.
14109
14110 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
14111 overflow. Don't bother calling xmalloc when xrealloc will do.
14112
14113 * search.c (Freplace_match): Check for size calculation overflow.
14114 (Fset_match_data): Don't assume list lengths fit in 'int'.
14115
14116 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
14117 for command line length. Do not attempt to address one before the
14118 beginning of an array, as that's not portable.
14119
14120 * term.c (max_frame_lines): Remove; unused.
14121 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
14122 not int.
14123 (encode_terminal_code, calculate_costs): Check for size
14124 calculation overflow.
14125 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
14126 table lengths and related sizes. Don't update size until alloc
14127 done. Redo calculations to avoid overflow.
14128 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
14129
14130 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
14131 subtracting pointers.
14132 (gobble_line): Check for overflow more carefully. Don't update size
14133 until alloc done.
14134
14135 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
14136 Don't update size until alloc done.
14137 Redo size calculations to avoid overflow.
14138 Check for size calculation overflow.
14139 (main) [DEBUG]: Fix typo in invoking tparam1.
14140
14141 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
14142 Use ptrdiff_t, not int, for sizes.
14143 (store_mode_line_noprop_char): Don't update size until alloc done.
14144
14145 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
14146 Use ptrdiff_t, not int, for sizes.
14147 (Finternal_make_lisp_face, cache_face):
14148 Check for size calculation overflow.
14149 (cache_face): Treat size calculation overflows as if they were
14150 memory exhaustion (the usual treatment), rather than aborting.
14151
14152 * xfns.c (x_encode_text, x_set_name_internal)
14153 (Fx_change_window_property): Use ptrdiff_t, not int, to count
14154 sizes, since they can exceed INT_MAX in size. Check for size
14155 calculation overflow.
14156
14157 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
14158 (xg_select): Check for size calculation overflow.
14159 Don't update size until alloc done.
14160
14161 * xrdb.c (get_environ_db): Don't assume path length fits in int,
14162 as sprintf is limited to int lengths.
14163
14164 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
14165 (X_LONG_MIN): New macros.
14166 Use them to make the following changes clearer.
14167 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
14168 This change doesn't affect the value now, but it may help remind
14169 future maintainers not to raise the value too much later.
14170 (SELECTION_QUANTUM): Remove, replacing with ...
14171 (selection_quantum): ... new function, which avoids overflow.
14172 All uses changed.
14173 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
14174 assumption that selection length fits in 'int'.
14175 (x_reply_selection_request, x_handle_selection_request)
14176 (x_get_window_property, receive_incremental_selection)
14177 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
14178 (lisp_data_to_selection_data, clean_local_selection_data):
14179 Use ptrdiff_t, not int, to record length of selection.
14180 (x_reply_selection_request, x_get_window_property)
14181 (receive_incremental_selection, x_property_data_to_lisp):
14182 Redo calculations to avoid overflow.
14183 (x_reply_selection_request): When sending hint, ceiling it at
14184 X_LONG_MAX rather than relying on wraparound overflow to send
14185 something.
14186 (x_get_window_property, receive_incremental_selection)
14187 (lisp_data_to_selection_data, x_property_data_to_lisp):
14188 Check for size-calculation overflow.
14189 (x_get_window_property, receive_incremental_selection)
14190 (lisp_data_to_selection_data, Fx_register_dnd_atom):
14191 Don't store size until memory allocation succeeds.
14192 (x_get_window_property): Plug memory leak on memory exhaustion.
14193 Don't double-block input; malloc is safe here. Don't assume 2**34
14194 - 4 fits in unsigned long. Add an xassert to check
14195 XGetWindowProperty overflow. Be more careful about overflow
14196 calculations, and distinguish size from memory overflow better.
14197 (receive_incremental_selection): When tracing, don't assume
14198 unsigned int is less than INT_MAX.
14199 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
14200 harmful) conversions of unsigned short to int.
14201 (lisp_data_to_selection_data): Don't assume that integers
14202 in the range -65535 through -1 fit in an X unsigned short.
14203 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
14204 result parameters unless successful. Rely on cons_to_unsigned
14205 to report problems with elements; the old code wasn't right anyway.
14206 (x_check_property_data): Check for int overflow; we cannot use
14207 a wider type due to X limits.
14208 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
14209
14210 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
14211
14212 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
14213 (x_term_init): Check for size calculation overflow.
14214 (x_color_cells): Don't store size until memory allocation succeeds.
14215 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
14216 Don't assume alloca size is less than MAX_ALLOCA.
14217 (x_term_init): Don't assume length fits in int (sprintf is limited
14218 to int size).
14219
14220 Use ptrdiff_t for composition IDs.
14221 * character.c (lisp_string_width):
14222 * composite.c (composition_table_size, n_compositions)
14223 (get_composition_id, composition_gstring_from_id):
14224 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
14225 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
14226 * window.c (Frecenter):
14227 Use ptrdiff_t, not int, for composition IDs.
14228 * composite.c (get_composition_id): Check for integer overflow.
14229 * composite.h: Adjust prototypes to match the above changes.
14230
14231 Use ptrdiff_t for hash table indexes.
14232 * category.c (hash_get_category_set):
14233 * ccl.c (ccl_driver):
14234 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
14235 * coding.c (coding_system_charset_list, detect_coding_system):
14236 * coding.h (struct coding_system.id):
14237 * composite.c (get_composition_id, gstring_lookup_cache):
14238 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
14239 * image.c (xpm_get_color_table_h):
14240 * lisp.h (hash_lookup, hash_put):
14241 * minibuf.c (Ftest_completion):
14242 Use ptrdiff_t for hash table indexes, not int (which is too
14243 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
14244 32-bit --with-wide-int hosts).
14245
14246 * charset.c (Fdefine_charset_internal): Check for integer overflow.
14247 Add a FIXME comment about memory leaks.
14248 (syms_of_charset): Don't assume xmalloc returns.
14249
14250 Don't assume that stated character widths fit in int.
14251 * character.c (Fchar_width, c_string_width, lisp_string_width):
14252 * character.h (CHAR_WIDTH):
14253 * indent.c (MULTIBYTE_BYTES_WIDTH):
14254 Use sanitize_char_width to avoid undefined and/or bad behavior
14255 with outlandish widths.
14256 * character.h (sanitize_tab_width): Rename from sanitize_width,
14257 now that we have two such functions. All uses changed.
14258 (sanitize_char_width): New inline function.
14259
14260 Don't assume that tab-width fits in int.
14261 * character.h (sanitize_width): New inline function.
14262 (SANE_TAB_WIDTH): New macro.
14263 (ASCII_CHAR_WIDTH): Use it.
14264 * indent.c (sane_tab_width): Remove. All uses replaced by
14265 SANE_TAB_WIDTH (current_buffer).
14266 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
14267
14268 * fileio.c: Integer overflow issues with file modes.
14269 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
14270
14271 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
14272 Remove unreachable code.
14273 (read_hex, load_charset_map_from_file): Check for integer overflow.
14274
14275 * xterm.c: Don't go over XClientMessageEvent limit.
14276 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
14277 (x_send_scroll_bar_event): Likewise. Check that the size does not
14278 exceed limits imposed by XClientMessageEvent, as well as the usual
14279 ptrdiff_t and size_t limits.
14280
14281 * keyboard.c: Overflow, signedness and related fixes.
14282 (make_lispy_movement): Use same integer type in forward decl
14283 that is used in the definition.
14284 (read_key_sequence, keyremap_step):
14285 Change bufsize argument back to int, undoing my 2011-03-30 change.
14286 We prefer signed types, and int is wide enough here.
14287 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
14288 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
14289 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
14290 length, not size_t. Use ptrdiff_t for index, not int.
14291 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
14292 possibility of integer overflow.
14293
14294 Overflow, signedness and related fixes for images.
14295
14296 * dispextern.h (struct it.stack[0].u.image.image_id)
14297 (struct_it.image_id, struct image.id, struct image_cache.size)
14298 (struct image_cache.used, struct image_cache.ref_count):
14299 * gtkutil.c (update_frame_tool_bar):
14300 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
14301 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
14302 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
14303 * nsmenu.m (update_frame_tool_bar):
14304 * xdisp.c (calc_pixel_width_or_height):
14305 * xfns.c (image_cache_refcount):
14306 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
14307 on typical 64-bit hosts.
14308
14309 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14310 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
14311 Omit unnecessary casts to int.
14312 (parse_image_spec): Check that integers fall into 'int' range
14313 when the callers expect that.
14314 (image_ascent): Redo ascent calculation to avoid int overflow.
14315 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
14316 (lookup_image): Remove unnecessary tests.
14317 (xbm_image_p): Locals are now of int, not EMACS_INT,
14318 since parse_image_check makes sure they fit into int.
14319 (png_load, gif_load, svg_load_image):
14320 Prefer int to unsigned where either will do.
14321 (tiff_handler): New function, combining the cores of the
14322 old tiff_error_handler and tiff_warning_handler.
14323 This function is rewritten to use vsnprintf and thereby avoid
14324 stack buffer overflows. It uses only the features of vsnprintf
14325 that are common to both POSIX and native Microsoft.
14326 (tiff_error_handler, tiff_warning_handler): Use it.
14327 (tiff_load, gif_load, imagemagick_load_image):
14328 Don't assume :index value fits in 'int'.
14329 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
14330 (imagemagick_load_image): Check that crop parameters fit into
14331 the integer types that MagickCropImage accepts. Don't assume
14332 Vimagemagick_render_type has a nonnegative value. Don't assume
14333 size_t fits in 'long'.
14334 (gs_load): Use printmax_t to print the widest integers possible.
14335 Check for integer overflow when computing image height and width.
14336
14337 2011-08-26 Eli Zaretskii <eliz@gnu.org>
14338
14339 * xdisp.c (redisplay_window): Don't force window start if point
14340 will be invisible in the resulting window. (Bug#9324)
14341
14342 2011-08-25 Eli Zaretskii <eliz@gnu.org>
14343
14344 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
14345 the display spec is of the form `(space ...)'.
14346 (handle_display_spec): Return the value returned by
14347 handle_single_display_spec, not just 1 or zero.
14348 (handle_single_display_spec): If the display spec is of the form
14349 `(space ...)', and specifies display in the text area, return 2
14350 rather than 1.
14351 (try_cursor_movement): Check for the need to scroll more
14352 accurately, and prefer exact match for point under bidi.
14353 Don't advance `row' beyond the last row of the window.
14354
14355 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
14356 into disp_prop; all users changed.
14357
14358 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
14359 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
14360 for the text covered by the display property.
14361
14362 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
14363
14364 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
14365 Change return value to nil.
14366 (Frecord_buffer): Delete unused function.
14367
14368 2011-08-24 Eli Zaretskii <eliz@gnu.org>
14369
14370 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
14371 buffers, return left-to-right.
14372 (set_cursor_from_row): Consider candidate row a win if its glyph
14373 represents a newline and point is on that newline. Fixes cursor
14374 positioning on the newline at EOL of R2L text within L2R
14375 paragraph, and vice versa.
14376 (try_cursor_movement): Check continued rows, in addition to
14377 continuation rows. Fixes unwarranted scroll when point enters a
14378 continued line of R2L text within an L2R paragraph, or vice versa.
14379 (cursor_row_p): Consider the case of point being equal to
14380 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
14381 from the end of a short line to the beginning of a continued line
14382 of R2L text within L2R paragraph.
14383 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
14384 composed characters.
14385
14386 * bidi.c (bidi_check_type): Use xassert.
14387 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
14388 members.
14389
14390 2011-08-23 Eli Zaretskii <eliz@gnu.org>
14391
14392 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
14393 a character.
14394
14395 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
14396
14397 * nsfont.m (ns_otf_to_script): Fix typo.
14398
14399 2011-08-22 Kenichi Handa <handa@m17n.org>
14400
14401 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
14402 extra slot even if the purpose is char-code-property-table.
14403
14404 2011-08-23 Eli Zaretskii <eliz@gnu.org>
14405
14406 * xdisp.c (redisplay_window): When computing centering_position,
14407 account for the height of the header line. (Bug#8874)
14408
14409 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
14410 instead of CHAR_TO_BYTE. Fixes a crash when a completion
14411 candidate is selected by the mouse, and that candidate has a
14412 composed character under the mouse.
14413
14414 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
14415 coordinates reported by pos-visible-in-window-p for a composed
14416 character in column zero.
14417
14418 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
14419
14420 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
14421
14422 2011-08-22 Eli Zaretskii <eliz@gnu.org>
14423
14424 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
14425 consider it a hit if to_charpos is anywhere in the range of the
14426 composed buffer positions.
14427
14428 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
14429
14430 * image.c (gif_load): Don't assume that each subimage has the same
14431 dimensions as the base image. Handle disposal method that is
14432 "undefined" by the gif spec (Bug#9335).
14433
14434 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
14435
14436 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
14437 (Fcondition_case): Document `debug' symbol in error handler.
14438
14439 2011-08-19 Eli Zaretskii <eliz@gnu.org>
14440
14441 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14442 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14443 from an Org mode buffer to a Speedbar frame.
14444
14445 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14446 a composition, take its buffer position from IT->cmp_it.charpos.
14447 Fixes cursor positioning at the beginning of a line that begins
14448 with a composed character.
14449
14450 2011-08-18 Eli Zaretskii <eliz@gnu.org>
14451
14452 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14453 character bidirectional type, use STRONG_L instead. Fixes crashes
14454 in a buffer produced by `describe-categories'.
14455
14456 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14457 members before the level stack, so they would be saved and
14458 restored when copying iterator state. Fixes incorrect reordering
14459 around TABs covered by display properties.
14460
14461 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14462
14463 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
14464
14465 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
14466
14467 * eval.c (internal_condition_case, internal_condition_case_1)
14468 (internal_condition_case_2, internal_condition_case_n):
14469 Remove unnecessary aborts (Bug#9081).
14470
14471 2011-08-17 Eli Zaretskii <eliz@gnu.org>
14472
14473 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14474 has no `load' handler, try opening the file locally. (Bug#9311)
14475
14476 2011-08-16 Ken Brown <kbrown@cornell.edu>
14477
14478 * gmalloc.c: Expand comment.
14479
14480 2011-08-16 Eli Zaretskii <eliz@gnu.org>
14481
14482 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14483 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14484
14485 2011-08-16 Ken Brown <kbrown@cornell.edu>
14486
14487 Fix memory allocation problems in Cygwin build (Bug#9273).
14488
14489 * unexcw.c ( __malloc_initialized): Declare external variable.
14490 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14491
14492 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14493 New variables.
14494 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14495 dumped emacs.
14496 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14497 in the static heap.
14498 [CYGWIN] (special_realloc): New function.
14499 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14500 requests to realloc storage in the static heap.
14501
14502 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14503
14504 * bidi.c (bidi_initialize): Remove unused local.
14505
14506 2011-08-15 Eli Zaretskii <eliz@gnu.org>
14507
14508 * bidimirror.h:
14509 * biditype.h: Remove file.
14510 * makefile.w32-in ($(BLD)/bidi.$(O)):
14511 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
14512
14513 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14514
14515 * chartab.c: Improve commentary for the uniprop_table API.
14516
14517 * bidi.c (bidi_paragraph_init): Support zero value of
14518 bidi_ignore_explicit_marks_for_paragraph_level.
14519 (bidi_initialize): Use uniprop_table instead of including
14520 biditype.h and bidimirror.h.
14521
14522 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14523 coordinates of the iterator when restoring from ppos_it.
14524 (Bug#9296)
14525
14526 2011-08-14 Kenichi Handa <handa@m17n.org>
14527
14528 * process.c (create_process): Call setup_process_coding_systems
14529 after the pid of the process is set to -1 (Bug#8162).
14530
14531 2011-08-14 Eli Zaretskii <eliz@gnu.org>
14532
14533 * xdisp.c (move_it_in_display_line_to): Don't invoke
14534 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14535 ppos_it. Fixes vertical cursor motion when line beginning is
14536 covered by an image. (Bug#9296)
14537
14538 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14539
14540 * nsterm.h (ns_run_ascript): Declare.
14541 (NSAPP_DATA2_RUNASSCRIPT): Define.
14542
14543 * nsfns.m (as_script, as_result, as_status): New static variables.
14544 (ns_run_ascript): New function.
14545 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
14546 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14547 the event loop. Get status from as_status (Bug#7276).
14548
14549 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14550 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14551 the event loop (Bug#7276).
14552
14553 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14554
14555 * gnutls.c (QCgnutls_bootprop_priority)
14556 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14557 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14558 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14559 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14560 (QCgnutls_bootprop_verify_hostname_error)
14561 (QCgnutls_bootprop_callbacks_verify): Rename from
14562 Qgnutls_bootprop_..., all uses changed.
14563
14564 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14565 uses changed.
14566
14567 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14568
14569 * xfaces.c (Qframe_set_background_mode): Now static.
14570 * dispextern.h (Qframe_set_background_mode): Remove decl.
14571
14572 * process.c (Fnetwork_interface_info): Declare local only if needed.
14573
14574 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14575
14576 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14577 (Fnetwork_interface_list): Allocate in increments of bytes instead
14578 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14579 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14580 sockaddr.
14581 (struct ifflag_def): notrailers is smart on OSX.
14582 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14583 Get hardware address with getifaddrs if available.
14584
14585 2011-08-12 Eli Zaretskii <eliz@gnu.org>
14586
14587 * xdisp.c (iterate_out_of_display_property): xassert that
14588 IT->position is set to within IT->object's boundaries. Break from
14589 the loop as soon as EOB is reached; avoids infloops in redisplay
14590 when IT->position is set up wrongly due to some bug.
14591 Set IT->current to match the bidi iterator unconditionally.
14592 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14593 entry. Force push_it to save on the stack the current
14594 buffer/string position, to be restored by pop_it. Fix flags in
14595 the iterator structure wrt the object coming from a display
14596 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14597 properties. (Bug#9284)
14598
14599 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
14600
14601 * fontset.c (fontset_get_font_group): Add proper type checks.
14602 (Bug#9172)
14603
14604 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14605
14606 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14607 and LC_VERSION_MIN_MACOSX.
14608 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14609 (dump_it) [LC_FUNCTION_STARTS]: Use it.
14610
14611 2011-08-08 Eli Zaretskii <eliz@gnu.org>
14612
14613 * xdisp.c (forward_to_next_line_start): Allow to use the
14614 no-display-properties-and-no-overlays under bidi display.
14615 Set disp_pos in the bidi iterator to avoid searches for display
14616 properties and overlays.
14617
14618 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
14619
14620 * editfns.c (Fset_time_zone_rule): Document relationship with the
14621 setenv function.
14622
14623 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14624 the font entity extracted from the cache (Bug#8109).
14625
14626 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
14627
14628 * composite.c (autocmp_chars): Don't reset point. That is done by
14629 restore_point_unwind (Bug#5984).
14630
14631 2011-08-07 Juri Linkov <juri@jurta.org>
14632
14633 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14634 to show the arg `TIME' instead of `TIMEVAL'.
14635
14636 2011-08-06 Eli Zaretskii <eliz@gnu.org>
14637
14638 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14639 display property strides EOL and includes a newline, as in
14640 longlines-mode. (Bug#9254)
14641 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14642 word-wrap under bidirectional display. (Bug#9224)
14643
14644 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14645 is non-zero, even if the data buffer is NULL. Fixes a crash in
14646 vertical-motion with longlines-mode. (Bug#9254)
14647
14648 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14649
14650 * bidi.c <bidi_cache_total_alloc>: Now static.
14651 (bidi_initialize): Initialize bidi_cache_total_alloc.
14652
14653 * xdisp.c (display_line): Release buffer allocated for shelved bidi
14654 cache. (Bug#9221)
14655
14656 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14657 amount allocated this far in `bidi_cache_total_alloc'.
14658 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14659 non-zero, only free the data buffer without restoring the cache
14660 contents. All callers changed.
14661
14662 * dispextern.h (bidi_unshelve_cache): Update prototype.
14663
14664 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14665 (move_it_in_display_line, move_it_to)
14666 (move_it_vertically_backward, move_it_by_lines): Replace the call
14667 to xfree to an equivalent call to bidi_unshelve_cache.
14668 (move_it_in_display_line_to): Fix logic of returning
14669 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
14670
14671 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14672
14673 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14674 came from a string character with a `cursor' property. (Bug#9229)
14675
14676 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14677
14678 * Makefile.in (LIB_PTHREAD): New variable.
14679 (LIBES): Add LIB_PTHREAD (Bug#9216).
14680
14681 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14682 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14683
14684 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14685
14686 * regex.c (re_iswctype): Remove some redundant boolean conversions.
14687
14688 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14689
14690 * xterm.c (x_find_topmost_parent): New function.
14691 (x_set_frame_alpha): Find topmost parent window with
14692 x_find_topmost_parent and set the property there also (bug#9181).
14693 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14694
14695 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14696
14697 * callproc.c (Fcall_process): Avoid vfork clobbering
14698 the local vars buffer, coding_systems, current_dir.
14699
14700 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14701
14702 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14703
14704 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14705
14706 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14707 so that it is not optimized away.
14708
14709 * xdisp.c (compute_display_string_pos): Remove unused local.
14710
14711 2011-08-02 Eli Zaretskii <eliz@gnu.org>
14712
14713 Fix slow cursor motion and scrolling in large buffers with
14714 selective display, like Org Mode buffers. (Bug#9218)
14715
14716 * dispextern.h (struct bidi_it): New member disp_prop_p.
14717
14718 * xdisp.c: Remove one-slot cache of display string positions.
14719 (compute_display_string_pos): Accept an additional argument
14720 DISP_PROP_P; callers changed. Scan at most 5K characters forward
14721 for a display string or property. If found, set DISP_PROP_P
14722 non-zero.
14723
14724 * bidi.c (bidi_fetch_char): Accept an additional argument
14725 DISP_PROP_P, and pass it to compute_display_string_pos.
14726 Only handle text covered by a display string if DISP_PROP_P is returned
14727 non-zero. All callers of bidi_fetch_char changed.
14728
14729 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14730
14731 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14732
14733 2010-12-03 Don March <don@ohspite.net>
14734
14735 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14736 last character M-[char] is translated to ESC [char] (bug#7541).
14737
14738 2011-08-02 Kenichi Handa <handa@m17n.org>
14739
14740 * lisp.h (uniprop_table): Extern it.
14741
14742 * chartab.c (uniprop_table): Make it non-static.
14743
14744 2011-08-01 Eli Zaretskii <eliz@gnu.org>
14745
14746 * xdisp.c (forward_to_next_line_start): Accept additional argument
14747 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14748 on the newline.
14749 (reseat_at_next_visible_line_start): Use the bidi iterator state
14750 returned by forward_to_next_line_start to restore the state of
14751 it->bidi_it after backing up to previous newline. (Bug#9212)
14752
14753 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14754
14755 * regex.c (re_comp): Protoize.
14756 (re_exec): Fix return type.
14757 (regexec): Fix type of `ret'. (Bug#9203)
14758
14759 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14760
14761 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14762 This is needed if max-image-size is a floating-point number.
14763
14764 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14765
14766 * print.c (print_object): Print empty symbol as ##.
14767
14768 * lread.c (read1): Read ## as empty symbol.
14769
14770 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14771
14772 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14773 setting frame foreground color (Bug#9175).
14774 (x_set_background_color): Likewise.
14775
14776 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14777 contents (Bug#9176).
14778 (EmacsTooltip -init): Remove bezels and add shadows to
14779 tooltip windows.
14780
14781 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14782 or scroll bar (Bug#8470).
14783
14784 * nsfont.m (nsfont_open): Remove assignment to voffset and
14785 unnecessary vars hshink, expand, hd, full_height, min_height.
14786 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14787
14788 * nsterm.h (nsfont_info): Remove voffset field.
14789
14790 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14791
14792 Implement strike-through and overline on NextStep (Bug#8863).
14793
14794 * nsfont.m (nsfont_open): Use underline position provided by font,
14795 instead of hard-coded value of 2.
14796 (nsfont_draw): Call ns_draw_text_decoration instead.
14797
14798 * nsterm.h: Add declaration for ns_draw_text_decoration.
14799
14800 * nsterm.m (ns_draw_text_decoration): New function for drawing
14801 underline, overline, and strike-through.
14802 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14803 ns_draw_text_decoration. Change treatment of cursor drawing to
14804 accommodate underlining, etc.
14805
14806 2011-07-28 Eli Zaretskii <eliz@gnu.org>
14807
14808 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14809 default.
14810
14811 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14812
14813 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14814 Without this fix, if a signal arrives just after memory fills up,
14815 'malloc' might be invoked reentrantly.
14816
14817 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14818 In other words, assume that every image size is allowed, on non-X
14819 hosts. This assumption is probably wrong, but it lets Emacs compile.
14820
14821 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14822
14823 * regex.c (re_iswctype): Convert return values to boolean.
14824
14825 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14826
14827 * xdisp.c (compute_display_string_pos): Don't use cached display
14828 string position if the buffer had its restriction changed.
14829 (Bug#9184)
14830
14831 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14832
14833 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14834
14835 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14836
14837 Integer signedness and overflow and related fixes. (Bug#9079)
14838
14839 * bidi.c: Integer size and overflow fixes.
14840 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14841 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14842 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14843 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14844 (bidi_find_other_level_edge):
14845 Use ptrdiff_t instead of EMACS_INT where either will do.
14846 This works better on 32-bit hosts configured --with-wide-int.
14847 (bidi_cache_ensure_space): Check for size-calculation overflow.
14848 Use % rather than repeated addition, for better worst-case speed.
14849 Don't set bidi_cache_size until after xrealloc returns, because it
14850 might not return.
14851 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14852 (bidi_cache_ensure_space): Also check that the bidi cache size
14853 does not exceed that of the largest Lisp string or buffer. See Eli
14854 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14855
14856 * alloc.c (__malloc_size_t): Remove.
14857 All uses replaced by size_t. See Andreas Schwab's note
14858 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14859
14860 * image.c: Improve checking for integer overflow.
14861 (check_image_size): Assume that f is nonnull, since
14862 it is always nonnull in practice. This is one less thing to
14863 worry about when checking for integer overflow later.
14864 (x_check_image_size): New function, which checks for integer
14865 overflow issues inside X.
14866 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14867 This removes the need for a memory_full check.
14868 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14869 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14870 (xbm_read_bitmap_data): Change locals back to 'int', since
14871 their values must fit in 'int'.
14872 (xpm_load_image, png_load, tiff_load):
14873 Invoke x_create_x_image_and_pixmap earlier,
14874 to avoid much needless work if the image is too large.
14875 (tiff_load): Treat overly large images as if
14876 x_create_x_image_and_pixmap failed, not as malloc failures.
14877 (gs_load): Use x_check_image_size.
14878
14879 * gtkutil.c: Omit integer casts.
14880 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14881 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14882
14883 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14884
14885 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14886 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14887 would wrongly return t on a 64-bit host.
14888
14889 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14890 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14891 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14892 and therefore cause GCC to emit a bogus diagnostic in some cases.
14893
14894 * image.c: Integer signedness and overflow and related fixes.
14895 This is not an exhaustive set of fixes, but it's time to
14896 record what I've got.
14897 (lookup_pixel_color, check_image_size): Remove redundant decls.
14898 (check_image_size): Don't assume that arbitrary EMACS_INT values
14899 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14900 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14901 (tiff_load, imagemagick_load_image):
14902 Check for overflow in size calculations.
14903 (x_create_x_image_and_pixmap): Remove unnecessary test for
14904 xmalloc returning NULL; that can't happen.
14905 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14906 (xpm_color_bucket): Use better integer hashing function.
14907 (xpm_cache_color): Don't possibly over-allocate memory.
14908 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14909 (gif_memory_source):
14910 Use ptrdiff_t, not int or size_t, to record sizes.
14911 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14912 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14913 either works, as we prefer signed integers.
14914 (tiff_read_from_memory, tiff_write_from_memory):
14915 Return tsize_t, not size_t, since that's what the TIFF API wants.
14916 (tiff_read_from_memory): Don't fail simply because the read would
14917 go past EOF; instead, return a short read.
14918 (tiff_load): Omit no-longer-needed casts.
14919 (Fimagemagick_types): Don't assume size fits into 'int'.
14920
14921 Improve hashing quality when configured --with-wide-int.
14922 * fns.c (hash_string): New function, taken from sxhash_string.
14923 Do not discard information about ASCII character case; this
14924 discarding is no longer needed.
14925 (sxhash-string): Use it. Change sig to match it. Caller changed.
14926 * lisp.h: Declare it.
14927 * lread.c (hash_string): Remove, since we now use fns.c's version.
14928 The fns.c version returns a wider integer if --with-wide-int is
14929 specified, so this should help the quality of the hashing a bit.
14930
14931 * emacs.c: Integer overflow minor fix.
14932 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14933 Define only if GNU_LINUX.
14934 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14935
14936 * dispnew.c: Integer signedness and overflow fixes.
14937 Remove unnecessary forward decls, that were a maintenance hassle.
14938 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14939 All uses changed.
14940 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14941 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14942 (prepare_desired_row, line_draw_cost):
14943 Use int, not unsigned, where either works.
14944 (save_current_matrix, restore_current_matrix):
14945 Use ptrdiff_t, not size_t, where either works.
14946 (init_display): Check for overflow more accurately, and without
14947 relying on undefined behavior.
14948
14949 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14950 Remove, replacing with the new symbols in lisp.h. All uses changed.
14951 * fileio.c (make_temp_name):
14952 * filelock.c (lock_file_1, lock_file):
14953 * xdisp.c (message_dolog):
14954 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14955 Use pMd etc. instead.
14956 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14957 replacing the pWIDE etc. symbols removed from editfns.c.
14958
14959 * keyboard.h (num_input_events): Now uintmax_t.
14960 This is (very slightly) less likely to mess up due to wraparound.
14961 All uses changed.
14962
14963 * buffer.c: Integer signedness fixes.
14964 (alloc_buffer_text, enlarge_buffer_text):
14965 Use ptrdiff_t rather than size_t when either will do, as we prefer
14966 signed integers.
14967
14968 * alloc.c: Integer signedness and overflow fixes.
14969 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14970 (__malloc_size_t): Default to size_t, not to int.
14971 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14972 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14973 Prefer ptrdiff_t to size_t when either would do, as we prefer
14974 signed integers.
14975 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14976 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14977 Now const. Initialize with values that are in range even if char
14978 is signed.
14979 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14980 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14981 These functions do the right thing with sizes > 2**32.
14982 (check_depth): Now ptrdiff_t, not int.
14983 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14984 Adjust to new way of storing sizes. Check for size overflow bugs
14985 in rest of code.
14986 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14987 slightly wrong anyway, as it missed one instance of
14988 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14989 (refill_memory_reserve): Omit needless cast to size_t.
14990 (mark_object_loop_halt): Mark as externally visible.
14991
14992 * xselect.c: Integer signedness and overflow fixes.
14993 (Fx_register_dnd_atom, x_handle_dnd_message):
14994 Use ptrdiff_t, not size_t, since we prefer signed.
14995 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14996 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14997 x_dnd_atoms_size and x_dnd_atoms_length.
14998
14999 * doprnt.c: Prefer signed to unsigned when either works.
15000 * eval.c (verror):
15001 * doprnt.c (doprnt):
15002 * lisp.h (doprnt):
15003 * xdisp.c (vmessage):
15004 Use ptrdiff_t, not size_t, when using or implementing doprnt,
15005 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
15006 prefer signed arithmetic to avoid comparison confusion.
15007 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
15008 but is a bit tricky.
15009
15010 Assume freestanding C89 headers, string.h, stdlib.h.
15011 * data.c, doprnt.c, floatfns.c, print.c:
15012 Include float.h unconditionally.
15013 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
15014 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
15015 * regex.c: Likewise for stddef.h, string.h.
15016 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
15017 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
15018 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
15019 (STDC_HEADERS): Remove obsolete defines.
15020 * sysdep.c: Include limits.h unconditionally.
15021
15022 Assume support for memcmp, memcpy, memmove, memset.
15023 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
15024 * regex.c (memcmp, memcpy):
15025 Remove; we assume C89 now.
15026
15027 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
15028 (__malloc_safe_bcopy): Remove; no longer needed.
15029
15030 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
15031 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
15032 well either way, and we prefer signed to unsigned.
15033
15034 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
15035
15036 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
15037 closes the connection while we're reading (bug#9182).
15038
15039 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
15040
15041 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
15042 are specified (Bug#9168).
15043
15044 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
15045
15046 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
15047 Found by GCC static checking and --with-wide-int on a 32-bit host.
15048
15049 2011-07-25 Eli Zaretskii <eliz@gnu.org>
15050
15051 * xdisp.c (compute_display_string_pos): Fix logic of caching
15052 previous display string position. Initialize cached_prev_pos to
15053 -1. Fixes slow-down at the beginning of a buffer.
15054
15055 2011-07-24 Eli Zaretskii <eliz@gnu.org>
15056
15057 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
15058 for attrs[LFACE_FONTSET_INDEX].
15059
15060 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
15061
15062 * xml.c (parse_region): Remove unused local
15063 that was recently introduced.
15064
15065 2011-07-23 Eli Zaretskii <eliz@gnu.org>
15066
15067 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
15068 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
15069
15070 * xdisp.c (move_it_in_display_line_to): Record the best matching
15071 position for TO_CHARPOS while scanning the line, and restore it on
15072 exit if none of the characters scanned was an exact match.
15073 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
15074 when exact match is impossible due to invisible text, and the
15075 lines are truncated.
15076
15077 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
15078
15079 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
15080 for OSX >= 10.7.
15081
15082 2011-07-22 Eli Zaretskii <eliz@gnu.org>
15083
15084 Fix a significant slow-down of cursor motion with C-n, C-p,
15085 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
15086 auto-repeat under bidi redisplay in fontified buffers.
15087 * xdisp.c (compute_stop_pos_backwards): New function.
15088 (next_element_from_buffer): Call compute_stop_pos_backwards to
15089 find a suitable prev_stop when we find ourselves before
15090 base_level_stop.
15091 (reseat): Don't look for prev_stop, as that could mean a very long
15092 run.
15093 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
15094 <cached_disp_overlay_modiff>: Cache for last found display string
15095 position.
15096 (compute_display_string_pos): Return the cached position if asked
15097 about the same buffer in the same area of character positions, and
15098 the buffer wasn't changed since the time the display string
15099 position was cached.
15100
15101 2011-07-22 Eli Zaretskii <eliz@gnu.org>
15102
15103 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
15104 is an integer, which is important for empty lines. (Bug#9149)
15105
15106 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
15107
15108 * frame.c (Fmodify_frame_parameters): In tty case, update the
15109 default face if necessary (Bug#4238).
15110
15111 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
15112
15113 * editfns.c (Fstring_to_char): No need to explain what a character
15114 is in the docstring (Bug#6576).
15115
15116 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15117
15118 * xml.c (parse_region): Make sure we always return a tree.
15119
15120 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
15121
15122 * xml.c (parse_region): If a document contains only comments,
15123 return that, too.
15124
15125 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15126
15127 * xml.c (make_dom): Return comments, too.
15128
15129 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
15130
15131 Port to OpenBSD.
15132 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
15133 and the surrounding thread.
15134 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
15135 rather than fgets, and retry after EINTR. Otherwise, 'emacs
15136 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
15137 timer goes off.
15138 * s/openbsd.h (BROKEN_SIGIO): Define.
15139 * unexelf.c (unexec) [__OpenBSD__]:
15140 Don't update the .mdebug section of the Alpha COFF symbol table.
15141
15142 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15143
15144 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
15145 (bug#8460).
15146
15147 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
15148
15149 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
15150 This fixes some race conditions on the permissions of any newly
15151 created file.
15152
15153 * alloc.c (valid_pointer_p): Use pipe, not open.
15154 This fixes some permissions issues when debugging.
15155
15156 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
15157 If fchown fails to set both uid and gid, try to set just gid,
15158 as that is sometimes allowed. Adjust the file's mode to eliminate
15159 setuid or setgid bits that are inappropriate if fchown fails.
15160
15161 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
15162
15163 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
15164 to compare Lisp_Objects.
15165 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
15166 global_gnutls_log_level, don't mistake it for a Lisp_Object.
15167 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
15168
15169 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
15170
15171 * lread.c (read_integer): Unread even EOF character.
15172 (read1): Likewise. Properly record start position of symbol.
15173
15174 * lread.c (read1): Read `#:' as empty uninterned symbol if no
15175 symbol character follows.
15176
15177 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
15178
15179 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
15180 This works around a problem with the previous change to Fcopy_file.
15181 Recent glibc declares fchown with __attribute__((warn_unused_result)),
15182 and without this change, GCC might complain about discarding
15183 fchown's return value.
15184
15185 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
15186
15187 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
15188
15189 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
15190
15191 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
15192
15193 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
15194
15195 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
15196 it's used from the C level.
15197
15198 * process.c: Use the same condition for POLL_FOR_INPUT in both
15199 keyboard.c and process.c (bug#1858).
15200
15201 2011-07-09 Lawrence Mitchell <wence@gmx.li>
15202
15203 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
15204 (Fgnutls_boot): Use it.
15205
15206 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
15207
15208 * doc.c (Fsubstitute_command_keys): Revert last change.
15209
15210 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
15211
15212 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
15213 quotes the next character, and doesn't affect other longer
15214 sequences (bug#8935).
15215
15216 * lread.c (syms_of_lread): Clarify that is isn't only
15217 `eval-buffer' and `eval-defun' that's affected by
15218 `lexical-binding' (bug#8460).
15219
15220 2011-07-15 Eli Zaretskii <eliz@gnu.org>
15221
15222 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
15223 bidi redisplay when a line includes both an image and is truncated.
15224
15225 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
15226
15227 Fix minor problems found by static checking.
15228 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
15229 (elsz): Now a signed constant, not a size_t var. We prefer signed
15230 types to unsigned, to avoid integer comparison confusion. Without
15231 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
15232 "cannot optimize loop, the loop counter may overflow", a symptom
15233 of the confusion.
15234 * indent.c (Fvertical_motion): Mark locals as initialized.
15235 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
15236
15237 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15238
15239 * search.c (Fre_search_backward): Mention `case-fold-search' in
15240 all the re_search_* functions (bug#8138).
15241
15242 * keyboard.c (Fopen_dribble_file): Document when the file is
15243 closed (bug#8056).
15244
15245 2011-07-14 Eli Zaretskii <eliz@gnu.org>
15246
15247 * bidi.c (bidi_dump_cached_states): Fix format of displaying
15248 bidi_cache_idx.
15249
15250 Support bidi reordering of display and overlay strings.
15251 * xdisp.c (compute_display_string_pos)
15252 (compute_display_string_end): Accept additional argument STRING.
15253 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
15254 (reseat_to_string): Initialize bidi_it->string.s and
15255 bidi_it->string.schars.
15256 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
15257 NULL (avoids a crash in bidi_paragraph_init).
15258 Initialize itb.string.lstring.
15259 (init_iterator): Call bidi_init_it only of a valid
15260 buffer position was specified. Initialize paragraph_embedding to
15261 L2R.
15262 (reseat_to_string): Initialize the bidi iterator.
15263 (display_string): If we need to ignore text properties of
15264 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
15265 original value of -1 will not work with bidi.)
15266 (compute_display_string_pos): First arg is now struct
15267 `text_pos *'; all callers changed. Support display properties on
15268 Lisp strings.
15269 (compute_display_string_end): Support display properties on Lisp
15270 strings.
15271 (init_iterator, reseat_1, reseat_to_string): Initialize the
15272 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
15273 when iterating on a string not from display properties).
15274 (compute_display_string_pos, compute_display_string_end):
15275 Fix calculation of the object to scan. Fixes an error when using
15276 arrow keys.
15277 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
15278 base_level_stop; instead, set base_level_stop to BEGV.
15279 Fixes crashes in vertical-motion.
15280 (next_element_from_buffer): Improve commentary for when
15281 the iterator is before prev_stop.
15282 (init_iterator): Initialize bidi_p from the default value of
15283 bidi-display-reordering, not from buffer-local value. Use the
15284 buffer-local value only if initializing for buffer iteration.
15285 (handle_invisible_prop): Support invisible properties on strings
15286 that are being bidi-reordered.
15287 (set_iterator_to_next): Support bidi reordering of C strings and
15288 Lisp strings.
15289 (next_element_from_string): Support bidi reordering of Lisp
15290 strings.
15291 (handle_stop_backwards): Support Lisp strings as well.
15292 (display_string): Support display of R2L glyph rows.
15293 Use IT_STRING_CHARPOS when displaying from a Lisp string.
15294 (init_iterator): Don't initialize it->bidi_p for strings
15295 here.
15296 (reseat_to_string): Initialize it->bidi_p for strings here.
15297 (next_element_from_string, next_element_from_c_string)
15298 (next_element_from_buffer): Add xassert's for correspondence
15299 between IT's object being iterated and it->bidi_it.string
15300 structure.
15301 (face_before_or_after_it_pos): Support bidi iteration.
15302 (next_element_from_c_string): Handle the case of the first string
15303 character that is not the first one in the visual order.
15304 (get_visually_first_element): New function, refactored from common
15305 parts of next_element_from_buffer, next_element_from_string, and
15306 next_element_from_c_string.
15307 (tool_bar_lines_needed, redisplay_tool_bar)
15308 (display_menu_bar): Force left-to-right direction. Add a FIXME
15309 comment for making that be controlled by a user option.
15310 (push_it, pop_it): Save and restore the state of the
15311 bidi iterator. Save and restore the bidi_p flag.
15312 (pop_it): Iterate out of display property for string iteration as
15313 well.
15314 (iterate_out_of_display_property): Support iteration over strings.
15315 (handle_single_display_spec): Set up it->bidi_it for iteration
15316 over a display string, and call bidi_init_it.
15317 (handle_single_display_spec, next_overlay_string)
15318 (get_overlay_strings_1, push_display_prop): Set up the bidi
15319 iterator for displaying display or overlay strings.
15320 (forward_to_next_line_start): Don't use the shortcut if
15321 bidi-iterating.
15322 (back_to_previous_visible_line_start): If handle_display_prop
15323 pushed the iterator stack, restore the internal state of the bidi
15324 iterator by calling bidi_pop_it same number of times.
15325 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
15326 and we are bidi-iterating, don't decrement the iterator position;
15327 instead, set the first_elt flag in the bidi iterator, to produce
15328 the same effect.
15329 (reseat_1): Remove redundant setting of string_from_display_prop_p.
15330 (push_display_prop): xassert that we are iterating a buffer.
15331 (push_it, pop_it): Save and restore paragraph_embedding member.
15332 (handle_single_display_spec, next_overlay_string)
15333 (get_overlay_strings_1, reseat_1, reseat_to_string)
15334 (push_display_prop): Set up the `unibyte' member of bidi_it.string
15335 correctly. Don't assume unibyte strings are not bidi-reordered.
15336 (compute_display_string_pos)
15337 (compute_display_string_end): Fix handling the case of C string.
15338 (push_it, pop_it): Save and restore from_disp_prop_p.
15339 (handle_single_display_spec, push_display_prop): Set the
15340 from_disp_prop_p flag.
15341 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
15342 (pop_it): Call iterate_out_of_display_property only if we are
15343 popping after iteration over a string that came from a display
15344 property. Fix a typo in popping stretch info. Add an assertion
15345 for verifying that the iterator position is in sync with the bidi
15346 iterator.
15347 (handle_single_display_spec, get_overlay_strings_1)
15348 (push_display_prop): Fix initialization of paragraph direction for
15349 string when that of the parent object is not yet determined.
15350 (reseat_1): Call bidi_init_it to resync the bidi
15351 iterator with IT's position. (Bug#7616)
15352 (find_row_edges): If ROW->start.pos gives position
15353 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
15354 (handle_stop, back_to_previous_visible_line_start, reseat_1):
15355 Reset the from_disp_prop_p flag.
15356 (SAVE_IT, RESTORE_IT): New macros.
15357 (pos_visible_p, face_before_or_after_it_pos)
15358 (back_to_previous_visible_line_start)
15359 (move_it_in_display_line_to, move_it_in_display_line)
15360 (move_it_to, move_it_vertically_backward, move_it_by_lines)
15361 (try_scrolling, redisplay_window, display_line): Use them when
15362 saving a temporary copy of the iterator and restoring it back.
15363 (back_to_previous_visible_line_start, reseat_1)
15364 (init_iterator): Empty the bidi cache "stack".
15365 (move_it_in_display_line_to): If iterator ended up at
15366 EOL, but we never saw any buffer positions smaller than
15367 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
15368 motion in bidi-reordered lines.
15369 (move_it_in_display_line_to): Record prev_method and prev_pos
15370 immediately before the call to set_iterator_to_next. Fixes cursor
15371 motion in bidi-reordered lines with stretch glyphs and strings
15372 displayed in margins. (Bug#8133) (Bug#8867)
15373 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
15374 TO_CHARPOS.
15375 (pos_visible_p): Support positions in bidi-reordered lines.
15376 Save and restore bidi cache.
15377
15378 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
15379 (bidi_paragraph_info): Delete unused struct.
15380 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
15381 (bidi_cache_start): New variable.
15382 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
15383 to zero.
15384 (bidi_cache_fetch_state, bidi_cache_search)
15385 (bidi_cache_find_level_change, bidi_cache_iterator_state)
15386 (bidi_cache_find, bidi_peek_at_next_level)
15387 (bidi_level_of_next_char, bidi_find_other_level_edge)
15388 (bidi_move_to_visually_next): Compare cache index with
15389 bidi_cache_start rather than with zero.
15390 (bidi_fetch_char): Accept new argument STRING; all callers
15391 changed. Support iteration over a string. Support strings with
15392 display properties. Support unibyte strings. Fix the type of
15393 `len' according to what STRING_CHAR_AND_LENGTH expects.
15394 (bidi_paragraph_init, bidi_resolve_explicit_1)
15395 (bidi_resolve_explicit, bidi_resolve_weak)
15396 (bidi_level_of_next_char, bidi_move_to_visually_next):
15397 Support iteration over a string.
15398 (bidi_set_sor_type, bidi_resolve_explicit_1)
15399 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
15400 can now be zero (for strings); special values 0 and -1 were
15401 changed to -1 and -2, respectively.
15402 (bidi_char_at_pos): New function.
15403 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
15404 Call it instead of FETCH_MULTIBYTE_CHAR.
15405 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
15406 initialized to valid values.
15407 (bidi_init_it): Don't initialize charpos and bytepos with invalid
15408 values.
15409 (bidi_level_of_next_char): Allow the sentinel "position" to pass
15410 the test for valid cached positions. Fix the logic for looking up
15411 the sentinel state in the cache. GCPRO the Lisp string we are
15412 iterating.
15413 (bidi_push_it, bidi_pop_it): New functions.
15414 (bidi_initialize): Initialize the bidi cache start stack pointer.
15415 (bidi_cache_ensure_space): New function, refactored from part of
15416 bidi_cache_iterator_state. Don't assume the required size is just
15417 one BIDI_CACHE_CHUNK away.
15418 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
15419 (bidi_count_bytes, bidi_char_at_pos): New functions.
15420 (bidi_cache_search): Don't assume bidi_cache_last_idx is
15421 always valid if bidi_cache_idx is valid.
15422 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
15423 is valid if it's going to be used.
15424 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
15425 (bidi_cache_fetch_state, bidi_cache_search)
15426 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15427 (bidi_cache_iterator_state, bidi_cache_find)
15428 (bidi_find_other_level_edge, bidi_cache_start_stack):
15429 All variables related to cache indices are now EMACS_INT.
15430
15431 * dispextern.h (struct bidi_string_data): New structure.
15432 (struct bidi_it): New member `string'. Make flag members be 1-bit
15433 fields, and put them last in the struct.
15434 (compute_display_string_pos, compute_display_string_end):
15435 Update prototypes.
15436 (bidi_push_it, bidi_pop_it): Add prototypes.
15437 (struct iterator_stack_entry): New members bidi_p,
15438 paragraph_embedding, and from_disp_prop_p.
15439 (struct it): Member bidi_p is now a bit field 1 bit wide.
15440 (bidi_shelve_cache, bidi_unshelve_cache):
15441 Declare prototypes.
15442
15443 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15444 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15445 and vector-like objects.
15446
15447 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15448 cache around display iteration.
15449
15450 * window.c (Fwindow_end, window_scroll_pixel_based)
15451 (displayed_window_lines, Frecenter): Save and restore the bidi
15452 cache around display iteration.
15453
15454 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15455
15456 * editfns.c (Fdelete_region): Clarify the use of the named
15457 parameters (bug#6788).
15458
15459 2011-07-14 Martin Rudalics <rudalics@gmx.at>
15460
15461 * indent.c (Fvertical_motion): Set and restore w->pointm when
15462 saving and restoring the window's buffer (Bug#9006).
15463
15464 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15465
15466 * editfns.c (Fstring_to_char): Clarify just what is returned
15467 (bug#6576). Text by Eli Zaretskii.
15468
15469 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
15470
15471 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15472
15473 2011-07-13 Eli Zaretskii <eliz@gnu.org>
15474
15475 * buffer.c (mmap_find): Fix a typo.
15476
15477 2011-07-13 Johan Bockgård <bojohan@gnu.org>
15478
15479 Fix execution of x selection hooks.
15480 * xselect.c (Qx_lost_selection_functions)
15481 (Qx_sent_selection_functions): New vars.
15482 (syms_of_xselect): DEFSYM them.
15483 (x_handle_selection_request): Pass Qx_sent_selection_functions
15484 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15485 (x_handle_selection_clear,x_clear_frame_selections):
15486 Pass Qx_lost_selection_functions rather than
15487 Vx_lost_selection_functions to Frun_hook_with_args.
15488
15489 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15490
15491 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
15492 The old code sometimes used this field without initializing it.
15493
15494 * alloc.c (gc_sweep): Don't read past end of array.
15495 In theory, the old code could also have corrupted Emacs internals,
15496 though it'd be very unlikely.
15497
15498 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15499
15500 * character.c (Fcharacterp): Don't advertise optional ignored
15501 argument. (Bug#4026)
15502
15503 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15504
15505 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15506 key" (bug#4257).
15507
15508 * window.c (Fset_window_start): Doc fix (bug#4199).
15509 (Fset_window_hscroll): Ditto.
15510
15511 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15512
15513 Fix minor new problems caught by GCC 4.6.1.
15514 * term.c (init_tty): Remove unused local.
15515 * xsettings.c (store_monospaced_changed): Define this function only
15516 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
15517 not used otherwise.
15518
15519 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
15520
15521 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15522
15523 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15524
15525 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15526 are the mini-buffer and the echo area (bug#3320).
15527
15528 * term.c (init_tty): Remove support for supdup, c10 and perq
15529 terminals, which are no longer supported (bug#1482).
15530
15531 2011-07-10 Johan Bockgård <bojohan@gnu.org>
15532
15533 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15534
15535 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15536
15537 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15538 for non-popups (Bug#3642).
15539
15540 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15541
15542 * alloc.c (reset_malloc_hooks): Protoize.
15543 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
15544 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15545 * cm.c (losecursor): Likewise.
15546 * data.c (fmod): Likewise.
15547 * dispnew.c (swap_glyphs_in_rows): Likewise.
15548 * emacs.c (memory_warning_signal): Likewise.
15549 * floatfns.c (float_error): Likewise.
15550 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15551 (otf_open, font_otf_capability, generate_otf_features)
15552 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15553 Likewise.
15554 * image.c (pbm_read_file): Likewise.
15555 * indent.c (string_display_width): Likewise.
15556 * intervals.c (check_for_interval, search_for_interval)
15557 (inc_interval_count, count_intervals, root_interval)
15558 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15559 * lread.c (defalias): Likewise.
15560 * ralloc.c (r_alloc_check): Likewise.
15561 * regex.c (set_image_of_range_1, set_image_of_range)
15562 (regex_grow_registers): Likewise.
15563 * sysdep.c (strerror): Likewise.
15564 * termcap.c (valid_filename_p, tprint, main): Likewise.
15565 * tparam.c (main): Likewise.
15566 * unexhp9k800.c (run_time_remap, save_data_space)
15567 (update_file_ptrs, read_header, write_header, calculate_checksum)
15568 (copy_file, copy_rest, display_header): Likewise.
15569 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15570 Likewise.
15571 * xdisp.c (check_it): Likewise.
15572 * xfaces.c (register_color, unregister_color, unregister_colors):
15573 Likewise.
15574 * xfns.c (print_fontset_result): Likewise.
15575 * xrdb.c (member, fatal, main): Likewise.
15576
15577 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15578
15579 Fix minor problems found by static checking (Bug#9031).
15580 * chartab.c (char_table_set_range, map_sub_char_table):
15581 Remove unused locals.
15582 (uniprop_table): Now static.
15583 * composite.c (_work_char): Remove unused static var.
15584
15585 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
15586
15587 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15588
15589 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15590
15591 * gtkutil.c (qttip_cb): Remove code without function.
15592
15593 2011-07-09 Eli Zaretskii <eliz@gnu.org>
15594
15595 * w32.c (pthread_sigmask): New stub.
15596
15597 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
15598
15599 Use pthread_sigmask, not sigprocmask (Bug#9010).
15600 sigprocmask is portable only for single-threaded applications, and
15601 Emacs can be multi-threaded when it uses GTK.
15602 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15603 (LIBES): Use it.
15604 * callproc.c (Fcall_process):
15605 * process.c (create_process):
15606 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15607 Use pthread_sigmask, not sigprocmask.
15608
15609 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15610
15611 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15612 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15613 wrong (Bug#8591).
15614
15615 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15616
15617 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15618 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15619 (xg_hide_tooltip): Fix comment.
15620
15621 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15622 in registerServicesMenuSendTypes.
15623 (validRequestorForSendType): Don't check ns_return_types.
15624
15625 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15626 ns_return_type.
15627
15628 2011-07-08 Jason Rumney <jasonr@gnu.org>
15629
15630 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15631 SH_SHOW for hidden windows (Bug#5482).
15632
15633 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15634 frame struct members of non-existent frames (Bug#6284).
15635
15636 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15637
15638 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15639 variable firstTime not needed on OSX >= 10.6.
15640 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15641 >= 10.5. Use setKnobProportion, setDoubleValue.
15642
15643 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15644 (MAC_OS_X_VERSION_10_5): Define if not defined.
15645 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15646 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15647 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15648
15649 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
15650 cString and lossyCString on OSX >= 10.4.
15651
15652 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
15653 sizeToFit on OSX >= 10.2.
15654
15655 * nsimage.m (allocInitFromFile): Don't use deprecated method
15656 bestRepresentationForDevice on OSX >= 10.6.
15657
15658 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15659 to avoid warning.
15660
15661 * emacs.c: Declare unexec_init_emacs_zone.
15662
15663 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15664
15665 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15666
15667 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15668 on svcsMenu (Bug#8842).
15669
15670 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15671 ns_return_types.
15672 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15673
15674 * nsterm.m (QUTF8_STRING): Declare.
15675 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15676 (validRequestorForSendType): Return type is (id).
15677 Change indexOfObjectIdenticalTo to indexOfObject.
15678 Check if we have local selection before returning self (Bug#8842).
15679 (writeSelectionToPasteboard): Put local selection into paste board
15680 if we have a local selection (Bug#8842).
15681 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15682
15683 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15684 (ns_get_local_selection): Declare.
15685
15686 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15687
15688 * keymap.c (describe_map_tree): Don't insert a double newline at
15689 the end of the buffer (bug#1169) and return whether we inserted
15690 something.
15691
15692 * callint.c (Fcall_interactively): Change "reading args" to
15693 "providing args" to try to clarify what it does (bug#1010).
15694
15695 2011-07-07 Kenichi Handa <handa@m17n.org>
15696
15697 * composite.c (composition_compute_stop_pos): Ignore a static
15698 composition starting before CHARPOS (Bug#8915).
15699
15700 * xdisp.c (handle_composition_prop): Likewise.
15701
15702 2011-07-07 Eli Zaretskii <eliz@gnu.org>
15703
15704 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15705 (Bug#9015)
15706
15707 2011-07-07 Kenichi Handa <handa@m17n.org>
15708
15709 * character.h (unicode_category_t): New enum type.
15710
15711 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15712 (Qchar_code_property_table): New variable.
15713 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15714 (UNIPROP_COMPRESSED_FORM_P): New macros.
15715 (char_table_ascii): Uncompress the compressed values.
15716 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15717 Uncompress the compressed values.
15718 (sub_char_table_ref_and_range): Likewise.
15719 (char_table_ref_and_range): Uncompress the compressed values.
15720 (sub_char_table_set): New arg is_uniprop. Callers changed.
15721 Uncompress the compressed values.
15722 (sub_char_table_set_range): Args changed. Callers changed.
15723 (char_table_set_range): Adjuted for the above change.
15724 (map_sub_char_table): Delete args default_val and parent. Add arg
15725 top. Give decoded values to a Lisp function.
15726 (map_char_table): Adjust for the above change. Give decoded
15727 values to a Lisp function. Gcpro more variables.
15728 (uniprop_table_uncompress)
15729 (uniprop_decode_value_run_length): New functions.
15730 (uniprop_decoder, uniprop_decoder_count): New variables.
15731 (uniprop_get_decoder, uniprop_encode_value_character)
15732 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15733 New functions.
15734 (uniprop_encoder, uniprop_encoder_count): New variables.
15735 (uniprop_get_encoder, uniprop_table)
15736 (Funicode_property_table_internal, Fget_unicode_property_internal)
15737 (Fput_unicode_property_internal): New functions.
15738 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15739 Sunicode_property_table_internal, Sget_unicode_property_internal,
15740 and Sput_unicode_property_internal. Defvar_lisp
15741 char-code-property-alist.
15742
15743 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15744 Vunicode_category_table.
15745
15746 * font.c (font_range): Adjust for the change of
15747 Vunicode_category_table.
15748
15749 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15750
15751 * m/iris4d.h: Remove file, move contents ...
15752 * s/irix6-5.h: ... here.
15753
15754 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15755
15756 Remove unportable assumption about struct layout (Bug#8884).
15757 * alloc.c (mark_buffer):
15758 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15759 (clone_per_buffer_values): Don't assume that
15760 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15761 This isn't true in general, and it's particularly not true
15762 if Emacs is configured with --with-wide-int.
15763 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15764 New macros, used in the buffer.c change.
15765
15766 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15767
15768 * xsettings.c: Use both GConf and GSettings if both are available.
15769 (store_config_changed_event): Add comment.
15770 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15771 (store_tool_bar_style_changed): New functions.
15772 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
15773 (struct xsettings): Move font inside HAVE_XFT.
15774 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15775 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15776 Move inside HAVE_XFT.
15777 (something_changed_gsettingsCB): Rename from something_changedCB.
15778 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15779 also.
15780 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15781 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
15782 (something_changed_gconfCB): Rename from something_changedCB.
15783 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15784 (parse_settings): Move check for font inside HAVE_XFT.
15785 (read_settings, apply_xft_settings): Add comment.
15786 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15787 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15788 call store_font_name_changed.
15789 (xft_settings_event): Add comment.
15790 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15791 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15792 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15793 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15794 (xsettings_initialize): Call init_gsettings last.
15795 (xsettings_get_system_font, xsettings_get_system_normal_font):
15796 Add comment.
15797
15798 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15799
15800 Random fixes. E.g., (random) never returned negative values.
15801 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15802 subseconds part to the entropy, as that's a bit more random.
15803 Prefer signed to unsigned, since the signedness doesn't matter and
15804 in general we prefer signed. When given a limit, use a
15805 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15806 latter isn't right if USE_2_TAGS_FOR_INTS.
15807 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15808 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15809
15810 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15811
15812 * textprop.c (text_property_stickiness):
15813 Obey Vtext_property_default_nonsticky.
15814 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15815 * w32fns.c (syms_of_w32fns):
15816 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15817
15818 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15819
15820 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15821 This is more efficient than Ffile_directory_p and avoids a minor race.
15822
15823 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15824
15825 * buffer.c (Foverlay_put): Say what the return value is
15826 (bug#7835).
15827
15828 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15829 is a directory before asking whether to use the file name
15830 (bug#7564).
15831 (barf_or_query_if_file_exists): Make the "File is a directory"
15832 error be more correct.
15833
15834 * fns.c (Frequire): Remove the mention of the .gz files, since
15835 that's installation-specific, but keep the mention of
15836 `get-load-suffixes'.
15837
15838 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15839
15840 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15841 Report string overflow if the output is too long.
15842
15843 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15844
15845 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15846 (syms_of_gnutls): Remove duplicate DEFSYM for
15847 Qgnutls_bootprop_verify_hostname_error, an error for
15848 Qgnutls_bootprop_verify_error (which is no longer used).
15849
15850 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15851 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15852 Also (re)move comments that are misplaced or no longer relevant.
15853
15854 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15855
15856 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15857
15858 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15859
15860 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15861 and background color parameters if they have been changed.
15862
15863 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15864
15865 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15866
15867 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15868
15869 * xsettings.c (SYSTEM_FONT): Define only when used.
15870 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15871
15872 * keymap.c (access_keymap_1): Now static.
15873
15874 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15875
15876 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15877 leave any prefix arg for the up event (Bug#1586).
15878
15879 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15880
15881 * lread.c (syms_of_lread): Mention single symbols defined by
15882 `defvar' or `defconst' (bug#7154).
15883
15884 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15885 (Frequire): Mention get-load-suffixes.
15886
15887 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15888
15889 * window.h (window): Remove clone_number slot.
15890 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15891 Remove.
15892 (make_parent_window, make_window, saved_window)
15893 (Fset_window_configuration, save_window_save): Don't deal with
15894 clone numbers.
15895 * buffer.c (Qclone_number): Remove declaration.
15896 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15897
15898 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15899
15900 Add multiple inheritance to keymaps.
15901 * keymap.c (Fmake_composed_keymap): New function.
15902 (Fset_keymap_parent): Simplify.
15903 (fix_submap_inheritance): Remove.
15904 (access_keymap_1): New function extracted from access_keymap to handle
15905 embedded parents and handle lists of maps.
15906 (access_keymap): Use it.
15907 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15908 (Fcopy_keymap): Handle embedded parents.
15909 (Fcommand_remapping, define_as_prefix): Simplify.
15910 (Fkey_binding): Simplify.
15911 (syms_of_keymap): Move minibuffer-local-completion-map,
15912 minibuffer-local-filename-completion-map,
15913 minibuffer-local-must-match-map, and
15914 minibuffer-local-filename-must-match-map to Elisp.
15915 (syms_of_keymap): Defsubr make-composed-keymap.
15916 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15917 (parse_menu_item): Trivial simplification.
15918
15919 2011-07-01 Glenn Morris <rgm@gnu.org>
15920
15921 * Makefile.in (SETTINGS_LIBS): Fix typo.
15922
15923 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15924
15925 * coding.c (Fencode_coding_string): Record the last coding system
15926 used, as the function doc string says (bug#8738).
15927
15928 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15929
15930 * xsettings.c (store_monospaced_changed): Take new font as arg and
15931 check for change against current_mono_font.
15932 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15933 (emacs_settings_constructor, emacs_settings_get_property)
15934 (emacs_settings_set_property, emacs_settings_class_init)
15935 (emacs_settings_init, gsettings_obj): Remove.
15936 (something_changedCB): New function for HAVE_GSETTINGS.
15937 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15938 with value as argument.
15939 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15940 g_settings_new (Bug#8967). Do not create gsettings_obj.
15941 Remove calls to g_settings_bind. Connect something_changedCB to
15942 "changed".
15943
15944 * xgselect.c: Add defined (HAVE_GSETTINGS).
15945 (xgselect_initialize): Ditto.
15946
15947 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15948 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15949 xg_select.
15950
15951 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15952
15953 * eval.c (struct backtrace): Simplify and port the data structure.
15954 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15955 signed bit field, as this assumption is not portable and it makes
15956 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15957 "char debug_on_exit : 1" as this is not portable either; instead,
15958 use the portable "unsigned int debug_on_exit : 1". Remove unused
15959 member evalargs. Remove obsolete comments about cc bombing out.
15960
15961 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15962
15963 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15964 Let HAVE_GSETTINGS override HAVE_GCONF.
15965 (store_monospaced_changed): New function.
15966 (EMACS_SETTINGS): A new type derived from GObject to handle
15967 GSettings notifications.
15968 (emacs_settings_constructor, emacs_settings_get_property)
15969 (emacs_settings_set_property, emacs_settings_class_init):
15970 New functions.
15971 (gsettings_client, gsettings_obj): New variables.
15972 (GSETTINGS_SCHEMA): New define.
15973 (something_changedCB): Call store_monospaced_changed.
15974 (init_gsettings): New function.
15975 (xsettings_initialize): Call init_gsettings.
15976 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15977 to NULL.
15978
15979 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15980 GCONF_CFLAGS/LIBS.
15981
15982 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15983
15984 * window.c (resize_root_window, grow_mini_window)
15985 (shrink_mini_window): Rename Qresize_root_window to
15986 Qwindow_resize_root_window and Qresize_root_window_vertically to
15987 Qwindow_resize_root_window_vertically.
15988
15989 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15990
15991 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15992
15993 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15994
15995 * makefile.w32-in: Redesign dependencies so they reflect more
15996 clearly which files are directly included by each source file,
15997 and not through other includes.
15998
15999 2011-06-27 Martin Rudalics <rudalics@gmx.at>
16000
16001 * buffer.c (Qclone_number): Declare static and DEFSYM it.
16002 (sort_overlays, overlay_strings): When an overlay's clone number
16003 matches the window's clone number process the overlay even if
16004 the overlay's window property doesn't match the current window.
16005
16006 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
16007 (Fwindow_hchild): Rename to Fwindow_left_child.
16008 (Fwindow_next): Rename to Fwindow_next_sibling.
16009 (Fwindow_prev): Rename to Fwindow_prev_sibling.
16010 (resize_window_check): Rename to window_resize_check.
16011 (resize_window_apply): Rename to window_resize_apply.
16012 (Fresize_window_apply): Rename to Fwindow_resize_apply.
16013 (Fdelete_other_windows_internal, resize_frame_windows)
16014 (Fsplit_window_internal, Fdelete_window_internal)
16015 (grow_mini_window, shrink_mini_window)
16016 (Fresize_mini_window_internal): Fix callers accordingly.
16017
16018 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
16019
16020 * emacsgtkfixed.h: State that this is only used with Gtk+3.
16021 (emacs_fixed_set_min_size): Remove.
16022 (emacs_fixed_new): Take frame as argument.
16023
16024 * emacsgtkfixed.c: State that this is only used with Gtk+3.
16025 (_EmacsFixedPrivate): Remove minwidth/height.
16026 Add struct frame *f.
16027 (emacs_fixed_init): Initialize priv->f.
16028 (get_parent_class, emacs_fixed_set_min_size): Remove.
16029 (emacs_fixed_new): Set priv->f to argument.
16030 (emacs_fixed_get_preferred_width)
16031 (emacs_fixed_get_preferred_height): Use min_width/height from
16032 frames size_hint to set minimum and natural (Bug#8919).
16033 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
16034 and use min_width/height from frames size_hint to set
16035 min_width/height (Bug#8919).
16036
16037 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
16038 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
16039 Fix indentation.
16040
16041 2011-06-26 Eli Zaretskii <eliz@gnu.org>
16042
16043 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
16044 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
16045 called at ZV.
16046
16047 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
16048
16049 * process.c (wait_reading_process_output): Bypass select if
16050 waiting for a cell while ignoring keyboard input, and input is
16051 pending. Suggested by Jan Djärv (Bug#8869).
16052
16053 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
16054
16055 Use gnulib's dup2 module instead of rolling our own.
16056 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
16057
16058 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16059
16060 * dispnew.c (scrolling_window): Before scrolling, turn off a
16061 mouse-highlight in the window being scrolled.
16062
16063 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
16064
16065 Move DEFSYM to lisp.h and use everywhere.
16066
16067 * character.h (DEFSYM): Move declaration...
16068 * lisp.h (DEFSYM): ...here.
16069
16070 * gnutls.c:
16071 * minibuf.c:
16072 * w32menu.c:
16073 * w32proc.c:
16074 * w32select.c: Don't include character.h.
16075
16076 * alloc.c (syms_of_alloc):
16077 * buffer.c (syms_of_buffer):
16078 * bytecode.c (syms_of_bytecode):
16079 * callint.c (syms_of_callint):
16080 * casefiddle.c (syms_of_casefiddle):
16081 * casetab.c (init_casetab_once):
16082 * category.c (init_category_once, syms_of_category):
16083 * ccl.c (syms_of_ccl):
16084 * cmds.c (syms_of_cmds):
16085 * composite.c (syms_of_composite):
16086 * dbusbind.c (syms_of_dbusbind):
16087 * dired.c (syms_of_dired):
16088 * dispnew.c (syms_of_display):
16089 * doc.c (syms_of_doc):
16090 * editfns.c (syms_of_editfns):
16091 * emacs.c (syms_of_emacs):
16092 * eval.c (syms_of_eval):
16093 * fileio.c (syms_of_fileio):
16094 * fns.c (syms_of_fns):
16095 * frame.c (syms_of_frame):
16096 * fringe.c (syms_of_fringe):
16097 * insdel.c (syms_of_insdel):
16098 * keymap.c (syms_of_keymap):
16099 * lread.c (init_obarray, syms_of_lread):
16100 * macros.c (syms_of_macros):
16101 * msdos.c (syms_of_msdos):
16102 * print.c (syms_of_print):
16103 * process.c (syms_of_process):
16104 * search.c (syms_of_search):
16105 * sound.c (syms_of_sound):
16106 * syntax.c (init_syntax_once, syms_of_syntax):
16107 * terminal.c (syms_of_terminal):
16108 * textprop.c (syms_of_textprop):
16109 * undo.c (syms_of_undo):
16110 * w32.c (globals_of_w32):
16111 * window.c (syms_of_window):
16112 * xdisp.c (syms_of_xdisp):
16113 * xfaces.c (syms_of_xfaces):
16114 * xfns.c (syms_of_xfns):
16115 * xmenu.c (syms_of_xmenu):
16116 * xsettings.c (syms_of_xsettings):
16117 * xterm.c (syms_of_xterm): Use DEFSYM.
16118
16119 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
16120
16121 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
16122
16123 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
16124
16125 Integer and buffer overflow fixes (Bug#8873).
16126
16127 * print.c (printchar, strout): Check for string overflow.
16128 (PRINTPREPARE, printchar, strout):
16129 Don't set size unless allocation succeeds.
16130
16131 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
16132 for sizes. Check for string overflow more accurately.
16133 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
16134
16135 * macros.c: Integer and buffer overflow fixes.
16136 * keyboard.h (struct keyboard.kbd_macro_bufsize):
16137 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
16138 Use ptrdiff_t, not int, for sizes.
16139 Don't increment bufsize until after realloc succeeds.
16140 Check for size-calculation overflow.
16141 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
16142
16143 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
16144
16145 * lread.c: Integer overflow fixes.
16146 (read_integer): Radix is now EMACS_INT, not int,
16147 to improve quality of diagnostics for out-of-range radices.
16148 Calculate buffer size correctly for out-of-range radices.
16149 (read1): Check for integer overflow in radices, and in
16150 read-circle numbers.
16151 (read_escape): Avoid int overflow.
16152 (Fload, openp, read_buffer_size, read1)
16153 (substitute_object_recurse, read_vector, read_list, map_obarray):
16154 Use ptrdiff_t, not int, for sizes.
16155 (read1): Use EMACS_INT, not int, for sizes.
16156 Check for size overflow.
16157
16158 * image.c (cache_image): Check for size arithmetic overflow.
16159
16160 * lread.c: Integer overflow issues.
16161 (saved_doc_string_size, saved_doc_string_length)
16162 (prev_saved_doc_string_size, prev_saved_doc_string_length):
16163 Now ptrdiff_t, not int.
16164 (read1): Don't assume doc string length fits in int. Check for
16165 out-of-range doc string lengths.
16166 (read_list): Don't assume file position fits in int.
16167 (read_escape): Check for hex character overflow.
16168
16169 2011-06-22 Leo Liu <sdl.web@gmail.com>
16170
16171 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
16172 Move to minibuffer.el.
16173
16174 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16175
16176 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
16177 The following patches are for when GLYPH_DEBUG && !XASSERT.
16178 * dispextern.h (trace_redisplay_p, dump_glyph_string):
16179 * dispnew.c (flush_stdout):
16180 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
16181 Mark as externally visible.
16182 * dispnew.c (check_window_matrix_pointers): Now static.
16183 * dispnew.c (window_to_frame_vpos):
16184 * xfns.c (unwind_create_frame):
16185 * xterm.c (x_check_font): Remove unused local.
16186 * scroll.c (CHECK_BOUNDS):
16187 * xfaces.c (cache_fache): Rename local to avoid shadowing.
16188 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
16189 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
16190 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
16191 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
16192 Now static.
16193 (debug_method_add): Use va_list and vsprintf rather than relying
16194 on undefined behavior with wrong number of arguments.
16195 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
16196 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
16197 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
16198 since we're not interested in debugging glyphs with old libraries.
16199 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
16200 GCC 4.6.0's static checking.
16201
16202 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16203
16204 Integer overflow and signedness fixes (Bug#8873).
16205 A few related buffer overrun fixes, too.
16206
16207 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
16208
16209 * dispextern.h (struct face.stipple):
16210 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
16211 (x_bitmap_mask, x_allocate_bitmap_record)
16212 (x_create_bitmap_from_data, x_create_bitmap_from_file)
16213 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
16214 (x_create_bitmap_from_xpm_data):
16215 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
16216 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
16217 (.bitmaps_last):
16218 * xfaces.c (load_pixmap):
16219 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
16220 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
16221 (.bitmaps_last, struct x_output.icon_bitmap):
16222 Use ptrdiff_t, not int, for bitmap indexes.
16223 (x_allocate_bitmap_record): Check for size overflow.
16224 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
16225
16226 Use ptrdiff_t, not int, for overlay counts.
16227 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
16228 * editfns.c (overlays_around, get_pos_property):
16229 * textprop.c (get_char_property_and_overlay):
16230 * xdisp.c (next_overlay_change, note_mouse_highlight):
16231 * xfaces.c (face_at_buffer_position):
16232 * buffer.c (OVERLAY_COUNT_MAX): New macro.
16233 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
16234 (Fnext_overlay_change, Fprevious_overlay_change)
16235 (mouse_face_overlay_overlaps, Foverlays_in):
16236 Use ptrdiff_t, not int, for sizes.
16237 (overlays_at, overlays_in): Check for size-calculation overflow.
16238
16239 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
16240
16241 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
16242 (x_session_initialize): Do not assume string length fits in int.
16243
16244 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
16245 This is unlikely, but can occur if DPI is outlandish.
16246
16247 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
16248 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
16249
16250 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
16251 * xrdb.c (magic_file_p, search_magic_path):
16252 Omit last arg SUFFIX; it was always 0. All callers changed.
16253 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
16254
16255 * xfont.c (xfont_match): Avoid need for strlen.
16256
16257 * xfns.c: Don't assume strlen fits in int.
16258 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
16259
16260 * xdisp.c (message_log_check_duplicate): Return intmax_t,
16261 not unsigned long, as we prefer signed integers. All callers changed.
16262 Detect integer overflow in repeat count.
16263 (message_dolog): Don't assume print length fits in 39 bytes.
16264 (display_mode_element): Don't assume strlen fits in int.
16265
16266 * termcap.c: Don't assume sizes fit in int and never overflow.
16267 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
16268 (gobble_line): Check for size-calculation overflow.
16269
16270 * minibuf.c (Fread_buffer):
16271 * lread.c (intern, intern_c_string):
16272 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
16273 Don't assume string length fits in int.
16274
16275 * keyboard.c (parse_tool_bar_item):
16276 * gtkutil.c (style_changed_cb): Avoid need for strlen.
16277
16278 * font.c: Don't assume string length fits in int.
16279 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
16280 Use ptrdiff_t, not int.
16281 (font_intern_prop): Don't assume string length fits in int.
16282 Don't assume integer property fits in fixnum.
16283 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
16284
16285 * filelock.c: Fix some buffer overrun and integer overflow issues.
16286 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
16287 Reformulate so as not to need the command string.
16288 Invoke gzip -cd rather than gunzip, as it's more portable.
16289 (lock_info_type, lock_file_1, lock_file):
16290 Don't assume pid_t and time_t fit in unsigned long.
16291 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
16292 (current_lock_owner): Prefer signed type for sizes.
16293 Use memcpy, not strncpy, where memcpy is what is really wanted.
16294 Don't assume (via atoi) that time_t and pid_t fit in int.
16295 Check for time_t and/or pid_t out of range, e.g., via a network share.
16296 Don't alloca where an auto var works fine.
16297
16298 * fileio.c: Fix some integer overflow issues.
16299 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
16300 Don't assume string length fits in int.
16301 (directory_file_name): Don't assume string length fits in long.
16302 (make_temp_name): Don't assume pid fits in int, or that its print
16303 length is less than 20.
16304
16305 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
16306
16307 * coding.c (make_subsidiaries): Don't assume string length fits in int.
16308
16309 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
16310
16311 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
16312 We prefer signed integers, even for size calculations.
16313
16314 * emacs.c: Don't assume string length fits in 'int'.
16315 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
16316 (main): Don't invoke strlen when not needed.
16317
16318 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
16319 (XD_DEBUG_MESSAGE): Don't waste a byte.
16320
16321 * callproc.c (getenv_internal_1, getenv_internal)
16322 (Fgetenv_internal):
16323 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
16324
16325 * lread.c (invalid_syntax): Omit length argument.
16326 All uses changed. This doesn't fix a bug, but it simplifies the
16327 code away from its former Hollerith-constant appearance, and it's
16328 one less 'int' to worry about when looking at integer-overflow issues.
16329 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
16330
16331 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
16332 This didn't break anything, but it didn't help either.
16333 It's confusing to put a bogus integer in a place where the actual
16334 value does not matter.
16335 (LIST_END_P): Remove unused macro and its bogus comment.
16336 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
16337
16338 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
16339 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
16340 implementation.
16341 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
16342 We prefer signed types, and the value cannot exceed the EMACS_INT
16343 range anyway (because otherwise the length would not be representable).
16344 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
16345 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
16346 This avoids a GCC warning when WIDE_EMACS_INT.
16347
16348 * indent.c (sane_tab_width): New function.
16349 (current_column, scan_for_column, Findent_to, position_indentation)
16350 (compute_motion): Use it. This is just for clarity.
16351 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
16352
16353 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
16354
16355 * lisp.h (lint_assume): New macro.
16356 * composite.c (composition_gstring_put_cache):
16357 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
16358
16359 * editfns.c, insdel.c:
16360 Omit unnecessary forward decls, to simplify future changes.
16361
16362 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
16363
16364 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
16365
16366 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
16367 Use much-faster test for byte-length change.
16368 Don't assume string byte-length fits in 'int'.
16369 Check that character arg fits in 'int'.
16370 (mapcar1): Declare byte as byte, for clarity.
16371
16372 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
16373
16374 * fns.c (concat): Catch string overflow earlier.
16375 Do not rely on integer wraparound.
16376
16377 * dispextern.h (struct it.overlay_strings_charpos)
16378 (struct it.selective): Now EMACS_INT, not int.
16379 * xdisp.c (forward_to_next_line_start)
16380 (back_to_previous_visible_line_start)
16381 (reseat_at_next_visible_line_start, next_element_from_buffer):
16382 Don't arbitrarily truncate the value of 'selective' to int.
16383
16384 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
16385
16386 * composite.c: Don't truncate sizes to 'int'.
16387 (composition_gstring_p, composition_reseat_it)
16388 (composition_adjust_point): Use EMACS_INT, not int.
16389 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
16390 not EMACS_UINT, for indexes.
16391
16392 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
16393
16394 * buffer.c: Include <verify.h>.
16395 (struct sortvec.priority, struct sortstr.priority):
16396 Now EMACS_INT, not int.
16397 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
16398 (struct sortstr.size, record_overlay_string)
16399 (struct sortstrlist.size, struct sortlist.used):
16400 Don't truncate size to int.
16401 (record_overlay_string): Check for size-calculation overflow.
16402 (init_buffer_once): Check at compile-time, not run-time.
16403
16404 2011-06-22 Jim Meyering <meyering@redhat.com>
16405
16406 Don't leak an XBM-image-sized buffer
16407 * image.c (xbm_load): Free the image buffer after using it.
16408
16409 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
16410
16411 Port to Sun C.
16412 * composite.c (find_automatic_composition): Omit needless 'return 0;'
16413 that Sun C diagnosed.
16414 * fns.c (secure_hash): Fix pointer signedness issue.
16415 * intervals.c (static_offset_intervals): New function.
16416 (offset_intervals): Use it.
16417
16418 2011-06-21 Leo Liu <sdl.web@gmail.com>
16419
16420 * deps.mk (fns.o):
16421 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
16422 sha512.h.
16423
16424 * fns.c (secure_hash): Rename from crypto_hash_function and change
16425 the first arg to accept symbols.
16426 (Fsecure_hash): New primitive.
16427 (syms_of_fns): New symbols.
16428
16429 2011-06-20 Deniz Dogan <deniz@dogan.se>
16430
16431 * process.c (Fset_process_buffer): Clarify return value in
16432 docstring.
16433
16434 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
16435
16436 * dispnew.c (add_window_display_history): Use BVAR.
16437
16438 * xdisp.c (debug_method_add): Use BVAR.
16439 (check_window_end, dump_glyph_matrix, dump_glyph)
16440 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16441
16442 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16443 Likewise.
16444
16445 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16446 check till after the cache is created in init_frame_faces.
16447
16448 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16449
16450 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16451
16452 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16453
16454 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16455 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16456 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16457
16458 Improve buffer-overflow checking (Bug#8873).
16459 * fileio.c (Finsert_file_contents):
16460 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16461 Remove the old (too-loose) buffer overflow checks.
16462 They weren't needed, since make_gap checks for buffer overflow.
16463 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16464 The old code merely checked for Emacs fixnum overflow, and relied
16465 on undefined (wraparound) behavior. The new code avoids undefined
16466 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16467
16468 * editfns.c (Finsert_char): Don't dump core with very negative counts.
16469 Tune. Don't use wider integers than needed. Don't use alloca.
16470 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
16471
16472 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16473
16474 * insdel.c, lisp.h (buffer_overflow): New function.
16475 (insert_from_buffer_1, replace_range, replace_range_2):
16476 * insdel.c (make_gap_larger):
16477 * editfns.c (Finsert_char):
16478 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16479
16480 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16481
16482 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16483
16484 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
16485
16486 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16487 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16488
16489 * fileio.c: Don't assume EMACS_INT fits in off_t.
16490 (emacs_lseek): New static function.
16491 (Finsert_file_contents, Fwrite_region): Use it.
16492 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16493
16494 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16495
16496 * fns.c: Don't overflow int when computing a list length.
16497 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16498 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16499 truncation on 64-bit hosts. Check for QUIT every
16500 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16501 faster and is responsive enough.
16502 (Flength): Report an error instead of overflowing an integer.
16503 (Fsafe_length): Return a float if the value is not representable
16504 as a fixnum. This shouldn't happen except in contrived situations.
16505 (Fnthcdr, Fsort): Don't assume list length fits in int.
16506 (Fcopy_sequence): Don't assume vector length fits in int.
16507
16508 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16509 (header_size, word_size): New constants.
16510 (allocate_vectorlike): Don't check size overflow here.
16511 (allocate_vector): Check it here instead, since this is the only
16512 caller of allocate_vectorlike that could cause overflow.
16513 Check that the new vector's length is representable as a fixnum.
16514
16515 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16516 The previous code was bogus. For example, next_almost_prime (32)
16517 returned 39, which is undesirable as it is a multiple of 3; and
16518 next_almost_prime (24) returned 25, which is a multiple of 5 so
16519 why was the code bothering to check for multiples of 7?
16520
16521 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16522
16523 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16524
16525 Variadic C functions now count arguments with ptrdiff_t.
16526 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16527 Back then I didn't know that the Emacs coding style prefers signed int.
16528 Also, in the meantime I found a few more instances where arguments
16529 were being counted with int, which may truncate counts on 64-bit
16530 machines, or EMACS_INT, which may be unnecessarily wide.
16531 * lisp.h (struct Lisp_Subr.function.aMANY)
16532 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16533 Arg counts are now ptrdiff_t, not size_t.
16534 All variadic functions and their callers changed accordingly.
16535 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16536 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16537 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16538 * callint.c (Fcall_interactively): Check arg count for overflow,
16539 to avoid potential buffer overrun. Use signed char, not 'int',
16540 for 'varies' array, so that we needn't bother to check its size
16541 calculation for overflow.
16542 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16543 * eval.c (apply_lambda):
16544 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16545 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16546 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16547
16548 * callint.c (Fcall_interactively): Don't use index var as event count.
16549
16550 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16551 * mem-limits.h (SIZE): Remove; no longer used.
16552
16553 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
16554
16555 Remove unnecessary casts.
16556 * xterm.c (x_term_init):
16557 * xfns.c (x_set_border_pixel):
16558 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16559 These aren't needed now that we assume ANSI C.
16560
16561 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16562 It's more likely to cause problems (due to unsigned overflow)
16563 than to cure them.
16564
16565 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16566
16567 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16568
16569 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16570
16571 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16572
16573 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16574
16575 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16576
16577 GLYPH_CODE_FACE returns EMACS_INT, not int.
16578 * dispextern.h (merge_faces):
16579 * xfaces.c (merge_faces):
16580 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16581 Don't assume EMACS_INT fits in int.
16582
16583 * character.h (CHAR_VALID_P): Remove unused parameter.
16584 * fontset.c, lisp.h, xdisp.c: All uses changed.
16585
16586 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16587
16588 * fns.c (concat): Minor tuning based on overflow analysis.
16589 This doesn't fix any bugs. Use int to hold character, instead
16590 of constantly refetching from Emacs object. Use XFASTINT, not
16591 XINT, for value known to be a character. Don't bother comparing
16592 a single byte to 0400, as it's always less.
16593
16594 * floatfns.c (Fexpt):
16595 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16596
16597 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16598 for characters.
16599
16600 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16601
16602 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16603 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16604 incorrectly succeed when S was a string, because 4294967386 was
16605 truncated before it was used.
16606
16607 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16608 Otherwise, an out-of-range integer could cause undefined behavior
16609 on a 64-bit host.
16610
16611 * composite.c: Use int, not EMACS_INT, for characters.
16612 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16613 EMACS_INT, for values that are known to be in character range.
16614 This doesn't fix any bugs but is the usual style inside Emacs and
16615 may generate better code on 32-bit machines.
16616
16617 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16618 This is for reasons similar to the recent CHAR_STRING fix.
16619 * charset.c (Fencode_char): Check that character arg is actually
16620 a character. Pass an int to ENCODE_CHAR.
16621 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16622 wider than 'int', as a compile-time check to prevent future regressions
16623 in this area.
16624
16625 * character.c (char_string): Remove unnecessary casts.
16626
16627 Make sure a 64-bit char is never passed to CHAR_STRING.
16628 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16629 by silently ignoring the top 32 bits, allowing some values
16630 that were far too large to be valid characters.
16631 * character.h: Include <verify.h>.
16632 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16633 arguments are no wider than unsigned, as a compile-time check
16634 to prevent future regressions in this area.
16635 * data.c (Faset):
16636 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
16637 (Fsubst_char_in_region):
16638 * fns.c (concat):
16639 * xdisp.c (decode_mode_spec_coding):
16640 Adjust to CHAR_STRING's new requirement.
16641 * editfns.c (Finsert_char, Fsubst_char_in_region):
16642 * fns.c (concat): Check that character args are actually
16643 characters. Without this test, these functions did the wrong
16644 thing with wildly out-of-range values on 64-bit hosts.
16645
16646 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16647 These casts should not be needed on 32-bit hosts, either.
16648 * keyboard.c (read_char):
16649 * lread.c (Fload): Remove casts to unsigned.
16650
16651 * lisp.h (UNSIGNED_CMP): New macro.
16652 This fixes comparison bugs on 64-bit hosts.
16653 (ASCII_CHAR_P): Use it.
16654 * casefiddle.c (casify_object):
16655 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
16656 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16657 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16658 * dispextern.h (FACE_FROM_ID):
16659 * keyboard.c (read_char): Use UNSIGNED_CMP.
16660
16661 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16662 not to EMACS_INT, to avoid GCC warning.
16663
16664 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16665
16666 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16667 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16668 isn't needed on 32-bit machines.
16669
16670 * buffer.c (Fgenerate_new_buffer_name):
16671 Use EMACS_INT for count, not int.
16672 (advance_to_char_boundary): Return EMACS_INT, not int.
16673
16674 * data.c (Qcompiled_function): Now static.
16675
16676 * window.c (window_body_lines): Now static.
16677
16678 * image.c (gif_load): Rename local to avoid shadowing.
16679
16680 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16681 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16682 * alloc.c (make_save_value): Integer argument is now of type
16683 ptrdiff_t, not int.
16684 (mark_object): Use ptrdiff_t, not int.
16685 * lisp.h (pD): New macro.
16686 * print.c (print_object): Use it.
16687
16688 * alloc.c: Use EMACS_INT, not int, to count objects.
16689 (total_conses, total_markers, total_symbols, total_vector_size)
16690 (total_free_conses, total_free_markers, total_free_symbols)
16691 (total_free_floats, total_floats, total_free_intervals)
16692 (total_intervals, total_strings, total_free_strings):
16693 Now EMACS_INT, not int. All uses changed.
16694 (Fgarbage_collect): Compute overall total using a double, so that
16695 integer overflow is less likely to be a problem. Check for overflow
16696 when converting back to an integer.
16697 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16698 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16699 These were 'int' variables that could overflow on 64-bit hosts;
16700 they were never used, so remove them instead of repairing them.
16701 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16702 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16703 Previously, this ceilinged at INT_MAX, but that doesn't work on
16704 64-bit machines.
16705 (allocate_pseudovector): Don't use EMACS_INT when int would do.
16706
16707 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16708 (allocate_vectorlike): Check for ptrdiff_t overflow.
16709 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16710 when a (possibly-narrower) signed value would do just as well.
16711 We prefer using signed arithmetic, to avoid comparison confusion.
16712
16713 * alloc.c: Catch some string size overflows that we were missing.
16714 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16715 for convenience in STRING_BYTES_MAX.
16716 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16717 The definition here is exact; the one in lisp.h was approximate.
16718 (allocate_string_data): Check for string overflow. This catches
16719 some instances we weren't catching before. Also, it catches
16720 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16721 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16722 and ptrdiff_t and EMACS_INT are both 64 bits.
16723
16724 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16725 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16726 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16727
16728 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16729
16730 * alloc.c (Fmake_string): Check for out-of-range init.
16731
16732 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16733
16734 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16735
16736 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16737
16738 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16739 xg_get_default_scrollbar_width.
16740
16741 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16742 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16743 (style_changed_cb): Call update_theme_scrollbar_width and call
16744 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16745 all frames (Bug#8505).
16746 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16747 Call gtk_window_set_resizable if HAVE_GTK3.
16748 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16749 and height if HAVE_GTK3 (Bug#8505).
16750 (scroll_bar_width_for_theme): New variable.
16751 (update_theme_scrollbar_width): New function.
16752 (xg_get_default_scrollbar_width): Move code to
16753 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16754 (xg_initialize): Call update_theme_scrollbar_width.
16755
16756 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16757
16758 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16759
16760 2011-06-12 Martin Rudalics <rudalics@gmx.at>
16761
16762 * frame.c (make_frame): Call other_buffer_safely instead of
16763 other_buffer.
16764
16765 * window.c (temp_output_buffer_show): Call display_buffer with
16766 second argument Vtemp_buffer_show_specifiers and reset latter
16767 immediately after the call.
16768 (Vtemp_buffer_show_specifiers): New variable.
16769 (auto_window_vscroll_p, next_screen_context_lines)
16770 (Vscroll_preserve_screen_position): Remove leading asterisks from
16771 doc-strings.
16772
16773 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
16774
16775 Fix minor problems found by GCC 4.6.0 static checking.
16776 * buffer.c (Qclone_number): Remove for now, as it's unused.
16777 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16778 (record_buffer): Remove unused local.
16779 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16780 (set_frame_buffer_list): Remove; unused.
16781 * frame.h (other_visible_frames): Remove decl.
16782 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16783 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16784 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16785 if HAVE_GPM.
16786 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16787 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16788 Define only if HAVE_GPM.
16789 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16790 (update_hints_inhibit): Remove; never set. All uses removed.
16791 * widgetprv.h (emacsFrameClassRec): Remove decl.
16792 * window.c (delete_deletable_window): Now returns void, since it
16793 wasn't returning anything.
16794 (compare_window_configurations): Remove unused locals.
16795 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16796 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16797 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16798 the same widths as pointers. This follows up on the 2011-05-06 patch.
16799 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16800 * xterm.h: Likewise.
16801 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16802
16803 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
16804
16805 * makefile.w32-in: Update dependencies.
16806 (LISP_H): Add lib/intprops.h.
16807
16808 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16809
16810 * image.c (gif_load): Add animation frame delay to the metadata.
16811 (syms_of_image): Use DEFSYM. New symbol `delay'.
16812
16813 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16814
16815 * window.c (delete_deletable_window): Re-add.
16816 (Fset_window_configuration): Rewrite to handle dead buffers and
16817 consequently deletable windows.
16818 (window_tree, Fwindow_tree): Remove. Supply functionality in
16819 window.el.
16820 (compare_window_configurations): Simplify code.
16821
16822 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16823
16824 * image.c (imagemagick_load_image): Fix type mismatch.
16825 (Fimagemagick_types): Likewise.
16826
16827 * window.h (replace_buffer_in_windows): Declare.
16828
16829 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16830
16831 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16832 Qclone_number. Remove external declaration of Qdelete_window.
16833 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16834 code.
16835 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16836 Run Qbuffer_list_update_hook if allowed.
16837 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16838 buffer list implementation.
16839 (other_buffer_safely): New function.
16840 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16841 calls to replace_buffer_in_windows and
16842 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16843 if allowed.
16844 (record_buffer): Inhibit quitting and rewrite using quittable
16845 functions. Run Qbuffer_list_update_hook if allowed.
16846 (Frecord_buffer, Funrecord_buffer): New functions.
16847 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16848 Move switch-to-buffer to window.el.
16849 (bury-buffer): Move to window.el.
16850 (Vbuffer_list_update_hook): New variable.
16851
16852 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16853 section.
16854
16855 * window.h (resize_frame_windows): Move up in code.
16856 (Fwindow_frame): Remove EXFUN.
16857 (replace_buffer_in_all_windows): Remove prototype.
16858 (replace_buffer_in_windows_safely): Add prototype.
16859
16860 * window.c: Declare Qdelete_window static again. Move down
16861 declaration of select_count.
16862 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16863 (Fother_window): Move to window.el.
16864 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16865 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16866 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16867 window.el.
16868 (replace_buffer_in_windows): Implement by calling
16869 Qreplace_buffer_in_windows.
16870 (replace_buffer_in_all_windows): Remove with some functionality
16871 moved into replace_buffer_in_windows_safely.
16872 (replace_buffer_in_windows_safely): New function.
16873 (select_window_norecord, select_frame_norecord): Move in front
16874 of run_window_configuration_change_hook. Remove now obsolete
16875 declarations.
16876 (Fset_window_buffer): Rewrite doc-string.
16877 Call Qrecord_window_buffer.
16878 (keys_of_window): Move binding for other-window to window.el.
16879
16880 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16881
16882 * dispextern.h (struct image): Replace data member, whose int_val
16883 and ptr_val fields were not used by anything, with a single
16884 lisp_val object.
16885
16886 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16887 (gif_clear_image, gif_load, imagemagick_load_image)
16888 (gs_clear_image, gs_load): Callers changed.
16889
16890 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16891
16892 * buffer.h: Include <time.h>, for time_t.
16893 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16894
16895 Fix minor problems found by static checking.
16896
16897 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16898
16899 Make identifiers static if they are not used in other modules.
16900 * data.c (Qcompiled_function, Qframe, Qvector):
16901 * image.c (QimageMagick, Qsvg):
16902 * minibuf.c (Qmetadata):
16903 * window.c (resize_window_check, resize_root_window): Now static.
16904 * window.h (resize_window_check, resize_root_window): Remove decls.
16905
16906 * window.c (window_deletion_count, delete_deletable_window):
16907 Remove; unused.
16908 (window_body_lines): Now static.
16909 (Fdelete_other_windows_internal): Mark vars as initialized.
16910 Make sure 'resize_failed' is initialized.
16911 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16912 (resize_window_apply): Remove unused local.
16913 * window.h (delete_deletable_window): Remove decl.
16914
16915 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16916 (imagemagick_load_image): Fix pointer signedness problem by changing
16917 last arg from unsigned char * to char *. All uses changed.
16918 Also, fix a local for similar reasons.
16919 Remove unused locals. Remove locals to avoid shadowing.
16920 (fn_rsvg_handle_free): Remove; unused.
16921 (svg_load, svg_load_image): Fix pointer signedness problem.
16922 (imagemagick_load_image): Don't use garbage pointer image_wand.
16923
16924 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16925
16926 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16927
16928 * image.c (gif_load): Fix omitted cast error introduced by
16929 2011-06-06 change.
16930
16931 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16932
16933 * window.h (resize_proportionally, orig_total_lines)
16934 (orig_top_line): Remove from window structure.
16935 (set_window_height, set_window_width, change_window_heights)
16936 (Fdelete_window): Remove prototypes.
16937 (resize_frame_windows): Remove duplicate declaration.
16938
16939 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16940
16941 * window.h (resize_frame_windows, resize_window_check)
16942 (delete_deletable_window, resize_root_window)
16943 (resize_frame_windows): Declare prototypes.
16944
16945 * window.c (resize_window_apply): Make definition be "static" to
16946 match the prototype.
16947
16948 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16949
16950 * window.c: Remove declarations of Qwindow_size_fixed,
16951 window_min_size_1, window_min_size_2, window_min_size,
16952 size_window, window_fixed_size_p, enlarge_window, delete_window.
16953 Remove static from declaration of Qdelete_window, it's
16954 temporarily needed by Fbury_buffer.
16955 (replace_window): Don't assign orig_top_line and
16956 orig_total_lines.
16957 (Fdelete_window, delete_window): Remove. Window deletion is
16958 handled by window.el.
16959 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16960 Replace Fdelete_window calls with calls to Qdelete_window.
16961 (Fdelete_other_windows): Remove. Deleting other windows is
16962 handled by window.el.
16963 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16964 handled in window.el.
16965 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16966 Window minimum sizes are handled in window.el.
16967 (shrink_windows, size_window, set_window_height)
16968 (set_window_width, change_window_heights, window_height)
16969 (window_width, CURBEG, CURSIZE, enlarge_window)
16970 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16971 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16972 handled in window.el.
16973 (make_dummy_parent): Rename to make_parent_window and give it a
16974 second argument horflag.
16975 (make_window): Don't set resize_proportionally any more.
16976 (Fsplit_window): Remove. Windows are split in window.el.
16977 (save_restore_action, save_restore_orig_size)
16978 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16979 Resize mini windows in window.el.
16980 (grow_mini_window, shrink_mini_window): Implement by calling
16981 Qresize_root_window_vertically, resize_window_check and
16982 resize_window_apply.
16983 (saved_window, Fset_window_configuration, save_window_save):
16984 Do not handle orig_top_line, orig_total_lines, and
16985 resize_proportionally.
16986 (window_min_height, window_min_width): Move to window.el.
16987 (keys_of_window): Move bindings for delete-other-windows,
16988 split-window, delete-window and enlarge-window to window.el.
16989
16990 * buffer.c: Temporarily extern Qdelete_window.
16991 (Fbury_buffer): Temporarily call Qdelete_window instead of
16992 Fdelete_window (Fbury_buffer will move to window.el soon).
16993
16994 * frame.c (set_menu_bar_lines_1): Remove code handling
16995 orig_top_line and orig_total_lines.
16996
16997 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16998 set_window_height but set heights directly.
16999 (change_frame_size_1): Use resize_frame_windows.
17000
17001 * xdisp.c (init_xdisp): Don't use set_window_height but set
17002 heights directly.
17003
17004 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
17005 Use resize_frame_windows instead of change_window_heights and run
17006 run_window_configuration_change_hook.
17007
17008 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
17009 instead of change_window_heights and run
17010 run_window_configuration_change_hook.
17011
17012 2011-06-09 Martin Rudalics <rudalics@gmx.at>
17013
17014 * window.c (replace_window): Rename second argument REPLACEMENT to
17015 NEW. New third argument SETFLAG. Rewrite.
17016 (delete_window, make_dummy_parent): Call replace_window with
17017 third argument 1.
17018 (window_list_1): Move down in code.
17019 (run_window_configuration_change_hook): Move set_buffer part
17020 before select_frame_norecord part in order to unwind correctly.
17021 Rename count1 to count.
17022 (recombine_windows, delete_deletable_window, resize_root_window)
17023 (Fdelete_other_windows_internal)
17024 (Frun_window_configuration_change_hook, make_parent_window)
17025 (resize_window_check, resize_window_apply, Fresize_window_apply)
17026 (resize_frame_windows, Fsplit_window_internal)
17027 (Fdelete_window_internal, Fresize_mini_window_internal):
17028 New functions.
17029 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
17030
17031 2011-06-08 Martin Rudalics <rudalics@gmx.at>
17032
17033 * window.h (window): Add some new members to window structure -
17034 normal_lines, normal_cols, new_total, new_normal, clone_number,
17035 splits, nest, prev_buffers, next_buffers.
17036 (WINDOW_TOTAL_SIZE): Move here from window.c.
17037 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
17038
17039 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
17040 Remove.
17041 (make_dummy_parent): Set new members of windows structure.
17042 (make_window): Move down in code. Handle new members of window
17043 structure.
17044 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
17045 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
17046 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
17047 (Fset_window_prev_buffers, Fwindow_next_buffers)
17048 (Fset_window_next_buffers, Fset_window_clone_number):
17049 New functions.
17050 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
17051 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
17052 Doc-string fixes.
17053 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
17054 Argument WINDOW can be now internal window too.
17055 (Fwindow_use_time): Move up in code.
17056 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
17057 Rewrite doc-string.
17058 (Fset_window_configuration, saved_window)
17059 (Fcurrent_window_configuration, save_window_save): Handle new
17060 members of window structure.
17061 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
17062 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
17063 (syms_of_window): New Lisp objects Qrecord_window_buffer,
17064 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
17065 Qget_mru_window, Qresize_root_window,
17066 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
17067 Qauto_buffer_name; staticpro them.
17068
17069 2011-06-07 Martin Rudalics <rudalics@gmx.at>
17070
17071 * window.c (Fwindow_total_size, Fwindow_left_column)
17072 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
17073 (Fwindow_list_1): New functions.
17074 (window_box_text_cols): Replace with window_body_cols.
17075 (Fwindow_width, Fscroll_left, Fscroll_right):
17076 Use window_body_cols instead of window_box_text_cols.
17077 (delete_window, Fset_window_configuration):
17078 Call delete_all_subwindows with window as argument.
17079 (delete_all_subwindows): Take a window as argument and not a
17080 structure. Rewrite.
17081 (window_loop): Remove handling of GET_LRU_WINDOW and
17082 GET_LARGEST_WINDOW.
17083 (Fget_lru_window, Fget_largest_window): Move to window.el.
17084
17085 * window.h: Extern window_body_cols instead of
17086 window_box_text_cols. delete_all_subwindows now takes a
17087 Lisp_Object as argument.
17088
17089 * indent.c (compute_motion, Fcompute_motion):
17090 Use window_body_cols instead of window_box_text_cols.
17091
17092 * frame.c (delete_frame): Call delete_all_subwindows with root
17093 window as argument.
17094
17095 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
17096
17097 * fns.c (Fputhash): Document return value.
17098
17099 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
17100
17101 * image.c (gif_load): Implement gif89a spec "no disposal" method.
17102
17103 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17104
17105 Cons<->int and similar integer overflow fixes (Bug#8794).
17106
17107 Check for overflow when converting integer to cons and back.
17108 * charset.c (Fdefine_charset_internal, Fdecode_char):
17109 Use cons_to_unsigned to catch overflow.
17110 (Fencode_char): Use INTEGER_TO_CONS.
17111 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
17112 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
17113 * data.c (long_to_cons, cons_to_long): Remove.
17114 (cons_to_unsigned, cons_to_signed): New functions.
17115 These signal an error for invalid or out-of-range values.
17116 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
17117 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
17118 * font.c (Ffont_variation_glyphs):
17119 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
17120 * lisp.h: Include <intprops.h>.
17121 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
17122 (cons_to_signed, cons_to_unsigned): New decls.
17123 (long_to_cons, cons_to_long): Remove decls.
17124 * undo.c (record_first_change): Use INTEGER_TO_CONS.
17125 (Fprimitive_undo): Use CONS_TO_INTEGER.
17126 * xfns.c (Fx_window_property): Likewise.
17127 * xselect.c: Include <limits.h>.
17128 (x_own_selection, selection_data_to_lisp_data):
17129 Use INTEGER_TO_CONS.
17130 (x_handle_selection_request, x_handle_selection_clear)
17131 (x_get_foreign_selection, Fx_disown_selection_internal)
17132 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
17133 (lisp_data_to_selection_data): Use cons_to_unsigned.
17134 (x_fill_property_data): Use cons_to_signed.
17135 Report values out of range.
17136
17137 Check for buffer and string overflow more precisely.
17138 * buffer.h (BUF_BYTES_MAX): New macro.
17139 * lisp.h (STRING_BYTES_MAX): New macro.
17140 * alloc.c (Fmake_string):
17141 * character.c (string_escape_byte8):
17142 * coding.c (coding_alloc_by_realloc):
17143 * doprnt.c (doprnt):
17144 * editfns.c (Fformat):
17145 * eval.c (verror):
17146 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
17147 since they may not be the same number.
17148 * editfns.c (Finsert_char):
17149 * fileio.c (Finsert_file_contents):
17150 Likewise for BUF_BYTES_MAX.
17151
17152 * image.c: Use ptrdiff_t, not int, for sizes.
17153 (slurp_file): Switch from int to ptrdiff_t.
17154 All uses changed.
17155 (slurp_file): Check that file size fits in both size_t (for
17156 malloc) and ptrdiff_t (for sanity and safety).
17157
17158 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
17159 if b->modtime has its maximal value.
17160
17161 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
17162
17163 Don't assume time_t can fit into int.
17164 * buffer.h (struct buffer.modtime): Now time_t, not int.
17165 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
17166 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
17167
17168 Minor fixes for signed vs unsigned integers.
17169 * character.h (MAYBE_UNIFY_CHAR):
17170 * charset.c (maybe_unify_char):
17171 * keyboard.c (read_char, reorder_modifiers):
17172 XINT -> XFASTINT, since the integer must be nonnegative.
17173 * ftfont.c (ftfont_spec_pattern):
17174 * keymap.c (access_keymap, silly_event_symbol_error):
17175 XUINT -> XFASTINT, since the integer must be nonnegative.
17176 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
17177 since it makes no difference and we prefer signed.
17178 * keyboard.c (record_char): Use XUINT when all the neighbors do.
17179 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
17180 nonnegative.
17181
17182 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
17183
17184 * window.h (Fwindow_frame): Declare.
17185
17186 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17187
17188 * alloc.c: Simplify handling of large-request failures (Bug#8800).
17189 (SPARE_MEMORY): Always define.
17190 (LARGE_REQUEST): Remove.
17191 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
17192
17193 2011-06-06 Martin Rudalics <rudalics@gmx.at>
17194
17195 * lisp.h: Move EXFUNS for Fframe_root_window,
17196 Fframe_first_window and Fset_frame_selected_window to window.h.
17197
17198 * window.h: Move EXFUNS for Fframe_root_window,
17199 Fframe_first_window and Fset_frame_selected_window here from
17200 lisp.h.
17201
17202 * frame.c (Fwindow_frame, Fframe_first_window)
17203 (Fframe_root_window, Fframe_selected_window)
17204 (Fset_frame_selected_window): Move to window.c.
17205 (Factive_minibuffer_window): Move to minibuf.c.
17206 (Fother_visible_frames_p): New function.
17207
17208 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
17209
17210 * window.c (decode_window, decode_any_window): Move up in code.
17211 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
17212 (inhibit_frame_unsplittable): Remove unused variable.
17213 (Fwindow_buffer): Move up and rewrite doc-string.
17214 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
17215 (Fwindow_prev): New functions.
17216 (Fwindow_frame): Move here from frame.c. Accept any window as
17217 argument.
17218 (Fframe_root_window, Fframe_first_window)
17219 (Fframe_selected_window): Move here from frame.c. Accept frame
17220 or arbitrary window as argument. Update doc-strings.
17221 (Fminibuffer_window): Move up in code.
17222 (Fwindow_minibuffer_p): Move up in code and simplify.
17223 (Fset_frame_selected_window): Move here from frame.c.
17224 Marginal rewrite.
17225 (Fselected_window, select_window, Fselect_window): Move up in
17226 code. Minor doc-string fixes.
17227
17228 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17229
17230 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
17231 Do not assume that spare memory exists; that assumption is valid
17232 only if SYSTEM_MALLOC.
17233 (LARGE_REQUEST): New macro, so that the issue of large requests
17234 is separated from the issue of spare memory.
17235
17236 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
17237
17238 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
17239 format. (Bug#8806)
17240
17241 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
17242
17243 * xfns.c (x_set_scroll_bar_default_width): Move declarations
17244 before statements.
17245
17246 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
17247
17248 * gtkutil.c (xg_get_default_scrollbar_width): New function.
17249
17250 * gtkutil.h: Declare xg_get_default_scrollbar_width.
17251
17252 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
17253 min width by calling x_set_scroll_bar_default_width (Bug#8505).
17254
17255 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
17256
17257 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
17258
17259 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
17260
17261 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
17262 (x_clipboard_manager_save): Add return value.
17263 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
17264 New error handlers.
17265 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
17266 Obey Vx_select_enable_clipboard_manager. Catch errors in
17267 x_clipboard_manager_save (Bug#8779).
17268 (Vx_select_enable_clipboard_manager): New variable.
17269 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
17270
17271 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
17272
17273 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
17274
17275 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17276
17277 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
17278 in the current matrix if keep_current_p is non-zero.
17279
17280 2011-06-04 Eli Zaretskii <eliz@gnu.org>
17281
17282 * bidi.c (bidi_level_of_next_char): Fix last change.
17283
17284 2011-06-03 Eli Zaretskii <eliz@gnu.org>
17285
17286 Support bidi reordering of text covered by display properties.
17287
17288 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
17289 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
17290 (bidi_cache_search, bidi_cache_iterator_state)
17291 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
17292 (bidi_level_of_next_char, bidi_move_to_visually_next):
17293 Support character positions inside a run of characters covered by a
17294 display string.
17295 (bidi_paragraph_init, bidi_resolve_explicit_1)
17296 (bidi_level_of_next_char): Call bidi_fetch_char and
17297 bidi_fetch_char_advance instead of FETCH_CHAR and
17298 FETCH_CHAR_ADVANCE.
17299 (bidi_init_it): Initialize new members.
17300 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
17301 definitions.
17302 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
17303 instead of using explicit *_CHAR codes.
17304 (bidi_resolve_explicit, bidi_resolve_weak):
17305 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
17306 bidirectional text is supported only in multibyte buffers.
17307 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
17308 it to initialize the frame_window_p member of struct bidi_it.
17309 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
17310 (bidi_resolve_explicit, bidi_resolve_weak)
17311 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
17312 bidi_it->nchars is non-positive.
17313 (bidi_level_of_next_char): Don't try to lookup the cache for the
17314 next/previous character if nothing is cached there yet, or if we
17315 were just reseat()'ed to a new position.
17316
17317 * xdisp.c (set_cursor_from_row): Set start and stop points
17318 according to the row's direction when priming the loop that looks
17319 for the glyph on which to display cursor.
17320 (single_display_spec_intangible_p): Function deleted.
17321 (display_prop_intangible_p): Reimplement to call
17322 handle_display_spec instead of single_display_spec_intangible_p.
17323 Accept 3 additional arguments needed by handle_display_spec.
17324 This fixes incorrect cursor motion across display property with complex
17325 values: lists, `(when COND...)' forms, etc.
17326 (single_display_spec_string_p): Support property values that are
17327 lists with the argument STRING its top-level element.
17328 (display_prop_string_p): Fix the condition for processing a
17329 property that is a list to be consistent with handle_display_spec.
17330 (handle_display_spec): New function, refactored from the
17331 last portion of handle_display_prop.
17332 (compute_display_string_pos): Accept additional argument
17333 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
17334 value of a `display' property is a "replacing spec".
17335 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
17336 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
17337 the display property, but just return a value indicating whether
17338 the display property will replace the characters it covers.
17339 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
17340 frame_window_p members of struct bidi_it.
17341 (compute_display_string_pos, compute_display_string_end):
17342 New functions.
17343 (push_it): Accept second argument POSITION, where pop_it should
17344 jump to continue iteration.
17345 (reseat_1): Initialize bidi_it.disp_pos.
17346
17347 * keyboard.c (adjust_point_for_property): Adjust the call to
17348 display_prop_intangible_p to its new signature.
17349
17350 * dispextern.h (struct bidi_it): New member frame_window_p.
17351 (bidi_init_it): Update prototypes.
17352 (display_prop_intangible_p): Update prototype.
17353 (compute_display_string_pos, compute_display_string_end):
17354 Declare prototypes.
17355 (struct bidi_it): New members nchars and disp_pos. ch_len is now
17356 EMACS_INT.
17357
17358 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
17359
17360 Malloc failure behavior now depends on size of allocation.
17361 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
17362 * lisp.h: Change signatures accordingly.
17363 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
17364 All callers changed. (Bug#8762)
17365
17366 * gnutls.c: Use Emacs's memory allocators.
17367 Without this change, the gnutls library would invoke malloc etc.
17368 directly, which causes problems on non-SYNC_INPUT hosts, and which
17369 runs afoul of improving memory_full behavior. (Bug#8761)
17370 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
17371 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
17372 xfree instead of the default malloc, realloc, free.
17373 (Fgnutls_boot): No need to check for memory allocation failure,
17374 since xmalloc does that for us.
17375
17376 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
17377 * category.c (hash_get_category_set):
17378 * ccl.c (ccl_driver):
17379 * charset.c (Fdefine_charset_internal):
17380 * charset.h (struct charset.hash_index):
17381 * composite.c (get_composition_id, gstring_lookup_cache)
17382 (composition_gstring_put_cache):
17383 * composite.h (struct composition.hash_index):
17384 * dispextern.h (struct image.hash):
17385 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
17386 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
17387 (hashfn_equal, hashfn_user_defined, make_hash_table)
17388 (maybe_resize_hash_table, hash_lookup, hash_put)
17389 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
17390 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
17391 (Fsxhash, Fgethash, Fputhash, Fmaphash):
17392 * image.c (make_image, search_image_cache, lookup_image)
17393 (xpm_put_color_table_h):
17394 * lisp.h (struct Lisp_Hash_Table):
17395 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
17396 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
17397 for hashes and hash indexes, instead of 'unsigned' and 'int'.
17398 * alloc.c (allocate_vectorlike):
17399 Check for overflow in vector size calculations.
17400 * ccl.c (ccl_driver):
17401 Check for overflow when converting EMACS_INT to int.
17402 * fns.c, image.c: Remove unnecessary static decls that would otherwise
17403 need to be updated by these changes.
17404 * fns.c (make_hash_table, maybe_resize_hash_table):
17405 Check for integer overflow with large hash tables.
17406 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
17407 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
17408 (SXHASH_REDUCE): New macro.
17409 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
17410 Use it instead of discarding useful hash info with large hash values.
17411 (sxhash_float): New function.
17412 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
17413 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
17414 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
17415 Rewrite to use FIXNUM_BITS, as this simplifies things.
17416 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
17417 Adjust signatures to match updated version of code.
17418 (consing_since_gc): Now EMACS_INT, since a single hash table can
17419 use more than INT_MAX bytes.
17420
17421 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
17422
17423 Make it possible to build with GCC-4.6+ -O2 -flto.
17424
17425 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
17426
17427 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
17428
17429 * minibuf.c (get_minibuffer, read_minibuf_unwind):
17430 Call minibuffer-inactive-mode.
17431
17432 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
17433
17434 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
17435 Update dependencies.
17436
17437 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17438
17439 * data.c (init_data): Remove code for UTS, this system is not
17440 supported anymore.
17441
17442 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17443
17444 Don't force ./temacs to start in terminal mode.
17445
17446 * frame.c (make_initial_frame): Initialize faces in all cases, not
17447 only when CANNOT_DUMP is defined.
17448 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17449
17450 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17451
17452 * dispnew.c (add_window_display_history): Use const for the string
17453 pointer. Remove declaration, not needed.
17454
17455 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17456
17457 Use 'inline', not 'INLINE'.
17458 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
17459 * alloc.c, fontset.c (INLINE): Remove.
17460 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17461 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17462 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17463 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17464 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17465
17466 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17467
17468 Make it possible to run ./temacs.
17469
17470 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17471 syms_of_callproc does the same thing. Remove test for
17472 "initialized", do it in the caller.
17473 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17474
17475 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17476
17477 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
17478 (read_minibuf): Use get_minibuffer.
17479 (syms_of_minibuf): Use DEFSYM.
17480 (Qmetadata): New var.
17481 * data.c (Qbuffer): Don't make it static.
17482 (syms_of_data): Use DEFSYM.
17483
17484 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17485
17486 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17487 (CCL_CODE_MIN): New macro.
17488
17489 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17490
17491 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17492
17493 * eval.c (Qdebug): Now static.
17494 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17495 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17496 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17497
17498 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17499
17500 * image.c: Various fixes to ImageMagick code comments.
17501 (Fimagemagick_types): Doc fix.
17502
17503 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17504
17505 Minor fixes prompted by GCC 4.6.0 warnings.
17506
17507 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17508
17509 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17510 (x_clipboard_manager_save_all): Move extern decl to ...
17511 * xterm.h: ... here, so that it can be checked for consistency.
17512
17513 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17514
17515 * xselect.c (x_clipboard_manager_save_frame)
17516 (x_clipboard_manager_save_all): New functions.
17517 (Fx_clipboard_manager_save): Lisp function deleted.
17518
17519 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17520 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17521
17522 * xterm.h: Update prototype.
17523
17524 2011-05-28 William Xu <william.xwl@gmail.com>
17525
17526 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17527 exiting (Bug#8239).
17528
17529 2011-05-28 Jim Meyering <meyering@redhat.com>
17530
17531 Avoid a sign-extension bug in crypto_hash_function.
17532 * fns.c (to_uchar): Define.
17533 (crypto_hash_function): Use it to convert some newly-signed
17534 variables to unsigned, to avoid sign-extension bugs. For example,
17535 without this change, (md5 "truc") would evaluate to
17536 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17537 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
17538 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
17539
17540 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17541
17542 Integer overflow fixes.
17543
17544 * dbusbind.c: Serial number integer overflow fixes.
17545 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
17546 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17547 to hold a serial number that is too large for a fixnum.
17548 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17549 Check for serial numbers out of range. Decode any serial number
17550 that was so large that it became a float. (Bug#8722)
17551
17552 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17553 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17554 Use XFASTINT rather than XUINT when numbers are nonnegative.
17555 (xd_append_arg, Fdbus_method_return_internal):
17556 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17557 arguments, check that Lisp number is nonnegative, rather than
17558 silently wrapping negative numbers around. (Bug#8722)
17559 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
17560 (Bug#8722)
17561
17562 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17563
17564 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17565
17566 ccl: Add integer overflow checks.
17567 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17568 (IN_INT_RANGE): New macros.
17569 (ccl_driver): Use them to check for integer overflow when
17570 decoding a CCL program. Many of the new checks are whether XINT (x)
17571 fits in int; it doesn't always, on 64-bit hosts. The new version
17572 doesn't catch all possible integer overflows, but it's an
17573 improvement. (Bug#8719)
17574
17575 * alloc.c (make_event_array): Use XINT, not XUINT.
17576 There's no need for unsigned here.
17577
17578 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17579 This follows up to the 2011-05-06 change that substituted uintptr_t
17580 for EMACS_INT. This case wasn't caught back then.
17581
17582 Rework Fformat to avoid integer overflow issues.
17583 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17584 now (part of C89). Include <verify.h>.
17585 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17586 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17587 (Fformat): Avoid the prepass trying to compute sizes; it was only
17588 approximate and thus did not catch overflow reliably. Instead, walk
17589 through the format just once, formatting and computing sizes as we go,
17590 checking for integer overflow at every step, and allocating a larger
17591 buffer as needed. Keep track separately whether the format is
17592 multibyte. Keep only the most-recently calculated precision, rather
17593 than them all. Record whether each argument has been converted to
17594 string. Use EMACS_INT, not int, for byte and char and arg counts.
17595 Support field widths and precisions larger than INT_MAX. Avoid
17596 sprintf's undefined behavior with conversion specifications such as %#d
17597 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17598 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17599 formatting out-of-range floating point numbers with int
17600 formats. (Bug#8668)
17601
17602 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17603
17604 * data.c: Avoid integer truncation in expressions involving floats.
17605 * data.c: Include <intprops.h>.
17606 (arith_driver): When there's an integer overflow in an expression
17607 involving floating point, convert the integers to floating point
17608 so that the resulting value does not suffer from catastrophic
17609 integer truncation. For example, on a 64-bit host (* 4
17610 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17611 Do not rely on undefined behavior after integer overflow.
17612
17613 merge count_size_as_multibyte, parse_str_to_multibyte
17614 * character.c, character.h (count_size_as_multibyte):
17615 Rename from parse_str_to_multibyte; all uses changed.
17616 Check for integer overflow.
17617 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17618 since it's now a duplicate of the other. This is more of
17619 a character than a buffer op, so better that it's in character.c.
17620 * fns.c, print.c: Adjust to above changes.
17621
17622 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17623
17624 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17625
17626 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17627
17628 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17629 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17630 (x_clipboard_manager_save): Now static.
17631 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17632
17633 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17634 (crypto_hash_function): Now static.
17635 Fix pointer signedness problems. Avoid unnecessary initializations.
17636
17637 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
17638
17639 * termhooks.h (Vselection_alist): Make it terminal-local.
17640
17641 * terminal.c (create_terminal): Initialize it.
17642
17643 * xselect.c: Support for clipboard managers.
17644 (Vselection_alist): Move to termhooks.h as terminal-local var.
17645 (LOCAL_SELECTION): New macro.
17646 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17647 (symbol_to_x_atom): Remove gratuitous arg.
17648 (x_handle_selection_request, lisp_data_to_selection_data)
17649 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
17650 (x_own_selection, x_get_local_selection, x_convert_selection):
17651 New arg, specifying work frame. Use terminal-local Vselection_alist.
17652 (some_frame_on_display): Delete unused function.
17653 (Fx_own_selection_internal, Fx_get_selection_internal)
17654 (Fx_disown_selection_internal, Fx_selection_owner_p)
17655 (Fx_selection_exists_p): New optional frame arg.
17656 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17657 (x_handle_selection_clear): Don't treat other terminals with the
17658 same keyboard specially. Use the terminal-local Vselection_alist.
17659 (x_clear_frame_selections): Use Frun_hook_with_args.
17660
17661 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17662
17663 * xterm.h: Add support for those atoms.
17664
17665 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
17666
17667 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17668 (converted_selections, conversion_fail_tag): New global variables.
17669 (x_selection_request_lisp_error): Free the above.
17670 (x_get_local_selection): Remove unnecessary code.
17671 (x_reply_selection_request): Args changed; handle arbitrary array
17672 of converted selections stored in converted_selections.
17673 Separate the XChangeProperty and SelectionNotify steps.
17674 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17675 (x_convert_selection): New function.
17676 (x_handle_selection_event): Simplify.
17677 (x_get_foreign_selection): Don't ignore incoming requests while
17678 waiting for an answer; this will fail when we implement
17679 SAVE_TARGETS, and seems unnecessary anyway.
17680 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17681 (Vx_sent_selection_functions): Doc fix.
17682
17683 2011-05-26 Leo Liu <sdl.web@gmail.com>
17684
17685 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17686
17687 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17688
17689 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17690
17691 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17692 for fringe update if it has periodic bitmap.
17693 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
17694 and fringe_bitmap_periodic_p.
17695
17696 * fringe.c (get_fringe_bitmap_data): New function.
17697 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17698 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17699 row. Mark glyph row for fringe update if periodicity changed.
17700
17701 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17702 for fringe update unless it has periodic bitmap.
17703
17704 2011-05-25 Kenichi Handa <handa@m17n.org>
17705
17706 * xdisp.c (get_next_display_element): Set correct it->face_id for
17707 a static composition.
17708
17709 2011-05-24 Leo Liu <sdl.web@gmail.com>
17710
17711 * deps.mk (fns.o):
17712 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17713
17714 * fns.c (crypto_hash_function, Fsha1): New function.
17715 (Fmd5): Use crypto_hash_function.
17716 (syms_of_fns): Add Ssha1.
17717
17718 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17719
17720 * gnutls.c: Remove unused macros.
17721 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17722 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17723 Remove macros that are defined and never used.
17724 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17725
17726 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17727
17728 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17729 (Fx_get_selection_internal): Minor cleanup.
17730 (Fx_own_selection_internal): Rename arguments for consistency with
17731 select.el.
17732
17733 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17734
17735 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17736
17737 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17738
17739 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17740
17741 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17742
17743 * dispnew.c (scrolling_window): Don't exclude the case that the
17744 last enabled row in the desired matrix touches the bottom boundary.
17745
17746 2011-05-21 Glenn Morris <rgm@gnu.org>
17747
17748 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17749 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17750 and add some more files.
17751
17752 2011-05-20 Eli Zaretskii <eliz@gnu.org>
17753
17754 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17755 report_file_error introduced by the change from 2011-05-07.
17756
17757 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17758
17759 * systime.h (Time): Define only if emacs is defined.
17760 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17761 where the include path doesn't have X11/X.h by default. See
17762 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17763
17764 2011-05-20 Kenichi Handa <handa@m17n.org>
17765
17766 * composite.c (find_automatic_composition): Fix previous change.
17767
17768 2011-05-20 Glenn Morris <rgm@gnu.org>
17769
17770 * lisp.mk: New file, split from Makefile.in.
17771 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17772 (shortlisp): Remove.
17773 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17774
17775 2011-05-19 Glenn Morris <rgm@gnu.org>
17776
17777 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17778 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17779 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17780 (lisp): Set the order to that of loadup.el.
17781 (shortlisp): Make it a copy of $lisp.
17782 (SOME_MACHINE_LISP): Remove.
17783 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17784 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17785
17786 2011-05-18 Kenichi Handa <handa@m17n.org>
17787
17788 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17789 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17790 (find_automatic_composition): Mostly rewrite for efficiency.
17791
17792 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
17793
17794 * makefile.w32-in: Update dependencies.
17795
17796 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17797
17798 * menu.c: Include limits.h (fixes the MS-Windows build broken by
17799 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17800
17801 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
17802
17803 Fix some integer overflow issues, such as string length overflow.
17804
17805 * insdel.c (count_size_as_multibyte): Check for string overflow.
17806
17807 * character.c (lisp_string_width): Check for string overflow.
17808 Use EMACS_INT, not int, for string indexes and lengths; in
17809 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17810 the resulting string length overflows an EMACS_INT; instead,
17811 report a string overflow if no precision given. When checking for
17812 precision exhaustion, use a check that cannot possibly have
17813 integer overflow. (Bug#8675)
17814 * character.h (lisp_string_width): Adjust to new signature.
17815
17816 * alloc.c (string_overflow): New function.
17817 (Fmake_string): Use it. This doesn't change behavior, but saves
17818 a few bytes and will simplify future changes.
17819 * character.c (string_escape_byte8): Likewise.
17820 * lisp.h (string_overflow): New decl.
17821
17822 Fixups, following up to the user-interface timestamp change.
17823 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17824 for UI timestamps, instead of unsigned long.
17825 * msdos.c (mouse_get_pos): Likewise.
17826 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17827 * w32gui.h (Time): Define by including "systime.h" rather than by
17828 declaring it ourselves. (Bug#8664)
17829
17830 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17831 * image.c (clear_image_cache): Likewise.
17832
17833 * term.c (term_mouse_position): Don't assume time_t wraparound.
17834
17835 Be more systematic about user-interface timestamps.
17836 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17837 and sometimes 'EMACS_UINT', to represent these timestamps.
17838 This change causes it to use 'Time' uniformly, as that's what X uses.
17839 This makes the code easier to follow, and makes it easier to catch
17840 integer overflow bugs such as Bug#8664.
17841 * frame.c (Fmouse_position, Fmouse_pixel_position):
17842 Use Time, not unsigned long, for user-interface timestamps.
17843 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17844 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17845 * keyboard.h (last_event_timestamp): Likewise.
17846 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17847 * menu.h (xmenu_show): Likewise.
17848 * term.c (term_mouse_position): Likewise.
17849 * termhooks.h (struct input_event.timestamp): Likewise.
17850 (struct terminal.mouse_position_hook): Likewise.
17851 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17852 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17853 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17854 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17855 what it was before.
17856 * menu.h, termhooks.h: Include "systime.h", for Time.
17857
17858 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17859 Don't assume that the difference between two unsigned long values
17860 can fit into an integer. At this point, we know button_down_time
17861 <= event->timestamp, so the difference must be nonnegative, so
17862 there's no need to cast the result if double-click-time is
17863 nonnegative, as it should be; check that it's nonnegative, just in
17864 case. This bug is triggered when events are more than 2**31 ms
17865 apart (about 25 days). (Bug#8664)
17866
17867 * xselect.c (last_event_timestamp): Remove duplicate decl.
17868 (x_own_selection): Remove needless cast to unsigned long.
17869
17870 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17871 that always fit in int. Use a sentinel instead of a counter, to
17872 avoid a temp and to allay GCC's concerns about possible int overflow.
17873 * frame.h (struct frame): Use int for menu_bar_items_used
17874 instead of EMACS_INT, since it always fits in int.
17875
17876 * menu.c (grow_menu_items): Check for int overflow.
17877
17878 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17879
17880 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17881 Before, the code was not consistent. These values cannot exceed
17882 2**31 - 1 so there's no need to make them unsigned.
17883 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17884 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17885 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17886 as modifiers.
17887 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17888
17889 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17890 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17891 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17892 presumably because the widths might not match.
17893
17894 * window.c (size_window): Avoid needless test at loop start.
17895
17896 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17897
17898 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17899
17900 2011-05-12 Drew Adams <drew.adams@oracle.com>
17901
17902 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17903
17904 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17905
17906 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17907 `width' to `bar_area_x' and `bar_area_width', respectively.
17908 (x_scroll_run): Take account of fringe background extension.
17909
17910 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17911 Rename local vars `left' and `width' to `bar_area_x' and
17912 `bar_area_width', respectively.
17913 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17914 background extension.
17915
17916 2011-05-10 Jim Meyering <meyering@redhat.com>
17917
17918 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17919
17920 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17921
17922 * image.c (Finit_image_library): Return t for built-in image types,
17923 like pbm and xbm. (Bug#8640)
17924
17925 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17926
17927 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17928
17929 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17930
17931 * w32console.c (Fset_screen_color): Doc fix.
17932 (Fget_screen_color): New function.
17933 (syms_of_ntterm): Defsubr it.
17934
17935 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17936 unlink the temporary file if Fcall_process didn't create it in the
17937 first place.
17938 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17939 child process will be redirected to a file specified with `:file'.
17940 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17941 cue to call_process_cleanup not to close that handle.
17942
17943 2011-05-07 Ben Key <bkey76@gmail.com>
17944
17945 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17946 one of two shell specific rules, either bootstrap-temacs-CMD or
17947 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17948 to the previous implementation of the bootstrap-temacs rule.
17949 The bootstrap-temacs-CMD rule is similar to the previous
17950 implementation of the bootstrap-temacs rule except that it
17951 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17952 variable.
17953
17954 These changes, along with some changes to nt/configure.bat,
17955 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17956 earlier fix to add support for --cflags and --ldflags options
17957 that include quotes so that it works whether make uses cmd or
17958 sh as the shell.
17959
17960 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17961
17962 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17963 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17964 is a constant.
17965 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17966 a string. Handle both cases.
17967 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17968 (Fdbus_register_method): Use Qinvalid_function.
17969
17970 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17971
17972 * makefile.w32-in: Update dependencies.
17973 (LISP_H): Add inttypes.h and stdin.h.
17974 (PROCESS_H): Add unistd.h.
17975
17976 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17977
17978 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17979 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17980
17981 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17982
17983 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17984
17985 * term.c (vfatal): Remove stray call to va_end.
17986 It's not needed and the C Standard doesn't allow it here anyway.
17987
17988 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17989 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17990
17991 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17992 bytes.
17993
17994 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17995
17996 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17997
17998 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17999
18000 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
18001
18002 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
18003
18004 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
18005 * charset.c (Fdefine_charset_internal): Don't initialize
18006 charset.code_space[15]. The value was garbage, on hosts with
18007 32-bit int (Bug#8600).
18008
18009 * lread.c (read_integer): Be more consistent with string-to-number.
18010 Use string_to_number to do the actual conversion; this avoids
18011 rounding errors and fixes some other screwups. Without this fix,
18012 for example, #x1fffffffffffffff was misread as -2305843009213693952.
18013 (digit_to_number): Move earlier, for benefit of read_integer.
18014 Return -1 if the digit is out of range for the base, -2 if it is
18015 not a digit in any supported base. (Bug#8602)
18016
18017 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
18018
18019 * dispnew.c (scrolling_window): Return 1 if we scrolled,
18020 to match comment at start of function. This also removes a
18021 GCC warning about overflow in a 32+64-bit port.
18022
18023 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
18024
18025 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
18026 Reported by Stefan Monnier in
18027 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
18028 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18029 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
18030
18031 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
18032 (EMACS_UINTPTR): Likewise, with uintptr_t.
18033
18034 * lisp.h: Prefer 64-bit EMACS_INT if available.
18035 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
18036 on 32-bit hosts that have 64-bit int, so that they can access
18037 large files.
18038 However, temporarily disable this change unless the temporary
18039 symbol WIDE_EMACS_INT is defined.
18040
18041 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
18042
18043 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
18044 This removes an assumption that EMACS_INT and long are the same
18045 width as pointers. The assumption is true for Emacs porting targets
18046 now, but we want to make other targets possible.
18047 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
18048 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
18049 In the rest of the code, change types of integers that hold casted
18050 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
18051 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
18052 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
18053 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
18054 No need to cast type when ORing.
18055 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
18056 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
18057 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
18058 assume EMACS_INT is the same width as char *.
18059 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
18060 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
18061 Remove no-longer-needed casts.
18062 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
18063 (xg_tool_bar_help_callback, xg_make_tool_item):
18064 Use EMACS_INTPTR to hold an integer
18065 that will be cast to void *; this can avoid a GCC warning
18066 if EMACS_INT is not the same width as void *.
18067 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
18068 * xdisp.c (display_echo_area_1, resize_mini_window_1):
18069 (current_message_1, set_message_1):
18070 Use a local to convert to proper width without a cast.
18071 * xmenu.c (dialog_selection_callback): Likewise.
18072
18073 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
18074 Also, don't assume VALBITS / RAND_BITS is less than 5,
18075 and don't rely on undefined behavior when shifting a 1 left into
18076 the sign bit.
18077 * lisp.h (get_random): Change signature to match.
18078
18079 * lread.c (hash_string): Use size_t, not int, for hash computation.
18080 Normally we prefer signed values; but hashing is special, because
18081 it's better to use unsigned division on hash table sizes so that
18082 the remainder is nonnegative. Also, size_t is the natural width
18083 for hashing into memory. The previous code used 'int', which doesn't
18084 retain enough info to hash well into very large tables.
18085 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
18086
18087 * dbusbind.c: Don't possibly lose pointer info when converting.
18088 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18089 Use XPNTR rather than XHASH, so that the high-order bits of
18090 the pointer aren't lost when converting through void *.
18091
18092 * eval.c (Fautoload): Don't double-shift a pointer.
18093
18094 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
18095
18096 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
18097
18098 * gnutls.c (DEF_GNUTLS_FN):
18099 * image.c (DEF_IMGLIB_FN): Make function pointers static.
18100
18101 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
18102
18103 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
18104 marker. (Bug#8610)
18105
18106 2011-05-05 Eli Zaretskii <eliz@gnu.org>
18107
18108 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
18109 New version that can reserve upto 2GB of heap space.
18110
18111 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
18112
18113 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
18114
18115 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
18116
18117 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
18118 `gnutls_certificate_set_x509_key_file'.
18119
18120 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
18121
18122 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
18123 Update dependencies.
18124
18125 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18126
18127 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
18128 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
18129 Remove unused parameter `fildes'.
18130 * process.c (read_process_output, send_process): Don't pass it.
18131
18132 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18133
18134 Fix previous change: the library cache is defined in w32.c.
18135 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
18136 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
18137
18138 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18139
18140 Implement dynamic loading of GnuTLS on Windows.
18141
18142 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
18143 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
18144 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18145 Declare.
18146
18147 * gnutls.c (Qgnutls_dll): Define.
18148 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
18149 (gnutls_*): Declare function pointers.
18150 (init_gnutls_functions): New function to initialize function pointers.
18151 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
18152 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
18153 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18154 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
18155 (emacs_gnutls_write, emacs_gnutls_read)
18156 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
18157 (Fgnutls_available_p): New function.
18158 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
18159 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
18160 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
18161
18162 * image.c: Include w32.h.
18163 (Vimage_type_cache): Delete.
18164 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
18165 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
18166 (w32_delayed_load): Move to w32.c.
18167
18168 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
18169
18170 * w32.c (QCloaded_from, Vlibrary_cache): Define.
18171 (w32_delayed_load): Move from image.c. When loading a library, record
18172 its filename in the :loaded-from property of the library id.
18173 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
18174 Initialize and staticpro them.
18175 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
18176
18177 * process.c: Include lisp.h before w32.h, not after.
18178 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
18179 instead of gnutls_record_check_pending.
18180
18181 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
18182
18183 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
18184
18185 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
18186 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
18187 as passed in.
18188
18189 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
18190
18191 * xterm.c (x_set_frame_alpha): Do not set property on anything
18192 else than FRAME_X_OUTER_WINDOW (Bug#8608).
18193
18194 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
18195
18196 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
18197
18198 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
18199
18200 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
18201 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
18202 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
18203 (gnutls_global_initialized, Qgnutls_bootprop_priority)
18204 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
18205 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
18206 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
18207 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
18208 (Qgnutls_bootprop_callbacks_verify): Make static.
18209
18210 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
18211
18212 * callproc.c: Indentation fixup.
18213
18214 * sysdep.c (wait_for_termination_1): Make static.
18215 (wait_for_termination, interruptible_wait_for_termination):
18216 Move after wait_for_termination_1.
18217
18218 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
18219
18220 * sysdep.c (interruptible_wait_for_termination): New function
18221 which is like wait_for_termination, but allows keyboard
18222 interruptions.
18223
18224 * callproc.c (Fcall_process): Add (:file "file") as an option for
18225 the STDOUT buffer.
18226 (Fcall_process_region): Ditto.
18227
18228 2011-04-30 Eli Zaretskii <eliz@gnu.org>
18229
18230 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
18231 rather than `XVECTOR (FOO)->size'.
18232
18233 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
18234 inttypes.h, as a gnulib replacement is used if it not available in
18235 system headers.
18236
18237 2011-04-21 Eli Zaretskii <eliz@gnu.org>
18238
18239 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
18240 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
18241 of MOST_POSITIVE_FIXNUM. (Bug#8528)
18242
18243 * coding.c (coding_alloc_by_realloc): Error out if destination
18244 will grow beyond MOST_POSITIVE_FIXNUM.
18245 (decode_coding_emacs_mule): Abort if there isn't enough place in
18246 charbuf for the composition carryover bytes. Reserve an extra
18247 space for up to 2 characters produced in a loop.
18248 (decode_coding_iso_2022): Abort if there isn't enough place in
18249 charbuf for the composition carryover bytes.
18250
18251 2011-04-21 Eli Zaretskii <eliz@gnu.org>
18252
18253 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
18254 aborting when %lld or %lll format is passed.
18255 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
18256 %llo or %llx format is passed. (Bug#8545)
18257
18258 * window.c (window_scroll_line_based): Use a marker instead of
18259 simple variables to record original value of point. (Bug#7952)
18260
18261 * doprnt.c (doprnt): Fix the case where a multibyte sequence
18262 produced by %s or %c overflows available buffer space. (Bug#8545)
18263
18264 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
18265
18266 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
18267 (SIZE_MAX): Move defn after all includes, as they might #define it.
18268
18269 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18270
18271 * w32.c (init_environment): Warn about defaulting HOME to C:\.
18272
18273 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18274
18275 * keyboard.c (Qdelayed_warnings_hook): Define.
18276 (command_loop_1): Run `delayed-warnings-hook'
18277 if Vdelayed_warnings_list is non-nil.
18278 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
18279 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
18280
18281 2011-04-28 Eli Zaretskii <eliz@gnu.org>
18282
18283 * doprnt.c (doprnt): Don't return value smaller than the buffer
18284 size if the message was truncated. (Bug#8545).
18285
18286 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18287
18288 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
18289 (Fx_window_property): #if-0 the whole functions, not just the bodies.
18290
18291 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18292
18293 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
18294
18295 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
18296
18297 * makefile.w32-in: Update dependencies.
18298
18299 2011-04-27 Eli Zaretskii <eliz@gnu.org>
18300
18301 Improve `doprnt' and its usage. (Bug#8545)
18302 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
18303 `format_end'. Remove support for %l as a conversion specifier.
18304 Don't use xrealloc. Improve diagnostics when the %l size modifier
18305 is used. Update the commentary.
18306
18307 * eval.c (verror): Simplify calculation of size_t.
18308
18309 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
18310 messages.
18311
18312 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
18313
18314 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
18315 change.
18316
18317 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18318
18319 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
18320 This makes this file independent of the recent pseudovector change.
18321
18322 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
18323
18324 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
18325
18326 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
18327 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
18328 Remove unused local.
18329 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
18330
18331 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
18332 GCC 4.6.0 optimizes based on type-based alias analysis.
18333 For example, if b is of type struct buffer * and v of type struct
18334 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
18335 != &v->size, and therefore "v->size = 1; b->size = 2; return
18336 v->size;" must therefore return 1. This assumption is incorrect
18337 for Emacs, since it type-puns struct Lisp_Vector * with many other
18338 types. To fix this problem, this patch adds a new type struct
18339 vectorlike_header that documents the constraints on layout of vectors
18340 and pseudovectors, and helps optimizing compilers not get fooled
18341 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
18342 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
18343 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
18344 the size member.
18345 (XSETPVECTYPE): Rewrite in terms of new macro.
18346 (XSETPVECTYPESIZE): New macro, specifying both type and size.
18347 This is a bit clearer, and further avoids the possibility of
18348 undesirable aliasing.
18349 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
18350 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
18351 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
18352 since Lisp_Subr is a special case (no "next" field).
18353 (ASIZE): Now uses header.size rather than size.
18354 All previous uses of XVECTOR (foo)->size replaced to use this macro,
18355 to avoid the hassle of writing XVECTOR (foo)->header.size.
18356 (struct vectorlike_header): New type.
18357 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
18358 object, to help avoid aliasing.
18359 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
18360 (SUBRP): Likewise, since Lisp_Subr is a special case.
18361 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
18362 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
18363 (struct Lisp_Hash_Table): Combine first two members into a single
18364 struct vectorlike_header member. All uses of "size" and "next" members
18365 changed to be "header.size" and "header.next".
18366 * buffer.h (struct buffer): Likewise.
18367 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
18368 * frame.h (struct frame): Likewise.
18369 * process.h (struct Lisp_Process): Likewise.
18370 * termhooks.h (struct terminal): Likewise.
18371 * window.c (struct save_window_data, struct saved_window): Likewise.
18372 * window.h (struct window): Likewise.
18373 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
18374 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
18375 * buffer.c (init_buffer_once): Likewise.
18376 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
18377 special case.
18378 * process.c (Fformat_network_address): Use local var for size,
18379 for brevity.
18380
18381 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
18382
18383 Make the Lisp reader and string-to-float more consistent (Bug#8525)
18384 * data.c (atof): Remove decl; no longer used or needed.
18385 (digit_to_number): Move to lread.c.
18386 (Fstring_to_number): Use new string_to_number function, to be
18387 consistent with how the Lisp reader treats infinities and NaNs.
18388 Do not assume that floating-point numbers represent EMACS_INT
18389 without losing information; this is not true on most 64-bit hosts.
18390 Avoid double-rounding errors, by insisting on integers when
18391 parsing non-base-10 numbers, as the documentation specifies.
18392 * lisp.h (string_to_number): New decl, replacing ...
18393 (isfloat_string): Remove.
18394 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
18395 (read1): Do not accept +. and -. as integers; this
18396 appears to have been a coding error. Similarly, do not accept
18397 strings like +-1e0 as floating point numbers. Do not report
18398 overflow for integer overflows unless the base is not 10 which
18399 means we have no simple and reliable way to continue.
18400 Break out the floating-point parsing into a new
18401 function string_to_number, so that Fstring_to_number parses
18402 floating point numbers consistently with the Lisp reader.
18403 (digit_to_number): Move here from data.c. Make it static inline.
18404 (E_CHAR, EXP_INT): Remove, replacing with ...
18405 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
18406 (string_to_number): New function, replacing isfloat_string.
18407 This function checks for valid syntax and produces the resulting
18408 Lisp float number too. Rework it so that string-to-number
18409 no longer mishandles examples like "1.0e+". Use strtoumax,
18410 so that overflow for non-base-10 numbers is reported only when
18411 there's no portable and simple way to convert to floating point.
18412
18413 * textprop.c (set_text_properties_1): Rewrite for clarity,
18414 and to avoid GCC warning about integer overflow.
18415
18416 * intervals.h (struct interval): Use EMACS_INT for members
18417 where EMACS_UINT might cause problems. See
18418 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
18419 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
18420 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
18421 All uses changed.
18422 (offset_intervals): Tell GCC not to worry about length overflow
18423 when negating a negative length.
18424
18425 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
18426 (overrun_check_free): Likewise.
18427
18428 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
18429 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
18430 word size.
18431
18432 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18433 (gnutls_make_error): Rename local to avoid shadowing.
18434 (gnutls_emacs_global_deinit): ifdef out; not used.
18435 (Fgnutls_boot): Use const for pointer to readonly storage.
18436 Comment out unused local. Fix pointer signedness problems.
18437
18438 * lread.c (openp): Don't stuff size_t into an 'int'.
18439 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
18440 about possible signed overflow.
18441
18442 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18443 (GDK_KEY_g): Don't define if already defined.
18444 (xg_prepare_tooltip): Avoid pointer signedness problem.
18445 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18446
18447 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18448 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18449
18450 * xfns.c (Fx_window_property): Simplify a bit,
18451 to make a bit faster and to avoid GCC 4.6.0 warning.
18452 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18453
18454 * fns.c (internal_equal): Don't assume size_t fits in int.
18455
18456 * alloc.c (compact_small_strings): Tighten assertion a little.
18457
18458 Replace pEd with more-general pI, and fix some printf arg casts.
18459 * lisp.h (pI): New macro, generalizing old pEd macro to other
18460 conversion specifiers. For example, use "...%"pI"d..." rather
18461 than "...%"pEd"...".
18462 (pEd): Remove. All uses replaced with similar uses of pI.
18463 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
18464 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18465 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18466 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18467 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18468 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18469 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18470 64-bit hosts.
18471 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18472 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18473 * print.c (safe_debug_print, print_object): Likewise.
18474 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18475 to int.
18476 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18477 avoiding the 0 flag, which is not portable.
18478 * process.c (Fmake_network_process): Use pI to avoid cast.
18479 * region-cache.c (pp_cache): Likewise.
18480 * xdisp.c (decode_mode_spec): Likewise.
18481 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18482 behavior on 64-bit hosts with printf arg.
18483 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
18484 (x_stop_queuing_selection_requests): Likewise.
18485 (x_get_window_property): Don't truncate byte count to an 'int'
18486 when tracing.
18487
18488 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18489 here, since it parses constructs like leading '-' and spaces,
18490 which are not wanted; and it overflows with large numbers.
18491 Instead, simply match F[0-9]+, which is what is wanted anyway.
18492
18493 * alloc.c: Remove unportable assumptions about struct layout.
18494 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18495 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18496 (allocate_vectorlike, make_pure_vector): Use the new macros,
18497 plus offsetof, to remove unportable assumptions about struct layout.
18498 These assumptions hold on all porting targets that I know of, but
18499 they are not guaranteed, they're easy to remove, and removing them
18500 makes further changes easier.
18501
18502 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18503 This doesn't fix a bug but makes the code clearer.
18504 (string_overrun_cookie): Now const. Use initializers that
18505 don't formally overflow signed char, to avoid warnings.
18506 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18507 can cause Emacs to crash when string overrun checking is enabled.
18508 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18509 multiple of sizeof (EMACS_INT); it need not be, if
18510 alignof(EMACS_INT) < sizeof (EMACS_INT).
18511 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
18512
18513 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
18514
18515 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18516
18517 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18518
18519 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
18520 supposed to be handshaking. (Bug#8556)
18521 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18522
18523 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
18524
18525 * lisp.h (Qdebug): List symbol.
18526 * eval.c (Qdebug): Restore global linkage.
18527 * keyboard.c (debug-on-event): New variable.
18528 (handle_user_signal): Break into debugger when debug-on-event
18529 matches the current signal symbol.
18530
18531 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18532
18533 * alloc.c (check_sblock, check_string_bytes)
18534 (check_string_free_list): Convert to standard C.
18535
18536 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18537
18538 * w32.c (emacs_gnutls_push): Fix typo.
18539
18540 2011-04-25 Eli Zaretskii <eliz@gnu.org>
18541
18542 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18543 "cast to pointer from integer of different size".
18544
18545 Improve doprnt and its use in verror. (Bug#8545)
18546 * doprnt.c (doprnt): Document the set of format control sequences
18547 supported by the function. Use SAFE_ALLOCA instead of always
18548 using `alloca'.
18549
18550 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18551 is one byte too soon. Don't use xrealloc; instead xfree and
18552 xmalloc anew.
18553
18554 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18555
18556 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18557 callbacks stage.
18558
18559 * gnutls.c: Renamed global_initialized to
18560 gnutls_global_initialized. Added internals for the
18561 :verify-hostname-error, :verify-error, and :verify-flags
18562 parameters of `gnutls-boot' and documented those parameters in the
18563 docstring. Start callback support.
18564 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18565 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18566 on error. Return error code.
18567 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18568 (emacs_gnutls_read): Likewise.
18569 (Fgnutls_boot): Return handshake error code.
18570 (emacs_gnutls_handle_error): New function.
18571 (wsaerror_to_errno): Likewise.
18572
18573 * w32.h (emacs_gnutls_pull): Add prototype.
18574 (emacs_gnutls_push): Likewise.
18575
18576 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18577 (emacs_gnutls_push): Likewise.
18578
18579 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18580
18581 * process.c (wait_reading_process_output): Check if GnuTLS
18582 buffered some data internally if no FDs are set for TLS
18583 connections.
18584
18585 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18586 (LIBS): Link to USER_LIBS.
18587 ($(BLD)/gnutls.$(0)): New target.
18588
18589 2011-04-24 Eli Zaretskii <eliz@gnu.org>
18590
18591 * xdisp.c (handle_single_display_spec): Rename the
18592 display_replaced_before_p argument into display_replaced_p, to
18593 make it consistent with the commentary. Fix typos in the
18594 commentary.
18595
18596 * textprop.c (syms_of_textprop): Remove dead code.
18597 (copy_text_properties): Delete obsolete commentary about an
18598 interface that was deleted long ago. Fix typos in the description
18599 of arguments.
18600
18601 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18602 to changes in oldXMenu/XMenu.h from 2011-04-16.
18603 <menu_help_message, prev_menu_help_message>: Constify.
18604 (IT_menu_make_room): menu->help_text is now `const char **';
18605 adjust.
18606
18607 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18608 to changes in oldXMenu/XMenu.h from 2011-04-16.
18609 (struct XMenu): Declare `help_text' `const char **'.
18610
18611 * xfaces.c <Qunspecified>: Make extern again.
18612
18613 * syntax.c: Include sys/types.h before including regex.h, as
18614 required by POSIX.
18615
18616 * doc.c (get_doc_string): Improve the format passed to `error'.
18617
18618 * doprnt.c (doprnt): Improve commentary.
18619
18620 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18621
18622 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18623 them with etags.
18624
18625 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18626 changes in globals.h immediately force recompilation.
18627 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18628 $(CURDIR)/s/ms-w32.h.
18629 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
18630
18631 * character.c (Fchar_direction): Function deleted.
18632 (syms_of_character): Don't defsubr it.
18633 <char-direction-table>: Deleted.
18634
18635 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18636
18637 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18638 * doprnt.c: Include limits.h.
18639 (SIZE_MAX): New macro.
18640 (doprnt): Return a size_t value. 2nd arg is now size_t.
18641 Many local variables are now size_t instead of int or unsigned.
18642 Improve overflow protection. Support `l' modifier for integer
18643 conversions. Support %l conversion. Don't assume an EMACS_INT
18644 argument for integer conversions and for %c.
18645
18646 * lisp.h (doprnt): Restore prototype.
18647
18648 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18649 $(SRC)/character.h.
18650
18651 * Makefile.in (base_obj): Add back doprnt.o.
18652
18653 * deps.mk (doprnt.o): Add back prerequisites.
18654 (callint.o): Depend on character.h.
18655
18656 * eval.c (internal_lisp_condition_case): Include the handler
18657 representation in the error message.
18658 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18659 when breaking from the loop.
18660
18661 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18662
18663 * callint.c (Fcall_interactively): When displaying error message
18664 about invalid control letter, pass the character's codepoint, not
18665 a pointer to its multibyte form. Improve display of the character
18666 in octal and display also its hex code.
18667
18668 * character.c (char_string): Use %x to display the (unsigned)
18669 codepoint of an invalid character, to avoid displaying a bogus
18670 negative value.
18671
18672 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18673 `error', not SYMBOL_NAME itself.
18674
18675 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18676 character arguments to `error'.
18677
18678 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18679 to `error' in error message about FINAL_CHAR argument. Make sure
18680 FINAL_CHAR is a character, and use %c when it is passed as
18681 argument to `error'.
18682
18683 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18684
18685 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18686
18687 * w32.c: Include <time.h>.
18688 (sys_localtime): New function.
18689
18690 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
18691
18692 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18693
18694 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
18695
18696 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
18697
18698 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18699 zombies (Bug#8467).
18700
18701 2011-04-19 Eli Zaretskii <eliz@gnu.org>
18702
18703 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18704 gl_state.e_property when gl_state.object is Qt.
18705
18706 * insdel.c (make_gap_larger): Remove limitation of buffer size
18707 to <= INT_MAX.
18708
18709 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
18710
18711 * xdisp.c (lookup_glyphless_char_display)
18712 (produce_glyphless_glyph): Handle cons cell entry in
18713 glyphless-char-display.
18714 (Vglyphless_char_display): Document it.
18715
18716 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18717 glyphless-char-display.
18718
18719 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
18720
18721 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18722
18723 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18724
18725 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18726 definition for no-X builds.
18727
18728 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
18729
18730 Static checks with GCC 4.6.0 and non-default toolkits.
18731
18732 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18733
18734 * process.c (keyboard_bit_set): Define only if SIGIO.
18735 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18736 (send_process): Repair possible setjmp clobbering.
18737
18738 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18739
18740 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18741
18742 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18743
18744 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18745 Define only if needed.
18746
18747 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18748 by pacifying GCC about it. Maybe it's time to retire it?
18749 * xfaces.c (USG, __TIMEVAL__): Likewise.
18750
18751 * dispextern.h (struct redisplay_interface): Rename param
18752 to avoid shadowing.
18753 * termhooks.h (struct terminal): Likewise.
18754 * xterm.c (xembed_send_message): Likewise.
18755
18756 * insdel.c (make_gap_smaller): Define only if
18757 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18758
18759 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18760 it.
18761
18762 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18763 so that we aren't warned about unused symbols.
18764
18765 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18766
18767 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18768
18769 * xfns.c (x_real_positions): Mark locals as initialized.
18770
18771 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18772
18773 * xterm.c: Fix problems found by static analysis with other toolkits.
18774 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18775 (x_dispatch_event): Declare static if USE_GTK, and
18776 define if USE_GTK || USE_X_TOOLKIT.
18777 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18778 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18779 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18780 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18781
18782 * xmenu.c (menu_help_callback): Pointer type fixes.
18783 Use const pointers when pointing at readonly data. Avoid pointer
18784 signedness clashes.
18785 (FALSE): Remove unused macro.
18786 (update_frame_menubar): Remove unused decl.
18787
18788 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18789
18790 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18791 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18792 (single_menu_item): Rename local to avoid shadowing.
18793
18794 * keyboard.c (make_lispy_event): Remove unused local var.
18795
18796 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18797 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18798
18799 * bitmaps: Change bitmaps from unsigned char back to the X11
18800 compatible char. Avoid the old compiler warnings about
18801 out-of-range initializers by using, for example, '\xab' rather
18802 than 0xab.
18803
18804 * xgselect.c (xgselect_initialize): Check vs interface
18805 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18806
18807 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18808
18809 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18810 to read-only memory.
18811
18812 * fns.c (vector): Remove; this old hack is no longer needed.
18813
18814 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18815 Remove unused var.
18816 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18817
18818 * xrdb.c (x_load_resources): Omit unused local.
18819
18820 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18821 (x_window): Rename locals to avoid shadowing.
18822 (USG): Use the kludged USG macro, to pacify gcc.
18823
18824 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18825 (x_term_init): Remove local to avoid shadowing.
18826
18827 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18828
18829 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18830 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18831
18832 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18833
18834 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18835
18836 Fix regex.c, syntax.c and friends for buffers > 2GB.
18837 * syntax.h (struct gl_state_s): Declare character position members
18838 EMACS_INT.
18839
18840 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18841
18842 * textprop.c (verify_interval_modification, interval_of):
18843 Declare arguments EMACS_INT.
18844
18845 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18846 EMACS_INT.
18847
18848 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18849
18850 * indent.c (Fvertical_motion): Local variable it_start is now
18851 EMACS_INT.
18852
18853 * regex.c (re_match, re_match_2, re_match_2_internal)
18854 (bcmp_translate, regcomp, regexec, print_double_string)
18855 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18856 (re_compile_pattern, re_exec): Declare arguments and local
18857 variables `size_t' and `ssize_t' and return values `regoff_t', as
18858 appropriate.
18859 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18860 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18861 <compile_stack_type>: `size' and `avail' are now `size_t'.
18862
18863 * regex.h <regoff_t>: Use ssize_t, not int.
18864 (re_search, re_search_2, re_match, re_match_2): Arguments that
18865 specify buffer/string position and length are now ssize_t and
18866 size_t. Return type is regoff_t.
18867
18868 2011-04-16 Ben Key <bkey76@gmail.com>
18869
18870 * nsfont.m: Fixed bugs in ns_get_family and
18871 ns_descriptor_to_entity that were caused by using free to
18872 deallocate memory blocks that were allocated by xmalloc (via
18873 xstrdup). This caused Emacs to crash when compiled with
18874 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18875 --enable-checking=xmallocoverrun). xfree is now used to
18876 deallocate these memory blocks.
18877
18878 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18879
18880 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18881
18882 emacs_write: Accept and return EMACS_INT for sizes.
18883 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18884 et seq.
18885 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18886 Accept and return EMACS_INT.
18887 (emacs_gnutls_write): Return the number of bytes written on
18888 partial writes.
18889 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18890 (emacs_read, emacs_write): Remove check for negative size, as the
18891 Emacs source code has been audited now.
18892 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18893 (emacs_read, emacs_write): Use it.
18894 * process.c (send_process): Adjust to the new signatures of
18895 emacs_write and emacs_gnutls_write. Do not attempt to store
18896 a byte offset into an 'int'; it might overflow.
18897 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18898
18899 * sound.c: Don't assume sizes fit in 'int'.
18900 (struct sound_device.period_size, alsa_period_size):
18901 Return EMACS_INT, not int.
18902 (struct sound_device.write, vox_write, alsa_write):
18903 Accept EMACS_INT, not int.
18904 (wav_play, au_play): Use EMACS_INT to store sizes and to
18905 record read return values.
18906
18907 2011-04-15 Ben Key <bkey76@gmail.com>
18908
18909 * keyboard.c (Qundefined): Don't declare static since it is used
18910 in nsfns.m.
18911 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18912 static since they are used in nsfont.m.
18913
18914 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18915
18916 * process.c (Qprocessp): Don't declare static.
18917 * lisp.h (Qprocessp): Declare again.
18918
18919 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18920
18921 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18922
18923 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18924
18925 Improve C-level modularity by making more things 'static'.
18926
18927 Don't publish debugger-only interfaces to other modules.
18928 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18929 (verify_bytepos, count_markers): Move decls to the only modules
18930 that need them.
18931 * region-cache.h (pp_cache): Likewise.
18932 * window.h (check_all_windows): Likewise.
18933 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18934
18935 * sysdep.c (croak): Now static, if
18936 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18937 * syssignal.h (croak): Declare only if not static.
18938
18939 * alloc.c (refill_memory_reserve): Now static if
18940 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18941 * lisp.h (refill_memory_reserve): Declare only if not static.
18942
18943 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18944 Define only if USE_LUCID.
18945
18946 * xrdb.c (x_customization_string, x_rm_string): Now static.
18947
18948 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18949 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18950
18951 * xdisp.c (draw_row_with_mouse_face): Now static.
18952 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18953
18954 * window.h (check_all_windows): Mark externally visible.
18955
18956 * window.c (window_deletion_count): Now static.
18957
18958 * undo.c: Make symbols static if they're not exported.
18959 (last_undo_buffer, last_boundary_position, pending_boundary):
18960 Now static.
18961
18962 * textprop.c (interval_insert_behind_hooks): Now static.
18963 (interval_insert_in_front_hooks): Likewise.
18964
18965 * term.c: Make symbols static if they're not exported.
18966 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18967 (max_frame_lines, tty_set_terminal_modes):
18968 (tty_reset_terminal_modes, tty_turn_off_highlight):
18969 (get_tty_terminal): Now static.
18970 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18971 * termhooks.h (term_mouse_moveto): Do not declare if
18972 HAVE_WINDOW_SYSTEM.
18973 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18974 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18975
18976 * sysdep.c: Make symbols static if they're not exported.
18977 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18978 Now static.
18979 (sigprocmask_set, full_mask): Remove; unused.
18980 (wait_debugging): Mark as visible.
18981 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18982 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18983
18984 * syntax.c (syntax_temp): Define only if !__GNUC__.
18985
18986 * sound.c (current_sound_device, current_sound): Now static.
18987
18988 * search.c (searchbufs, searchbuf_head): Now static.
18989
18990 * scroll.c (scroll_cost): Remove; unused.
18991 * dispextern.h (scroll_cost): Remove decl.
18992
18993 * region-cache.h (pp_cache): Mark as externally visible.
18994
18995 * process.c: Make symbols static if they're not exported.
18996 (process_tick, update_tick, create_process, chan_process):
18997 (Vprocess_alist, proc_buffered_char, datagram_access):
18998 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18999 (deactivate_process): Mark defn as static, as well as decl.
19000 * lisp.h (create_process): Remove decl.
19001 * process.h (chan_process, Vprocess_alist): Remove decls.
19002
19003 * print.c: Make symbols static if they're not exported.
19004 (print_depth, new_backquote_output, being_printed, print_buffer):
19005 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
19006 (print_interval, print_number_index, initial_stderr_stream):
19007 Now static.
19008 * lisp.h (Fprinc): Remove decl.
19009 (debug_output_compilation_hack): Mark as externally visible.
19010
19011 * sysdep.c (croak): Move decl from here to syssignal.h.
19012 * syssignal.h (croak): Put it here, so the API can be checked when
19013 'croak' is called from dissociate_if_controlling_tty.
19014
19015 * minibuf.c: Make symbols static if they're not exported.
19016 (minibuf_save_list, choose_minibuf_frame): Now static.
19017 * lisp.h (choose_minibuf_frame): Remove decl.
19018
19019 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
19020
19021 * lread.c: Make symbols static if they're not exported.
19022 (read_objects, initial_obarray, oblookup_last_bucket_number):
19023 Now static.
19024 (make_symbol): Remove; unused.
19025 * lisp.h (initial_obarray, make_symbol): Remove decls.
19026
19027 * keyboard.c: Make symbols static if they're not exported.
19028 (single_kboard, recent_keys_index, total_keys, recent_keys):
19029 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
19030 (this_single_command_key_start, echoing, last_auto_save):
19031 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
19032 (command_loop, echo_now, keyboard_init_hook, help_char_p):
19033 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
19034 (Vlispy_mouse_stem, double_click_count):
19035 Now static.
19036 (force_auto_save_soon): Define only if SIGDANGER.
19037 (ignore_mouse_drag_p): Now static if
19038 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
19039 (print_help): Remove; unused.
19040 (stop_character, last_timer_event): Mark as externally visible.
19041 * keyboard.h (ignore_mouse_drag_p): Declare only if
19042 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
19043 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
19044 * lisp.h (echoing): Remove decl.
19045 (force_auto_save_soon): Declare only if SIGDANGER.
19046 * xdisp.c (redisplay_window): Simplify code, to make it more
19047 obvious that ignore_mouse_drag_p is not accessed if !defined
19048 USE_GTK && !defined HAVE_NS.
19049
19050 * intervals.c: Make symbols static if they're not exported.
19051 (merge_properties_sticky, merge_interval_right, delete_interval):
19052 Now static.
19053 * intervals.h (merge_interval_right, delete_interval): Remove decls.
19054
19055 * insdel.c: Make symbols static if they're not exported.
19056 However, leave prepare_to_modify_buffer alone. It's never
19057 called from outside this function, but that appears to be a bug.
19058 (combine_after_change_list, combine_after_change_buffer):
19059 (adjust_after_replace, signal_before_change): Now static.
19060 (adjust_after_replace_noundo): Remove; unused.
19061 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
19062 (signal_before_change): Remove decls.
19063
19064 * indent.c (val_compute_motion, val_vmotion): Now static.
19065
19066 * image.c: Make symbols static if they're not exported.
19067 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
19068 if USE_GTK.
19069 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
19070 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
19071
19072 * fringe.c (standard_bitmaps): Now static.
19073 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
19074
19075 * frame.c: Make symbols static if they're not exported.
19076 (x_report_frame_params, make_terminal_frame): Now static.
19077 (get_frame_param): Now static, unless HAVE_NS.
19078 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
19079 (x_get_resource_string): Remove; not used.
19080 * frame.h (make_terminal_frame, x_report_frame_params):
19081 (x_get_resource_string); Remove decls.
19082 (x_fullscreen_adjust): Declare only if WINDOWSNT.
19083 * lisp.h (get_frame_param): Declare only if HAVE_NS.
19084
19085 * font.c, fontset.c: Make symbols static if they're not exported.
19086 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
19087 (FACE_SUITABLE_FOR_CHAR_P): Use it.
19088 * font.c (font_close_object): Now static.
19089 * font.h (font_close_object): Remove.
19090 * fontset.c (FONTSET_OBJLIST): Remove.
19091 (free_realized_fontset) #if-0 the body, which does nothing.
19092 (face_suitable_for_char_p): #if-0, as it's never called.
19093 * fontset.h (face_suitable_for_char_p): Remove decl.
19094 * xfaces.c (face_at_string_position):
19095 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
19096 since 0 is always ASCII.
19097
19098 * fns.c (weak_hash_tables): Now static.
19099
19100 * fileio.c: Make symbols static if they're not exported.
19101 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
19102 (Vwrite_region_annotation_buffers): Now static.
19103
19104 * eval.c: Make symbols static if they're not exported.
19105 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
19106 * lisp.h (backtrace_list): Remove decl.
19107
19108 * emacs.c: Make symbols static if they're not exported.
19109 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
19110 (fatal_error_code, fatal_error_signal_hook, standard_args):
19111 Now static.
19112 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
19113 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
19114 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
19115 * lisp.h (fatal_error_signal_hook): Remove decl.
19116 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
19117
19118 * editfns.c: Move a (normally-unused) function to its only use.
19119 * editfns.c, lisp.h (get_operating_system_release): Remove.
19120 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
19121 worth the hassle of breaking this out.
19122
19123 * xterm.c: Make symbols static if they're not exported.
19124 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
19125 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
19126 (x_destroy_window, x_delete_display):
19127 Now static.
19128 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
19129 (x_mouse_leave): Remove; unused.
19130 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
19131 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
19132 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
19133 Remove decls.
19134 (x_mouse_leave): Declare only if WINDOWSNT.
19135 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
19136 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
19137 USE_X_TOOLKIT.
19138
19139 * ftxfont.c: Make symbols static if they're not exported.
19140 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
19141 HAVE_FREETYPE.
19142 * font.h (ftxfont_driver): Likewise.
19143
19144 * xfns.c: Make symbols static if they're not exported.
19145 (x_last_font_name, x_display_info_for_name):
19146 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
19147 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
19148 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
19149 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
19150 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
19151 (last_show_tip_args): Now static.
19152 (xic_defaut_fontset, xic_create_fontsetname): Define only if
19153 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
19154 (x_screen_planes): Remove; unused.
19155 * dispextern.h (x_screen_planes): Remove decl.
19156
19157 * dispnew.c: Make symbols static if they're not exported.
19158 * dispextern.h (redraw_garbaged_frames, scrolling):
19159 (increment_row_positions): Remove.
19160 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
19161 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
19162 Now static.
19163 (redraw_garbaged_frames): Remove; unused.
19164
19165 * xfaces.c: Make symbols static if they're not exported.
19166 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
19167 Remove decls.
19168 * xterm.h (defined_color): Remove decls.
19169 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
19170 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
19171 (menu_face_changed_default, defined_color, free_realized_face):
19172 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
19173 (ascii_face_of_lisp_face): Remove; unused.
19174
19175 * xdisp.c: Make symbols static if they're not exported.
19176 * dispextern.h (scratch_glyph_row, window_box_edges):
19177 (glyph_to_pixel_coords, set_cursor_from_row):
19178 (get_next_display_element, set_iterator_to_next):
19179 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
19180 (show_mouse_face): Remove decls
19181 * frame.h (message_buf_print): Likewise.
19182 * lisp.h (pop_message, set_message, check_point_in_composition):
19183 Likewise.
19184 * xterm.h (set_vertical_scroll_bar): Likewise.
19185 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
19186 (message_buf_print, scratch_glyph_row, displayed_buffer):
19187 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
19188 (get_next_display_element, show_mouse_face, window_box_edges):
19189 (frame_to_window_pixel_xy, check_point_in_composition):
19190 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
19191 (glyph_to_pixel_coords): Remove; unused.
19192
19193 * dired.c (file_name_completion): Now static.
19194
19195 * dbusbind.c (xd_in_read_queued_messages): Now static.
19196
19197 * lisp.h (circular_list_error, FOREACH): Remove; unused.
19198 * data.c (circular_list_error): Remove.
19199
19200 * commands.h (last_point_position, last_point_position_buffer):
19201 (last_point_position_window): Remove decls.
19202 * keyboard.c: Make these variables static.
19203
19204 * coding.h (coding, code_convert_region, encode_coding_gap):
19205 Remove decls.
19206 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
19207 (iso_code_class, detect_coding, code_convert_region): Now static.
19208 (encode_coding_gap): Remove; unused.
19209
19210 * chartab.c (chartab_chars, chartab_bits): Now static.
19211
19212 * charset.h (charset_iso_8859_1): Remove decl.
19213 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
19214 Now static.
19215
19216 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
19217 * ccl.c (Vccl_program_table): Now static.
19218 (check_ccl_update): Remove; unused.
19219
19220 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
19221 * category.h: ... from here.
19222 * category.c (check_category_table, set_category_set): Now static.
19223
19224 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
19225 * lisp.h: Remove these decls.
19226
19227 * buffer.c (buffer_count): Remove unused var.
19228
19229 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
19230 so that it's not optimized away.
19231 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
19232 * dispextern.h (bidi_dump_cached_states): Remove, since it's
19233 exported only to the debugger.
19234
19235 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
19236 * atimer.h (run_all_atimers): Remove; not exported.
19237
19238 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
19239 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
19240 was inaccessible from Lisp.
19241 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
19242 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
19243
19244 alloc.c: Import and export fewer symbols, and remove unused items.
19245 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
19246 is defined.
19247 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
19248 it's not optimized away by whole-program optimization.
19249 (message_enable_multibyte, free_misc): Remove.
19250 (catchlist, handlerlist, mark_backtrace):
19251 Declare only if BYTE_MARK_STACK.
19252 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
19253 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
19254 (message_enable_multibyte): Remove decl.
19255 (free_misc, interval_free_list, float_block, float_block_index):
19256 (n_float_blocks, float_free_list, cons_block, cons_block_index):
19257 (cons_free_list, last_marked_index):
19258 Now static.
19259 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
19260 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
19261 (mark_backtrace): Define only if BYTE_MARK_STACK.
19262 * xdisp.c (message_enable_multibyte): Now static.
19263
19264 Declare Lisp_Object Q* variables to be 'static' if not exported.
19265 This makes it easier for human readers (and static analyzers)
19266 to see whether these variables are used from other modules.
19267 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
19268 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
19269 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
19270 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
19271 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
19272 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
19273 * xmenu.c, xselect.c:
19274 Declare Q* vars static if they are not used in other modules.
19275 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
19276 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
19277 Remove decls of unexported vars.
19278 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
19279
19280 * lisp.h (DEFINE_FUNC): Make sname 'static'.
19281
19282 Make Emacs functions such as Fatom 'static' by default.
19283 This makes it easier for human readers (and static analyzers)
19284 to see whether these functions can be called from other modules.
19285 DEFUN now defines a static function. To make the function external
19286 so that it can be used in other C modules, use the new macro DEFUE.
19287 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
19288 (Finit_image_library):
19289 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
19290 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
19291 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
19292 Remove decls, since these functions are now static.
19293 (Funintern, Fget_internal_run_time): New decls, since these functions
19294 were already external.
19295
19296 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
19297 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
19298 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
19299 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
19300 * keyboard.c, keymap.c, lread.c:
19301 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
19302 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
19303 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
19304 Mark functions with DEFUE instead of DEFUN,
19305 if they are used in other modules.
19306 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
19307 decls for now-static functions.
19308 * buffer.h (Fdelete_overlay): Remove decl.
19309 * callproc.c (Fgetenv_internal): Mark as internal.
19310 * composite.c (Fremove_list_of_text_properties): Remove decl.
19311 (Fcomposition_get_gstring): New forward static decl.
19312 * composite.h (Fcomposite_get_gstring): Remove decl.
19313 * dired.c (Ffile_attributes): New forward static decl.
19314 * doc.c (Fdocumntation_property): New forward static decl.
19315 * eval.c (Ffetch_bytecode): New forward static decl.
19316 (Funintern): Remove extern decl; now in .h file where it belongs.
19317 * fileio.c (Fmake_symbolic_link): New forward static decl.
19318 * image.c (Finit_image_library): New forward static decl.
19319 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
19320 * intervals.h (Fprevious_property_change):
19321 (Fremove_list_of_text_properties): Remove decls.
19322 * keyboard.c (Fthis_command_keys): Remove decl.
19323 (Fcommand_execute): New forward static decl.
19324 * keymap.c (Flookup_key): New forward static decl.
19325 (Fcopy_keymap): Now static.
19326 * keymap.h (Flookup_key): Remove decl.
19327 * process.c (Fget_process): New forward static decl.
19328 (Fprocess_datagram_address): Mark as internal.
19329 * syntax.c (Fsyntax_table_p): New forward static decl.
19330 (skip_chars): Remove duplicate decl.
19331 * textprop.c (Fprevious_property_change): New forward static decl.
19332 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
19333 Now internal.
19334 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
19335 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
19336
19337 * editfns.c (Fformat): Remove unreachable code.
19338
19339 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
19340
19341 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
19342 change. (Bug#8496)
19343
19344 2011-04-13 Eli Zaretskii <eliz@gnu.org>
19345
19346 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
19347 when at ZV. (Bug#8487)
19348
19349 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
19350
19351 * charset.c (Fclear_charset_maps): Use xfree instead of free.
19352 (Bug#8437)
19353 * keyboard.c (parse_tool_bar_item): Likewise.
19354 * sound.c (sound_cleanup, alsa_close): Likewise.
19355 * termcap.c (tgetent): Likewise.
19356 * xfns.c (x_default_font_parameter): Likewise.
19357 * xsettings.c (read_and_apply_settings): Likewise.
19358
19359 * alloc.c (overrun_check_malloc, overrun_check_realloc)
19360 (overrun_check_free): Protoize.
19361
19362 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
19363
19364 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
19365 since callers should never pass a negative size.
19366 Change the signature to match that of plain 'read' and 'write'; see
19367 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
19368 * lisp.h: Update prototypes of emacs_write and emacs_read.
19369
19370 2011-04-11 Eli Zaretskii <eliz@gnu.org>
19371
19372 * xdisp.c (redisplay_window): Don't try to determine the character
19373 position of the scroll margin if the window start point w->startp
19374 is outside the buffer's accessible region. (Bug#8468)
19375
19376 2011-04-10 Eli Zaretskii <eliz@gnu.org>
19377
19378 Fix write-region and its subroutines for buffers > 2GB.
19379 * fileio.c (a_write, e_write): Modify declaration of arguments and
19380 local variables to support buffers larger than 2GB.
19381 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
19382
19383 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
19384 argument, local variables, and return value.
19385
19386 * lisp.h: Update prototypes of emacs_write and emacs_read.
19387
19388 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
19389
19390 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
19391
19392 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
19393
19394 Fix more problems found by GCC 4.6.0's static checks.
19395
19396 * xdisp.c (vmessage): Use a better test for character truncation.
19397
19398 * charset.c (load_charset_map): <, not <=, for optimization,
19399 and to avoid potential problems with integer overflow.
19400 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
19401 * casetab.c (set_identity, shuffle): Likewise.
19402 * editfns.c (Fformat): Likewise.
19403 * syntax.c (skip_chars): Likewise.
19404
19405 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
19406 This also lets GCC 4.6.0 generate slightly better loop code.
19407
19408 * callint.c (Fcall_interactively): <, not <=, for optimization.
19409 (Fcall_interactively): Count the number of arguments produced,
19410 not the number of arguments given. This is simpler and lets GCC
19411 4.6.0 generate slightly better code.
19412
19413 * ftfont.c: Distingish more carefully between FcChar8 and char.
19414 The previous code passed unsigned char * to a functions like
19415 strlen and xstrcasecmp that expect char *, which does not
19416 conform to the C standard.
19417 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
19418 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
19419 char * when the C standard requires it.
19420
19421 * keyboard.c (read_char): Remove unused var.
19422
19423 * eval.c: Port to Windows vsnprintf (Bug#8435).
19424 Include <limits.h>.
19425 (SIZE_MAX): Define if the headers do not.
19426 (verror): Do not give up if vsnprintf returns a negative count.
19427 Instead, grow the buffer. This ports to Windows vsnprintf, which
19428 does not conform to C99. Problem reported by Eli Zaretskii.
19429 Also, simplify the allocation scheme, by avoiding the need for
19430 calling realloc, and removing the ALLOCATED variable.
19431
19432 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
19433
19434 Remove invocations of doprnt, as Emacs now uses vsnprintf.
19435 But keep the doprint source code for now, as we might revamp it
19436 and use it again (Bug#8435).
19437 * lisp.h (doprnt): Remove.
19438 * Makefile.in (base_obj): Remove doprnt.o.
19439 * deps.mk (doprnt.o): Remove.
19440
19441 error: Print 32- and 64-bit integers portably (Bug#8435).
19442 Without this change, on typical 64-bit hosts error ("...%d...", N)
19443 was used to print both 32- and 64-bit integers N, which relied on
19444 undefined behavior.
19445 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
19446 * lisp.h (error, verror): Mark as printf-like functions.
19447 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19448 Report overflow in size calculations when allocating printf buffer.
19449 Do not truncate output string at its first null byte.
19450 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19451 Truncate the output at a character boundary, since vsnprintf does not
19452 do that.
19453 * charset.c (check_iso_charset_parameter): Convert internal
19454 character to string before calling 'error', since %c now has the
19455 printf meaning.
19456 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19457 overflow when computing char to be passed to 'error'. Do not
19458 pass Lisp_Object to 'error'; pass the integer instead.
19459 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19460 formatted with plain %d.
19461
19462 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19463
19464 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19465
19466 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19467
19468 * xterm.c (x_catch_errors): Remove duplicate declaration.
19469
19470 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19471
19472 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19473
19474 2011-04-10 Jim Meyering <meyering@redhat.com>
19475
19476 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19477 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
19478 return ssize_t not "int", and use size_t as the buffer length.
19479 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19480 * gnutls.h: Update declarations.
19481 * process.c (read_process_output): Use ssize_t, to match.
19482 (send_process): Likewise.
19483
19484 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19485
19486 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19487
19488 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19489
19490 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19491 Use unsigned char, to match FcChar8 type definition.
19492
19493 * xterm.c (handle_one_xevent):
19494 * xmenu.c (create_and_show_popup_menu):
19495 * xselect.c (x_decline_selection_request)
19496 (x_reply_selection_request): Avoid type-punned deref of X events.
19497
19498 2011-04-09 Eli Zaretskii <eliz@gnu.org>
19499
19500 Fix some uses of `int' instead of EMACS_INT.
19501 * search.c (string_match_1, fast_string_match)
19502 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19503 (scan_buffer, find_next_newline_no_quit)
19504 (find_before_next_newline, search_command, Freplace_match)
19505 (Fmatch_data): Make some `int' variables be EMACS_INT.
19506
19507 * xdisp.c (display_count_lines): 3rd argument and return value now
19508 EMACS_INT. All callers changed.
19509 (pint2hrstr): Last argument is now EMACS_INT.
19510
19511 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19512 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19513 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19514 (decode_coding_utf_16, decode_coding_emacs_mule)
19515 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19516 (decode_coding_ccl, decode_coding_charset)
19517 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19518 (decode_coding_iso_2022, decode_coding_emacs_mule)
19519 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19520 <char_offset, last_offset>: Declare EMACS_INT.
19521 (encode_coding_utf_8, encode_coding_utf_16)
19522 (encode_coding_emacs_mule, encode_invocation_designation)
19523 (encode_designation_at_bol, encode_coding_iso_2022)
19524 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19525 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19526 Declare EMACS_INT.
19527 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19528 (encode_invocation_designation): Last argument P_NCHARS is now
19529 EMACS_INT.
19530 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19531 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19532
19533 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19534 All users changed.
19535
19536 * ccl.c (Fccl_execute_on_string): Declare some variables
19537 EMACS_INT.
19538
19539 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
19540
19541 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19542
19543 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19544
19545 * process.c (Fformat_network_address): Doc fix.
19546
19547 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19548
19549 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
19550
19551 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
19552
19553 * keyboard.c (read_char): Call Lisp function help-form-show,
19554 instead of using internal_with_output_to_temp_buffer.
19555 (Qhelp_form_show): New var.
19556 (syms_of_keyboard): Use DEFSYM macro.
19557
19558 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19559
19560 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19561
19562 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
19563
19564 * process.c (Flist_processes): Remove to Lisp.
19565 (list_processes_1): Delete.
19566
19567 2011-04-06 Eli Zaretskii <eliz@gnu.org>
19568
19569 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19570
19571 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19572
19573 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
19574
19575 Fix more problems found by GCC 4.6.0's static checks.
19576
19577 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19578
19579 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19580
19581 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
19582
19583 * xdisp.c (vmessage): Mark as a printf-like function.
19584
19585 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19586
19587 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19588
19589 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19590 printf-like functions.
19591 (tiff_load): Add casts to remove these marks before passing them
19592 to system-supplied API.
19593
19594 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19595
19596 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19597 This avoids several warnings with gcc -Wstrict-overflow.
19598 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19599 directly, rather than having caller test rule sign. This avoids
19600 some unnecessary tests.
19601 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19602 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19603 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
19604
19605 * xfont.c (xfont_text_extents): Remove var that was set but not used.
19606 (xfont_open): Avoid unnecessary tests.
19607
19608 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19609
19610 * composite.h, composite.c (composition_gstring_put_cache):
19611 Use EMACS_INT, not int, for length.
19612
19613 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19614 breaking out part of COMPOSITION_DECODE_RULE.
19615 (COMPOSITION_DECODE_RULE): Use it.
19616 * composite.c (get_composition_id): Remove unused local vars,
19617 by using the new macro.
19618
19619 * textprop.c (set_text_properties_1): Change while to do-while,
19620 since the condition is always true at first.
19621
19622 * intervals.c (graft_intervals_into_buffer): Mark var as used.
19623 (interval_deletion_adjustment): Return unsigned value.
19624 All uses changed.
19625
19626 * process.c (list_processes_1, create_pty, read_process_output):
19627 (exec_sentinel): Remove vars that were set but not used.
19628 (create_pty): Remove unnecessary "volatile"s.
19629 (Fnetwork_interface_info): Avoid possibility of int overflow.
19630 (read_process_output): Do adaptive read buffering even if carryover.
19631 (read_process_output): Simplify nbytes computation if buffered.
19632
19633 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19634
19635 * syntax.c (scan_words): Remove var that was set but not used.
19636 (update_syntax_table): Use unsigned instead of int.
19637
19638 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
19639 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
19640 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
19641
19642 * print.c (print_error_message): Avoid int overflow.
19643
19644 * font.c (font_list_entities): Redo for clarity,
19645 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19646
19647 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
19648 (font_score): Avoid potential overflow in diff calculation.
19649
19650 * fns.c (substring_both): Remove var that is set but not used.
19651 (sxhash): Redo loop for clarity and to avoid wraparound warning.
19652
19653 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19654
19655 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19656 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19657 can always succeed if overflow has undefined behavior.
19658
19659 * search.c (boyer_moore, wordify): Remove vars set but not used.
19660 (wordify): Omit three unnecessary tests.
19661
19662 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19663 All callers changed. This avoids the need for an unused var.
19664
19665 * casefiddle.c (casify_region): Remove var that is set but not used.
19666
19667 * dired.c (file_name_completion): Remove var that is set but not used.
19668
19669 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19670
19671 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
19672 (Finsert_file_contents): Remove unnecessary code checking fd.
19673
19674 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19675 Check for integer overflow on size calculations.
19676
19677 * buffer.c (Fprevious_overlay_change): Remove var that is set
19678 but not used.
19679
19680 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19681 Remove vars that are set but not used.
19682 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
19683 (timer_check_2): Mark vars as initialized.
19684
19685 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19686
19687 * image.c (lookup_image): Remove var that is set but not used.
19688 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
19689
19690 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19691 that are set but not used.
19692
19693 * xfns.c (make_invisible_cursor): Don't return garbage
19694 if XCreateBitmapFromData fails (Bug#8410).
19695
19696 * xselect.c (x_get_local_selection, x_handle_property_notify):
19697 Remove vars that are set but not used.
19698
19699 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19700 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19701
19702 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19703 Remove var that is set but not used.
19704 (scroll_bar_windows_size): Now size_t, not int.
19705 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19706 Check for overflow.
19707
19708 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19709 (map_tty_color) [!defined MSDOS]: Likewise.
19710
19711 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19712
19713 * coding.c: Remove vars that are set but not used.
19714 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19715 All callers changed.
19716 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19717 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19718 (decode_coding_charset): Remove vars that are set but not used.
19719
19720 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19721 that is set but not used.
19722
19723 * print.c (print_object): Remove var that is set but not used.
19724
19725 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19726 The gnulib version avoids calling malloc in the usual case,
19727 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19728 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19729 * filelock.c (current_lock_owner): Likewise.
19730 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19731 * sysdep.c: Include allocator.h, careadlinkat.h.
19732 (emacs_no_realloc_allocator): New static constant.
19733 (emacs_readlink): New function.
19734 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19735 ../lib/careadlinkat.h.
19736
19737 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19738
19739 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19740 first non-nil return value).
19741
19742 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19743
19744 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19745 if not defined (Bug#8403).
19746
19747 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19748
19749 * xdisp.c (display_count_lines): Remove parameter `start',
19750 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19751 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19752 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19753 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19754 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19755 and thereabouts. All callers changed.
19756 (get_per_char_metric): Remove parameter `f', unused since
19757 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19758
19759 2011-04-02 Jim Meyering <meyering@redhat.com>
19760
19761 do not dereference NULL upon failed strdup
19762 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19763 (ns_get_family): Likewise.
19764
19765 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19766
19767 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19768
19769 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19770
19771 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19772 later (Bug#8403).
19773
19774 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19775
19776 Add lexical binding.
19777
19778 * window.c (Ftemp_output_buffer_show): New fun.
19779 (Fsave_window_excursion):
19780 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19781
19782 * lread.c (lisp_file_lexically_bound_p): New function.
19783 (Fload): Bind Qlexical_binding.
19784 (readevalloop): Remove `evalfun' arg.
19785 Bind Qinternal_interpreter_environment.
19786 (Feval_buffer): Bind Qlexical_binding.
19787 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19788 Mark as dynamic.
19789 (syms_of_lread): Declare `lexical-binding'.
19790
19791 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19792
19793 * keyboard.c (eval_dyn): New fun.
19794 (menu_item_eval_property): Use it.
19795
19796 * image.c (parse_image_spec): Use Ffunctionp.
19797
19798 * fns.c (concat, mapcar1): Accept byte-code-functions.
19799
19800 * eval.c (Fsetq): Handle lexical vars.
19801 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19802 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19803 (FletX, Flet): Obey lexical binding.
19804 (Fcommandp): Handle closures.
19805 (Feval): New `lexical' arg.
19806 (eval_sub): New function extracted from Feval. Use it almost
19807 everywhere where Feval was used. Look up vars in lexical env.
19808 Handle closures.
19809 (Ffunctionp): Move from subr.el.
19810 (Ffuncall): Handle closures.
19811 (apply_lambda): Remove `eval_flags'.
19812 (funcall_lambda): Handle closures and new byte-code-functions.
19813 (Fspecial_variable_p): New function.
19814 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19815 but without exporting it to Lisp.
19816
19817 * doc.c (Fdocumentation, store_function_docstring):
19818 * data.c (Finteractive_form): Handle closures.
19819
19820 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19821 interactive spec.
19822
19823 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19824 New byte-codes.
19825 (exec_byte_code): New function extracted from Fbyte_code to handle new
19826 calling convention for byte-code-functions. Add new byte-codes.
19827
19828 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19829
19830 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19831
19832 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19833
19834 * xdisp.c (redisplay_internal): Fix prototype.
19835
19836 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19837
19838 * xdisp.c (SCROLL_LIMIT): New macro.
19839 (try_scrolling): Use it when setting scroll_limit.
19840 Limit scrolling to 100 screen lines.
19841 (redisplay_window): Even when falling back on "recentering",
19842 position point in the window according to scroll-conservatively,
19843 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19844
19845 (try_scrolling): When point is above the window, allow searching
19846 as far as scroll_max, or one screenful, to compute vertical
19847 distance from PT to the scroll margin position. This prevents
19848 try_scrolling from unnecessarily failing when
19849 scroll-conservatively is set to a value slightly larger than the
19850 window height. Clean up the case of PT below the margin at bottom
19851 of window: scroll_max can no longer be INT_MAX. When aggressive
19852 scrolling is in use, don't let point enter the opposite scroll
19853 margin as result of the scroll.
19854 (syms_of_xdisp) <scroll-conservatively>: Document the
19855 threshold of 100 lines for never-recentering scrolling.
19856
19857 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19858
19859 * dispextern.h (move_it_by_lines):
19860 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19861 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19862 (message_log_check_duplicate): Remove parameters `prev_bol' and
19863 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19864 (redisplay_internal): Remove parameter `preserve_echo_area',
19865 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19866
19867 * indent.c (Fvertical_motion):
19868 * window.c (window_scroll_pixel_based, Frecenter):
19869 Don't pass `need_y_p' to `move_it_by_lines'.
19870
19871 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19872
19873 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19874 steal a few bits to be more compact.
19875 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19876 Remove unneeded casts.
19877
19878 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19879
19880 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19881
19882 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19883 binding" message (bug#7967).
19884
19885 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19886
19887 Fix more problems found by GCC 4.6.0's static checks.
19888
19889 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19890 Remove unused local var.
19891
19892 * editfns.c (Fmessage_box): Remove unused local var.
19893
19894 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19895 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19896 Omit unused local vars.
19897 * window.c (shrink_windows): Omit unused local var.
19898 * menu.c (digest_single_submenu): Omit unused local var.
19899 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19900 Omit unused local var.
19901
19902 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19903 Don't assume string length fits in int.
19904 (keyremap_step, read_key_sequence): Use size_t for sizes.
19905 (read_key_sequence): Don't check last_real_key_start redundantly.
19906
19907 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19908 instead of alloca (Bug#8344).
19909
19910 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19911 (Fbacktrace_frame): Don't assume nframes fits in int.
19912
19913 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19914
19915 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19916 concerns.
19917
19918 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19919
19920 * cm.c (calccost): Turn while-do into do-while, for clarity.
19921
19922 * keyboard.c (syms_of_keyboard): Use the same style as later
19923 in this function when indexing through an array. This also
19924 works around GCC bug 48267.
19925
19926 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19927
19928 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19929
19930 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19931 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19932
19933 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19934 This avoids undefined behavior on integer overflow, and is a bit
19935 more convenient anyway since it is compared to a size_t variable.
19936
19937 Variadic C functions now count arguments with size_t, not int.
19938 This avoids an unnecessary limitation on 64-bit machines, which
19939 caused (substring ...) to crash on large vectors (Bug#8344).
19940 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19941 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19942 All variadic functions and their callers changed accordingly.
19943 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19944 * data.c (arith_driver, float_arith_driver): Likewise.
19945 * editfns.c (general_insert_function): Likewise.
19946 * eval.c (struct backtrace.nargs, interactive_p)
19947 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19948 (funcall_lambda, mark_backtrace): Likewise.
19949 * fns.c (concat): Likewise.
19950 * frame.c (x_set_frame_parameters): Likewise.
19951 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19952 0 if not found, not -1. All callers changed.
19953
19954 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19955 (stack_copy_size): Now size_t, not int.
19956 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19957
19958 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19959
19960 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19961 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19962 All callers changed.
19963
19964 * lisp.h (multibyte_char_to_unibyte):
19965 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19966 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19967 * character.h (CHAR_TO_BYTE8):
19968 * cmds.c (internal_self_insert):
19969 * editfns.c (general_insert_function):
19970 * keymap.c (push_key_description):
19971 * search.c (Freplace_match):
19972 * xdisp.c (message_dolog, set_message_1): All callers changed.
19973
19974 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19975
19976 * keyboard.c (safe_run_hook_funcall): New function.
19977 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19978 don't set the hook to nil, but remove the offending function instead.
19979 (Qcommand_hook_internal): Remove, unused.
19980 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19981 Vcommand_hook_internal.
19982
19983 * eval.c (enum run_hooks_condition): Remove.
19984 (funcall_nil, funcall_not): New functions.
19985 (run_hook_with_args): Call each function through a `funcall' argument.
19986 Remove `cond' argument, now redundant.
19987 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19988 (Frun_hook_with_args_until_failure): Adjust accordingly.
19989 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19990
19991 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19992
19993 * dispextern.h (string_buffer_position): Remove declaration.
19994
19995 * print.c (strout): Remove parameter `multibyte', unused since
19996 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19997
19998 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19999 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
20000 All callers changed.
20001
20002 * w32.c (_wsa_errlist): Use braces for struct initializers.
20003
20004 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
20005 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
20006 All callers changed.
20007 (string_buffer_position): Likewise. Also, make static (it's never
20008 used outside xdisp.c).
20009 (cursor_row_p): Remove parameter `w', unused since
20010 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
20011 (decode_mode_spec): Remove parameter `precision', introduced during
20012 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
20013 All callers changed.
20014
20015 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20016
20017 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
20018
20019 2011-03-27 Anders Lindgren <andlind@gmail.com>
20020
20021 * nsterm.m (ns_menu_bar_is_hidden): New variable.
20022 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
20023 (ns_update_auto_hide_menu_bar): New functions.
20024 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
20025 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
20026 ns_constrain_all_frames.
20027 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
20028 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
20029
20030 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20031
20032 * nsmenu.m (runDialogAt): Remove argument to timer_check.
20033
20034 2011-03-27 Glenn Morris <rgm@gnu.org>
20035
20036 * syssignal.h: Replace RETSIGTYPE with void.
20037 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
20038 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
20039 Replace SIGTYPE with void everywhere.
20040 * s/usg5-4-common.h (SIGTYPE): Remove definition.
20041 * s/template.h (SIGTYPE): Remove commented out definition.
20042
20043 2011-03-26 Eli Zaretskii <eliz@gnu.org>
20044
20045 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
20046 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
20047
20048 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
20049
20050 * w32.c (read_unc_volume): Use parameter `henum', instead of
20051 global variable `wget_enum_handle'.
20052
20053 * keymap.c (describe_vector): Remove parameters `indices' and
20054 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
20055 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
20056
20057 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
20058
20059 * keyboard.c (timer_check): Remove parameter `do_it_now',
20060 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
20061 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
20062 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
20063
20064 * keyboard.c (read_char):
20065 * w32menu.c (w32_menu_display_help):
20066 * xmenu.c (show_help_event, menu_help_callback):
20067 Adjust calls to `show_help_echo'.
20068
20069 * gtkutil.c (xg_maybe_add_timer):
20070 * keyboard.c (readable_events):
20071 * process.c (wait_reading_process_output):
20072 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
20073
20074 * insdel.c (adjust_markers_gap_motion):
20075 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
20076 (gap_left, gap_right): Don't call it.
20077
20078 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
20079
20080 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
20081 incurred during fontification.
20082
20083 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
20084
20085 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
20086 (DEFVAR_PER_BUFFER): Don't pass it.
20087
20088 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
20089 (scrolling_window): Don't pass it.
20090
20091 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
20092
20093 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
20094
20095 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
20096 and `suffix'.
20097 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
20098 of variables specific to SELinux and computation of `encoded_absname'.
20099
20100 * image.c (XPutPixel): Remove unused variable `height'.
20101
20102 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
20103
20104 * unexw32.c (get_section_info): Remove unused variable `section'.
20105
20106 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
20107 (system_process_attributes): Remove unused variable `sess'.
20108 (sys_read): Remove unused variable `err'.
20109
20110 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
20111 (w32_wnd_proc): Remove unused variable `isdead'.
20112 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
20113 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
20114 (x_create_tip_frame): Remove unused variable `tem'.
20115
20116 * w32inevt.c (w32_console_read_socket):
20117 Remove unused variable `no_events'.
20118
20119 * w32term.c (x_draw_composite_glyph_string_foreground):
20120 Remove unused variable `width'.
20121
20122 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
20123
20124 * w32term.c (x_set_glyph_string_clipping):
20125 Don't pass uninitialized region to CombineRgn.
20126
20127 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
20128
20129 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
20130 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
20131 (Fx_close_connection): Remove unused variable `i'.
20132
20133 * w32font.c (w32font_draw): Return number of glyphs.
20134 (w32font_open_internal): Remove unused variable `i'.
20135 (w32font_driver): Add missing initializer.
20136
20137 * w32menu.c (utf8to16): Remove unused variable `utf16'.
20138 (fill_in_menu): Remove unused variable `items_added'.
20139
20140 * w32term.c (last_mouse_press_frame): Remove static global variable.
20141 (w32_clip_to_row): Remove unused variable `f'.
20142 (x_delete_terminal): Remove unused variable `i'.
20143
20144 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
20145 (NOTHING): Remove unused static global variable.
20146 (uniscribe_check_otf): Remove unused variable `table'.
20147 (uniscribe_font_driver): Add missing initializers.
20148
20149 2011-03-23 Julien Danjou <julien@danjou.info>
20150
20151 * term.c (Fsuspend_tty, Fresume_tty):
20152 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
20153 * window.c (temp_output_buffer_show):
20154 * insdel.c (signal_before_change):
20155 * frame.c (Fhandle_switch_frame):
20156 * fileio.c (Fdo_auto_save):
20157 * emacs.c (Fkill_emacs):
20158 * editfns.c (save_excursion_restore):
20159 * cmds.c (internal_self_insert):
20160 * callint.c (Fcall_interactively):
20161 * buffer.c (Fkill_all_local_variables):
20162 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
20163 Use Frun_hooks.
20164 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
20165 unconditionally since it does the check itself.
20166
20167 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
20168
20169 Fix more problems found by GCC 4.5.2's static checks.
20170
20171 * coding.c (encode_coding_raw_text): Avoid unnecessary test
20172 the first time through the loop, since we know p0 < p1 then.
20173 This also avoids a gcc -Wstrict-overflow warning.
20174
20175 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
20176 leading to a memory leak, possible in functions like
20177 load_charset_map_from_file that can allocate an unbounded number
20178 of objects (Bug#8318).
20179
20180 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
20181 that could (at least in theory) be that large.
20182
20183 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
20184 This is less likely to overflow, and avoids undefined behavior if
20185 overflow does occur. All callers changed. Use strtoul to scan
20186 for the unsigned long integer.
20187 (pint2hrstr): Simplify and tune code slightly.
20188 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
20189
20190 * scroll.c (do_scrolling): Work around GCC bug 48228.
20191 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
20192
20193 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
20194 This also avoids a warning with gcc -Wstrict-overflow.
20195 (validate_x_resource_name): Simplify count usage.
20196 This also avoids a warning with gcc -Wstrict-overflow.
20197
20198 * fileio.c (Fcopy_file): Report error if fchown or fchmod
20199 fail (Bug#8306).
20200
20201 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
20202
20203 * process.c (Fmake_network_process): Use socklen_t, not int,
20204 where POSIX says socklen_t is required in portable programs.
20205 This fixes a porting bug on hosts like 64-bit HP-UX, where
20206 socklen_t is wider than int (Bug#8277).
20207 (Fmake_network_process, server_accept_connection):
20208 (wait_reading_process_output, read_process_output):
20209 Likewise.
20210
20211 * process.c: Rename or move locals to avoid shadowing.
20212 (list_processes_1, Fmake_network_process):
20213 (read_process_output_error_handler, exec_sentinel_error_handler):
20214 Rename or move locals.
20215 (Fmake_network_process): Define label "retry_connect" only if needed.
20216 (Fnetwork_interface_info): Fix pointer signedness.
20217 (process_send_signal): Add cast to avoid pointer signedness problem.
20218 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
20219 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
20220
20221 Make tparam.h and terminfo.c consistent.
20222 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
20223 Include tparam.h instead, since it declares them.
20224 * cm.h (PC): Remove extern decl; tparam.h now does this.
20225 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
20226 * terminfo.c: Include tparam.h, to check interfaces.
20227 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
20228 (tparam): Adjust signature to match interface in tparam.h;
20229 this removes some undefined behavior. Check that outstring and len
20230 are zero, which they always are with Emacs.
20231 * tparam.h (PC, BC, UP): New extern decls.
20232
20233 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
20234 (xftfont_open): Rename locals to avoid shadowing.
20235
20236 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
20237 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
20238 (OTF_TAG_SYM): Omit macro if not needed.
20239 (ftfont_list): Remove unused local.
20240 (get_adstyle_property, ftfont_pattern_entity):
20241 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
20242 Rename locals to avoid shadowing.
20243
20244 * xfont.c (xfont_list_family): Mark var as initialized.
20245
20246 * xml.c (make_dom): Now static.
20247
20248 * composite.c (composition_compute_stop_pos): Rename local to
20249 avoid shadowing.
20250 (composition_reseat_it): Remove unused locals.
20251 (find_automatic_composition, composition_adjust_point): Likewise.
20252 (composition_update_it): Mark var as initialized.
20253 (find_automatic_composition): Mark vars as initialized,
20254 with a FIXME (Bug#8290).
20255
20256 character.h: Rename locals to avoid shadowing.
20257 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
20258 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
20259 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
20260 (BUF_DEC_POS): Be more systematic about renaming local temporaries
20261 to avoid shadowing.
20262
20263 * textprop.c (property_change_between_p): Remove; unused.
20264
20265 * intervals.c (interval_start_pos): Now static.
20266
20267 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
20268
20269 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
20270 Rename locals to avoid shadowing.
20271
20272 * sound.c (wav_play, au_play, Fplay_sound_internal):
20273 Fix pointer signedness.
20274 (alsa_choose_format): Remove unused local var.
20275 (wav_play): Initialize a variable to 0, to prevent undefined
20276 behavior (Bug#8278).
20277
20278 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
20279
20280 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
20281
20282 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
20283 clobbering (Bug#8298).
20284 * sysdep.c (sys_subshell): Likewise.
20285 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
20286
20287 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
20288 This should get cleaned up, so that child_setup has the
20289 same signature on all platforms.
20290
20291 * callproc.c (call_process_cleanup): Now static.
20292 (relocate_fd): Rename locals to avoid shadowing.
20293
20294 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
20295
20296 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
20297 not to be necessary, and produces flickering.
20298
20299 2011-03-20 Glenn Morris <rgm@gnu.org>
20300
20301 * config.in: Remove file.
20302
20303 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
20304
20305 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
20306 are now in src/globals.h.
20307 (syms_of_minibuf): Remove spurious & from previous change.
20308
20309 2011-03-20 Leo Liu <sdl.web@gmail.com>
20310
20311 * minibuf.c (completing-read-function): New variable.
20312 (completing-read-default): Rename from completing-read.
20313 (completing-read): Call completing-read-function.
20314
20315 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
20316
20317 * xfaces.c (Fx_load_color_file):
20318 Read color file from absolute filename (bug#8250).
20319
20320 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
20321
20322 * makefile.w32-in: Update dependencies.
20323
20324 2011-03-17 Eli Zaretskii <eliz@gnu.org>
20325
20326 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
20327
20328 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
20329
20330 Fix more problems found by GCC 4.5.2's static checks.
20331
20332 * process.c (make_serial_process_unwind, send_process_trap):
20333 (sigchld_handler): Now static.
20334
20335 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
20336 That way, the code declares only the vars that it needs.
20337 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
20338 * s/cygwin.h (PTY_ITERATION): Likewise.
20339 * s/darwin.h (PTY_ITERATION): Likewise.
20340 * s/gnu-linux.h (PTY_ITERATION): Likewise.
20341
20342 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
20343 * process.c (allocate_pty): Don't declare stb unless it's needed.
20344
20345 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
20346 (CONSTANTLIM): Remove; unused.
20347 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
20348 Define only if needed.
20349
20350 * unexelf.c (unexec): Name an expression,
20351 to avoid gcc -Wbad-function-cast warning.
20352 Use a different way to cause a compilation error if anyone uses
20353 n rather than nn, a way that does not involve shadowing.
20354 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
20355
20356 * deps.mk (unexalpha.o): Remove; unused.
20357
20358 New file unexec.h, the (simple) interface for unexec (Bug#8267).
20359 * unexec.h: New file.
20360 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
20361 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
20362 Depend on unexec.h.
20363 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
20364 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
20365 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
20366 Change as necessary to match prototype in unexec.h.
20367
20368 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
20369 shadowing.
20370 (back_comment, skip_chars): Mark vars as initialized.
20371
20372 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
20373 Rename locals to avoid shadowing.
20374
20375 * lread.c (read1): Rewrite so as not to use empty "else".
20376 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
20377
20378 * print.c (Fredirect_debugging_output): Fix pointer signedess.
20379
20380 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
20381 warning when compiling print.c.
20382
20383 * font.c (font_unparse_fcname): Abort in an "impossible" situation
20384 instead of using an uninitialized var.
20385 (font_sort_entities): Mark var as initialized.
20386
20387 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
20388
20389 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
20390 pointers to constants.
20391 (font_parse_fcname): Remove unused vars.
20392 (font_delete_unmatched): Now static.
20393 (font_get_spec): Remove; unused.
20394 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
20395 (font_update_drivers, Ffont_get_glyphs, font_add_log):
20396 Rename or move locals to avoid shadowing.
20397
20398 * fns.c (require_nesting_list, require_unwind): Now static.
20399 (Ffillarray): Rename locals to avoid shadowing.
20400
20401 * floatfns.c (domain_error2): Define only if needed.
20402 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
20403
20404 * alloc.c (mark_backtrace): Move decl from here ...
20405 * lisp.h: ... to here, so that it can be checked.
20406
20407 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
20408 (Fdefvar): Rewrite so as not to use empty "else".
20409 (lisp_indirect_variable): Name an expression,
20410 to avoid gcc -Wbad-function-cast warning.
20411 (Fdefvar): Rename locals to avoid shadowing.
20412
20413 * callint.c (quotify_arg, quotify_args): Now static.
20414 (Fcall_interactively): Rename locals to avoid shadowing.
20415 Use const pointer when appropriate.
20416
20417 * lisp.h (get_system_name, get_operating_system_release):
20418 Move decls here, to check interfaces.
20419 * process.c (get_operating_system_release): Move decl to lisp.h.
20420 * xrdb.c (get_system_name): Likewise.
20421 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
20422 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
20423 some of which prompt warnings from gcc -Wbad-function-cast.
20424 (Fformat_time_string, Fencode_time, Finsert_char):
20425 (Ftranslate_region_internal, Fformat):
20426 Rename or remove local vars to avoid shadowing.
20427 (Ftranslate_region_internal): Mark var as initialized.
20428
20429 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
20430 avoid shadowing.
20431
20432 * lisp.h (eassert): Check that the argument compiles, even if
20433 ENABLE_CHECKING is not defined.
20434
20435 * data.c (Findirect_variable): Name an expression, to avoid
20436 gcc -Wbad-function-cast warning.
20437 (default_value, arithcompare, arith_driver, arith_error): Now static.
20438 (store_symval_forwarding): Rename local to avoid shadowing.
20439 (Fmake_variable_buffer_local, Fmake_local_variable):
20440 Mark variables as initialized.
20441 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
20442
20443 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
20444 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20445 Rename locals to avoid shadowing.
20446 (mark_stack): Move local variables into the #ifdef region where
20447 they're used.
20448 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20449 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20450 needed otherwise.
20451 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20452 (GC_STRING_CHARS): Remove; not used.
20453 (Fmemory_limit): Cast sbrk's returned value to char *.
20454
20455 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20456 avoids undefined behavior in theory.
20457
20458 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20459
20460 Use functions, not macros, for up- and down-casing (Bug#8254).
20461 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20462 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20463 to use the following functions instead of these macros.
20464 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20465 EMACS_INT, since callers assume the returned value fits in int.
20466 (upcase1): Likewise, for UPCASE_TABLE.
20467 (uppercasep, lowercasep, upcase): New static inline functions.
20468 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
20469 the race-condition problem in the old DOWNCASE.
20470
20471 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20472 Rename locals to avoid shadowing.
20473 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
20474 (regex_compile, re_search_2, re_match_2_internal):
20475 Remove unused local vars.
20476 (FREE_VAR): Rewrite so as not to use empty "else",
20477 which gcc can warn about.
20478 (regex_compile, re_match_2_internal): Mark locals as initialized.
20479 (RETALLOC_IF): Define only if needed.
20480 (WORDCHAR_P): Likewise. This one is never needed, but is used
20481 only in a comment talking about a compiler bug, so put inside
20482 the #if 0 of that comment.
20483 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20484 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20485 Remove; unused.
20486
20487 * search.c (boyer_moore): Rename locals to avoid shadowing.
20488 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20489 (PREV_CHAR_BOUNDARY): Likewise.
20490
20491 * search.c (simple_search): Remove unused var.
20492
20493 * dired.c (compile_pattern): Move decl from here ...
20494 * lisp.h: ... to here, so that it can be checked.
20495 (struct re_registers): New forward decl.
20496
20497 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20498
20499 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20500 All uses changed.
20501 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20502 Rename locals to avoid shadowing.
20503 (Fvertical_motion): Mark locals as initialized.
20504
20505 * casefiddle.c (casify_object, casify_region): Now static.
20506 (casify_region): Mark local as initialized.
20507
20508 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20509
20510 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20511 New macros, so that the caller can use some names other than
20512 gcpro1, gcpro2, etc.
20513 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20514 of the new macros.
20515 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20516 argument, for consistency with GCPRO2_VAR, etc: it is now the
20517 prefix of the variable, not the variable itself. All uses
20518 changed.
20519 * dired.c (directory_files_internal, file_name_completion):
20520 Rename locals to avoid shadowing.
20521
20522 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20523 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20524 dired.c's scmp function, had undefined behavior.
20525 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20526 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20527 * buffer.h: ... to here, because these macros use current_buffer,
20528 and the new implementation with inline functions needs to have
20529 current_buffer in scope now, rather than later when the macros
20530 are used.
20531 (downcase, upcase1): New static inline functions.
20532 (DOWNCASE, UPCASE1): Reimplement using these functions.
20533 This avoids undefined behavior in expressions like
20534 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20535 from race conditions in accessing the global variables
20536 case_temp1 and case_temp2.
20537 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20538 * lisp.h (case_temp1, case_temp2): Remove their decls.
20539 * character.h (ASCII_CHAR_P): Move from here ...
20540 * lisp.h: ... to here, so that the inline functions mentioned
20541 above can use them.
20542
20543 * dired.c (directory_files_internal_unwind): Now static.
20544
20545 * fileio.c (file_name_as_directory, directory_file_name):
20546 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20547 Now static.
20548 (file_name_as_directory): Use const pointers when appropriate.
20549 (Fexpand_file_name): Likewise. In particular, newdir might
20550 point at constant storage, so make it a const pointer.
20551 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
20552 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20553 signedness issues.
20554 (Fset_file_times, Finsert_file_contents, auto_save_error):
20555 Rename locals to avoid shadowing.
20556
20557 * minibuf.c (choose_minibuf_frame_1): Now static.
20558 (Ftry_completion, Fall_completions): Rename or remove locals
20559 to avoid shadowing.
20560
20561 * marker.c (bytepos_to_charpos): Remove; unused.
20562
20563 * lisp.h (verify_bytepos, count_markers): New decls,
20564 so that gcc does not warn that these functions aren't declared.
20565
20566 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20567 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
20568 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
20569 (copy_text): Remove unused local var.
20570
20571 * filelock.c (within_one_second): Now static.
20572 (lock_file_1): Rename local to avoid shadowing.
20573
20574 * buffer.c (fix_overlays_before): Mark locals as initialized.
20575 (fix_start_end_in_overlays): Likewise. This function should be
20576 simplified by using pointers-to-pointers, but that's a different
20577 matter.
20578 (switch_to_buffer_1): Now static.
20579 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20580 (report_overlay_modification): Rename locals to avoid shadowing.
20581
20582 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
20583 Fix pointer signedness issue.
20584 (sys_subshell): Mark local as volatile if checking for lint,
20585 to suppress a gcc -Wclobbered warning that does not seem to be right.
20586 (MAXPATHLEN): Define only if needed.
20587
20588 * process.c (serial_open, serial_configure): Move decls from here ...
20589 * systty.h: ... to here, so that they can be checked.
20590
20591 * fns.c (get_random, seed_random): Move extern decls from here ...
20592 * lisp.h: ... to here, so that they can be checked.
20593
20594 * sysdep.c (reset_io): Now static.
20595 (wait_for_termination_signal): Remove; unused.
20596
20597 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20598 (copy_keymap_item, append_key, push_text_char_description):
20599 Now static.
20600 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
20601 (DENSE_TABLE_SIZE): Remove; unused.
20602 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20603 (describe_map_tree):
20604 Rename locals to avoid shadowing.
20605
20606 * keyboard.c: Declare functions static if they are not used elsewhere.
20607 (echo_char, echo_dash, cmd_error, top_level_2):
20608 (poll_for_input, handle_async_input): Now static.
20609 (read_char, kbd_buffer_get_event, make_lispy_position):
20610 (make_lispy_event, make_lispy_movement, apply_modifiers):
20611 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20612 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20613 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
20614 (read_key_sequence, read_char): Mark locals as initialized.
20615 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
20616
20617 * keyboard.h (make_ctrl_char): New decl.
20618 (mark_kboards): Move decl here ...
20619 * alloc.c (mark_kboards): ... from here.
20620
20621 * lisp.h (force_auto_save_soon): New decl.
20622
20623 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
20624 (DEFINE_DUMMY_FUNCTION): New macro.
20625 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20626 Use it.
20627 (main): Add casts to avoid warnings
20628 if GCC considers string literals to be constants.
20629
20630 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20631
20632 * dbusbind.c: Pointer signedness fixes.
20633 (xd_signature, xd_append_arg, xd_initialize):
20634 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20635 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20636 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20637 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20638
20639 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20640 if GCC considers string literals to be constants.
20641 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
20642
20643 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20644
20645 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20646 (print_preprocess, print_object): New macro to fix last change.
20647
20648 * print.c (print_preprocess): Don't forget font objects.
20649
20650 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
20651
20652 * emacs.c (USAGE3): Doc fixes.
20653
20654 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20655
20656 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20657 structure.
20658
20659 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
20660
20661 * lisp.h (VWindow_system, Qfile_name_history):
20662 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20663 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20664 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20665
20666 * w32select.c: Don't #include "keyboard.h".
20667 (run_protected): Add extern declaration for waiting_for_input.
20668
20669 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20670 * w32console.c (detect_input_pending, read_input_pending)
20671 (encode_terminal_code):
20672 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20673 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20674 (w32_system_caret_y, Qfile_name_history):
20675 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20676 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20677 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20678 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20679 * w32proc.c (Qlocal, report_file_error):
20680 * w32term.c (Vwindow_system, updating_frame):
20681 * w32uniscribe.c (initialized, uniscribe_font_driver):
20682 Remove unneeded extern declarations.
20683
20684 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
20685
20686 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
20687
20688 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
20689
20690 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20691 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20692 These macros can no longer be used for assignment.
20693
20694 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20695 Assign struct members directly, instead of using BUF_BEGV etc.
20696 (record_buffer_markers, fetch_buffer_markers): New functions for
20697 recording and fetching special buffer markers.
20698 (set_buffer_internal_1, set_buffer_temp): Use them.
20699
20700 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20701
20702 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20703
20704 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20705 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20706
20707 * xdisp.c (hscroll_window_tree):
20708 (reconsider_clip_changes): Use PT instead of BUF_PT.
20709
20710 2011-03-13 Eli Zaretskii <eliz@gnu.org>
20711
20712 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20713 $(EMACS_ROOT)/lib/intprops.h.
20714
20715 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20716
20717 Fix more problems found by GCC 4.5.2's static checks.
20718
20719 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20720 to unsigned char * to avoid compiler diagnostic.
20721 (xg_free_frame_widgets): Make it clear that a local variable is
20722 needed only if USE_GTK_TOOLTIP.
20723 (gdk_window_get_screen): Make it clear that this macro is needed
20724 only if USE_GTK_TOOLTIP.
20725 (int_gtk_range_get_value): New function, which avoids a diagnostic
20726 from gcc -Wbad-function-cast.
20727 (xg_set_toolkit_scroll_bar_thumb): Use it.
20728 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20729 diagnostic from gcc -Wbad-function-cast.
20730 (get_utf8_string, xg_get_file_with_chooser):
20731 Rename locals to avoid shadowing.
20732 (create_dialog): Move locals to avoid shadowing.
20733
20734 * xgselect.c (xg_select): Remove unused var.
20735
20736 * image.c (four_corners_best): Mark locals as initialized.
20737 (gif_load): Initialize transparent_p to zero (Bug#8238).
20738 Mark another local as initialized.
20739 (my_png_error, my_error_exit): Mark with NO_RETURN.
20740
20741 * image.c (clear_image_cache): Now static.
20742 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20743 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20744 (x_edge_detection): Remove unnecessary cast that
20745 gcc -Wbad-function-cast diagnoses.
20746 (gif_load): Fix pointer signedness.
20747 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20748 (jpeg_load, gif_load): Rename locals to avoid shadowing.
20749
20750 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
20751
20752 Improve quality of tests for time stamp overflow.
20753 For example, without this patch (encode-time 0 0 0 1 1
20754 1152921504606846976) returns the obviously-bogus value (-948597
20755 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20756 reports time overflow. See
20757 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20758 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20759 * editfns.c: Include limits.h and intprops.h.
20760 (TIME_T_MIN, TIME_T_MAX): New macros.
20761 (time_overflow): Move earlier, to before first use.
20762 (hi_time, lo_time): New functions, for an accurate test for
20763 out-of-range times.
20764 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20765 (Fget_internal_run_time): Don't assume time_t fits in int.
20766 (make_time): Use list2 instead of Fcons twice.
20767 (Fdecode_time): More accurate test for out-of-range times.
20768 (check_tm_member): New function.
20769 (Fencode_time): Use it, to test for out-of-range times.
20770 (lisp_time_argument): Don't rely on undefined left-shift and
20771 right-shift behavior when checking for time stamp overflow.
20772
20773 * editfns.c (time_overflow): New function, refactoring common code.
20774 (Fformat_time_string, Fdecode_time, Fencode_time):
20775 (Fcurrent_time_string): Use it.
20776
20777 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20778 * dired.c (make_time): Move to ...
20779 * editfns.c (make_time): ... here.
20780 * systime.h: Note the move.
20781
20782 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20783
20784 * fringe.c (update_window_fringes): Remove unused variables.
20785
20786 * unexmacosx.c (copy_data_segment): Also copy __got section.
20787 (Bug#8223)
20788
20789 2011-03-12 Eli Zaretskii <eliz@gnu.org>
20790
20791 * termcap.c [MSDOS]: Include "msdos.h".
20792 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20793 Constify `char *' arguments and their references according to
20794 prototypes in tparam.h.
20795
20796 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20797
20798 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20799 Adapt all references accordingly.
20800
20801 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20802
20803 2011-03-11 Tom Tromey <tromey@redhat.com>
20804
20805 * buffer.c (syms_of_buffer): Remove obsolete comment.
20806
20807 2011-03-11 Eli Zaretskii <eliz@gnu.org>
20808
20809 * termhooks.h (encode_terminal_code): Declare prototype.
20810
20811 * msdos.c (encode_terminal_code): Don't declare prototype.
20812
20813 * term.c (encode_terminal_code): Now external again, used by
20814 w32console.c and msdos.c.
20815
20816 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20817 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20818
20819 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
20820
20821 Fix some minor problems found by GCC 4.5.2's static checks.
20822
20823 * fringe.c (update_window_fringes): Mark locals as initialized
20824 (Bug#8227).
20825 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20826
20827 * alloc.c (mark_fringe_data): Move decl from here ...
20828 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20829 to check its interface.
20830 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20831
20832 * fontset.c (free_realized_fontset): Now static.
20833 (Fset_fontset_font): Rename local to avoid shadowing.
20834 (fontset_font): Mark local as initialized.
20835 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20836
20837 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20838
20839 * xselect.c (x_disown_buffer_selections): Remove; not used.
20840 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20841 (x_own_selection, Fx_disown_selection_internal): Rename locals
20842 to avoid shadowing.
20843 (x_handle_dnd_message): Remove local to avoid shadowing.
20844
20845 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20846 so that the caller can use some name other than gcpro1.
20847 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20848 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20849 (Fx_backspace_delete_keys_p):
20850 Use them to avoid shadowing, and rename vars to avoid shadowing.
20851 (x_decode_color, x_set_name, x_window): Now static.
20852 (Fx_create_frame): Add braces to silence GCC warning.
20853 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20854 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20855 Remove unused locals.
20856 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20857 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20858 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20859 macros.
20860
20861 * xterm.h (x_mouse_leave): New decl.
20862
20863 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20864 Remove unused functions.
20865 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20866 (x_calc_absolute_position): Now static.
20867 (XTread_socket): Don't define label "out" unless it's used.
20868 Don't declare local "event" unless it's used.
20869 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20870 unless they are used.
20871 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20872 (x_fatal_error_signal): Remove; not used.
20873 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20874 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20875 (x_error_catcher, x_connection_closed, x_error_handler):
20876 (x_error_quitter, xembed_send_message, x_iconify_frame):
20877 (my_log_handler): Rename locals to avoid shadowing.
20878 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20879 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20880
20881 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20882 Rename or move locals to avoid shadowing.
20883 (tty_defined_color, merge_face_heights): Now static.
20884 (free_realized_faces_for_fontset): Remove; not used.
20885 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20886 does not deduce is never used uninitialized.
20887 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20888 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20889
20890 * terminal.c (store_terminal_param): Now static.
20891
20892 * xmenu.c (menu_highlight_callback): Now static.
20893 (set_frame_menubar): Remove unused local.
20894 (xmenu_show): Rename parameter to avoid shadowing.
20895 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20896 since they might point to immutable storage.
20897 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20898 since it's unused otherwise.
20899
20900 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20901 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20902 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20903 avoids a gcc -Wuninitialized diagnostic.
20904 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20905 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20906 does not deduce are never used uninitialized.
20907
20908 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20909
20910 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20911 * window.c (window_loop, size_window):
20912 (run_window_configuration_change_hook, enlarge_window): Likewise.
20913
20914 * window.c (display_buffer): Now static.
20915 (size_window): Mark variables that gcc -Wuninitialized
20916 does not deduce are never used uninitialized.
20917 * window.h (check_all_windows): New decl, to forestall
20918 gcc -Wmissing-prototypes diagnostic.
20919 * dispextern.h (bidi_dump_cached_states): Likewise.
20920
20921 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20922 shadowing.
20923 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20924 Include <limits.h>.
20925 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20926 and to avoid gcc -Wuninitialized warning.
20927 (load_charset_map): Mark variables that gcc -Wuninitialized
20928 does not deduce are never used uninitialized.
20929 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20930
20931 * coding.c (coding_set_source, coding_set_destination):
20932 Use "else { /* comment */ }" rather than "else /* comment */;"
20933 for clarity, and to avoid gcc -Wempty-body warning.
20934 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20935 a block, when the outer 'i' will do.
20936 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20937 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20938 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20939 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20940 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20941 Rename locals to avoid shadowing.
20942 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20943 * coding.c (emacs_mule_char, encode_invocation_designation):
20944 Now static, since they're not used elsewhere.
20945 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20946 (decode_coding_object, encode_coding_object, detect_coding_system):
20947 (decode_coding_emacs_mule): Mark variables that gcc
20948 -Wuninitialized does not deduce are never used uninitialized.
20949 (detect_coding_iso_2022): Initialize a local variable that might
20950 be used uninitialized. Leave a FIXME because it's not clear that
20951 this initialization is needed. (Bug#8211)
20952 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20953 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20954 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20955 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20956 Remove unused macros.
20957
20958 * category.c (hash_get_category_set): Remove unused local var.
20959 (copy_category_table): Now static, since it's not used elsewhere.
20960 * character.c (string_count_byte8): Likewise.
20961
20962 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20963 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20964
20965 * chartab.c (copy_sub_char_table): Now static, since it's not used
20966 elsewhere.
20967 (sub_char_table_ref_and_range, char_table_ref_and_range):
20968 Rename locals to avoid shadowing.
20969 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20970
20971 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20972 (BIDI_BOB): Remove unused macro.
20973
20974 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20975 deduce are never used uninitialized.
20976 * term.c (encode_terminal_code): Likewise.
20977
20978 * term.c (encode_terminal_code): Now static. Remove unused local.
20979
20980 * tparam.h: New file.
20981 * term.c, tparam.h: Include it.
20982 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20983 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20984 Move these decls to tparam.h, and make them agree with what
20985 is actually in tparam.c. The previous trick of using incompatible
20986 decls in different modules does not conform to the C standard.
20987 All callers of tparam changed to use tparam's actual API.
20988 * tparam.c (tparam1, tparam, tgoto):
20989 Use const pointers where appropriate.
20990
20991 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20992 * cm.h (struct cm): Likewise.
20993 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20994 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20995 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20996 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20997 (turn_on_face, init_tty): Likewise.
20998 * termchar.h (struct tty_display_info): Likewise.
20999
21000 * term.c (term_mouse_position): Rename local to avoid shadowing.
21001
21002 * alloc.c (mark_ttys): Move decl from here ...
21003 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
21004
21005 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
21006
21007 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
21008
21009 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
21010
21011 * search.c (compile_pattern_1): Remove argument regp, unused since
21012 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
21013 (compile_pattern): Don't pass it.
21014
21015 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
21016
21017 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
21018 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
21019 for ! HAVE_GTK3.
21020 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
21021
21022 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
21023
21024 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
21025 gdk_window_get_screen, gdk_window_get_geometry,
21026 gdk_x11_window_lookup_for_display and GDK_KEY_g.
21027 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
21028 (xg_get_pixbuf_from_pixmap): New function.
21029 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
21030 to Pixmap, take frame as parameter, remove GdkColormap parameter.
21031 Call xg_get_pixbuf_from_pixmap instead of
21032 gdk_pixbuf_get_from_drawable.
21033 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
21034 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
21035 (xg_check_special_colors): Use GtkStyleContext and its functions
21036 for HAVE_GTK3.
21037 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
21038 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
21039 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
21040 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
21041 Call gtk_widget_get_preferred_size.
21042 (xg_frame_resized): gdk_window_get_geometry only takes 5
21043 parameters.
21044 (xg_win_to_widget, xg_event_is_for_menubar):
21045 Call gdk_x11_window_lookup_for_display.
21046 (xg_set_widget_bg): New function.
21047 (delete_cb): New function.
21048 (xg_create_frame_widgets): Connect delete-event to delete_cb.
21049 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
21050 (xg_set_background_color): Call xg_set_widget_bg.
21051 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
21052 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
21053 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
21054 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
21055 if ! HAVE_GTK3.
21056 (update_frame_tool_bar): Call gtk_widget_hide.
21057 (xg_initialize): Use GDK_KEY_g.
21058
21059 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
21060 if ! HAVE_GTK3
21061 (x_session_initialize): Call gdk_x11_set_sm_client_id.
21062
21063 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
21064 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
21065 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
21066
21067 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
21068
21069 * w32xfns.c (select_palette): Check success of RealizePalette against
21070 GDI_ERROR, not zero.
21071
21072 See ChangeLog.11 for earlier changes.
21073
21074 ;; Local Variables:
21075 ;; coding: utf-8
21076 ;; End:
21077
21078 Copyright (C) 2011-2012 Free Software Foundation, Inc.
21079
21080 This file is part of GNU Emacs.
21081
21082 GNU Emacs is free software: you can redistribute it and/or modify
21083 it under the terms of the GNU General Public License as published by
21084 the Free Software Foundation, either version 3 of the License, or
21085 (at your option) any later version.
21086
21087 GNU Emacs is distributed in the hope that it will be useful,
21088 but WITHOUT ANY WARRANTY; without even the implied warranty of
21089 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21090 GNU General Public License for more details.
21091
21092 You should have received a copy of the GNU General Public License
21093 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.