* src/xdisp.c (select_frame_for_redisplay): Use select_window_1 to
[bpt/emacs.git] / src / ChangeLog
1 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
4 propagate redisplay's scrolling (if any) to the right window.
5 (redisplay_internal): Use ensure_selected_frame.
6 (display_mode_lines): Complete last fix.
7 * window.c (select_window_1): New func, extracted from select_window.
8 (select_window): Use it.
9 * window.h (select_window_1): Declare.
10
11 2012-12-17 Eli Zaretskii <eliz@gnu.org>
12
13 Emulate Posix ACL APIs on MS-Windows.
14 * w32.c: Include sddl.h and sys/acl.h.
15 (SDDL_REVISION_1): Define if not already defined.
16 (g_b_init_get_security_descriptor_dacl)
17 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
18 (g_b_init_is_valid_security_descriptor)
19 (g_b_init_set_file_security): New static flags.
20 (globals_of_w32): Initialize them to zero.
21 (SetFileSecurity_Name): New string constant.
22 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
23 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
24 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
25 (IsValidSecurityDescriptor_Proc): New typedefs.
26 (get_file_security, get_security_descriptor_owner)
27 (get_security_descriptor_group): Set errno to ENOTSUP.
28 (set_file_security, get_security_descriptor_dacl)
29 (is_valid_security_descriptor, convert_sd_to_sddl)
30 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
31 (acl_free, acl_get_file, acl_set_file): New functions.
32
33 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
34
35 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
36
37 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
38 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
39 for some of that bug's symptoms can now cause Emacs to abort.
40 Remove the workaround.
41 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
42 The bug that caused SIGCHLD to get lost has been fixed, and the
43 workaround for it can now cause Emacs to abort.
44
45 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
46
47 * sysdep.c (emacs_abort): Bump backtrace size to 40.
48 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
49 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
50
51 2012-12-16 Romain Francoise <romain@orebokech.com>
52
53 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
54 (Fcopy_file): Change last arg to `preserve_extended_attributes'
55 and copy ACL entries of file in addition to SELinux context if set.
56 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
57
58 * Makefile.in (LIBACL_LIBS): New macro.
59 (LIBES): Use it.
60
61 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
62
63 * fileio.c (internal_delete_file): Use bool for boolean.
64
65 2012-12-15 Eli Zaretskii <eliz@gnu.org>
66
67 Fix bug #13079 on MS-Windows with temp files not being deleted.
68 * w32.h (_child_process): New members input_file and
69 pending_deletion.
70 (register_child): First argument is now pid_t.
71 (record_infile, record_pending_deletion): New prototypes.
72
73 * w32proc.c (new_child): Initialize input_file and
74 pending_deletion members of the child.
75 (delete_child): Delete the child's temporary input file, if any,
76 that is pending deletion.
77 (register_child): First argument is now pid_t.
78 (record_infile, record_pending_deletion): New functions.
79 (reap_subprocess): Fix a typo in DebPrint string.
80 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
81
82 * fileio.c (internal_delete_file): Return an int again: non-zero
83 if delete-file succeeds, zero otherwise.
84
85 * lisp.h (internal_delete_file): Adjust prototype.
86
87 * callproc.c (Fcall_process): Don't overwrite infile with result
88 of DECODE_FILE.
89 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
90 asynchronous subprocess, record the name of the input file name,
91 if any.
92 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
93 delete the file, record it as pending deletion when the subprocess
94 exits.
95
96 2012-12-14 Eli Zaretskii <eliz@gnu.org>
97
98 * editfns.c [HAVE_PWD_H]: Include grp.h.
99
100 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
101
102 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
103
104 Fix permissions bugs with setgid directories etc. (Bug#13125)
105 * dired.c (Ffile_attributes): Return t as the 9th attribute,
106 to mark it as a placeholder. The old value was often wrong.
107 The only user of this attribute has been changed to use
108 file-ownership-preserved-p instead, with its new group arg.
109 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
110
111 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
112
113 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
114 Keep selected_window and selected_frame in sync.
115
116 2012-12-14 Eli Zaretskii <eliz@gnu.org>
117
118 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
119 try to get accurate owner and group information from NT file
120 security APIs. This is to make most callers of 'stat' and
121 'lstat', which don't need that information, much faster.
122
123 * dired.c (Ffile_attributes) [WINDOWSNT]:
124 Set w32_stat_get_owner_group to a non-zero value, to request accurate
125 owner and group information from 'lstat'.
126
127 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
128
129 * fileio.c (Finsert_file_contents): Don't put tail into head area,
130 as that confuses set-auto-coding, so insist on the head-read
131 returning the full 1024 bytes. Let lseek compute the tail offset;
132 less work for us. Do not ignore I/O errors when reading the tail.
133
134 * xdisp.c: Minor style fixes.
135 (init_iterator): Hoist assignment out of if-expression.
136 (markpos_of_region): Callers now test for sign, not for -1.
137
138 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
139
140 Minor redisplay optimization when the region length is zero.
141 * xdisp.c (markpos_of_region): New function.
142 (init_iterator): Do not highlight the region of zero length.
143 (redisplay_window): Check whether the region is of non-zero length.
144 (try_cursor_movement): Allow if the region length is zero.
145 (try_window_reusing_current_matrix, try_window_id): Likewise.
146
147 2012-12-13 Eli Zaretskii <eliz@gnu.org>
148
149 * search.c (search_buffer): Check the inverse translations of each
150 character in pattern when the buffer being searched is unibyte.
151 (Bug#13084)
152
153 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
154
155 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
156 files, fixing a regression from 24.2.
157 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
158
159 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
160
161 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
162 fstat shouldn't fail, and if it does fail copy-file should not proceed.
163 Remove unnecessary S_ISLNK test, as (contra the comments) this
164 function can't copy symlinks. Improve quality of error message
165 when attempting to copy files that are neither regular files nor
166 directories.
167
168 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
169
170 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
171 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
172 * window.c (Frecenter):
173 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
174 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
175
176 2012-12-12 Daniel Colascione <dancol@dancol.org>
177
178 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
179 the dumped Emacs is not a sparse file, greatly improving Cygwin
180 "make bootstrap" performance.
181
182 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
183
184 * inotify.c (inotify_callback): Generate an Emacs event for every
185 incoming inotify event.
186
187 2012-12-11 Eli Zaretskii <eliz@gnu.org>
188
189 * xdisp.c (handle_face_prop): Fix logic of computing
190 it->start_of_box_run_p.
191 (append_space_for_newline): If the glyph row is R2L, reset the
192 iterator's end_of_box_run_p flag before prepending the space glyph.
193 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
194 iterator's start_of_box_run_p flag before prepending the stretch.
195 (append_glyph, produce_image_glyph, append_composite_glyph)
196 (append_stretch_glyph, append_glyphless_glyph): Reverse the
197 left_box_line_p and right_box_line_p flags of the glyph for R2L
198 glyph rows. (Bug#13011)
199
200 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
201
202 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
203 if changed buffer is not shown in a window.
204 * insdel.c (prepare_to_modify_buffer): Likewise.
205 * window.c (replace_buffer_in_windows_safely): Do nothing
206 if buffer is not shown in a window.
207 (Fforce_window_update): Likewise if string or buffer argument
208 is passed.
209
210 2012-12-11 Eli Zaretskii <eliz@gnu.org>
211
212 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
213 encoded_file_name, which is what it is.
214
215 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
216
217 Consistently use marker_position and marker_byte_position.
218 * fringe.c (Ffringe_bitmaps_at_pos):
219 * indent.c (Fvertical_motion):
220 * insdel.c (prepare_to_modify_buffer):
221 * keyboard.c (make_lispy_position):
222 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
223 (window_scroll_pixel_based, displayed_window_lines)
224 (Fset_window_configuration):
225 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
226 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
227 Replace direct access to marker fields with calls
228 to marker_position and/or marker_byte_position.
229
230 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
231
232 * makefile.w32-in (SIG2STR_H): New macro.
233 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
234 ($(BLD)/w32notify.$(O)): Update dependencies.
235
236 2012-12-10 Daniel Colascione <dancol@dancol.org>
237
238 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
239 Windows file notification functionality unless WINDOWSNT.
240
241 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
242 declarations.
243
244 * w32fns.c (cache_system_info): Initialize the global hinst
245 variable here so various initialization calls DTRT.
246
247 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
248 (hinst): Remove unneeded extern declaration.
249 (_start): Remove initialization of above variables; remove
250 initialization of hinst, as cache_system_info now does that.
251
252 * emacs.c (main): Call cache_system_info early in startup; we
253 previously weren't calling it in Cygwin builds.
254
255 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
256 Teach the autoconf build system how to compile a Windows resource file
257 and link it to Emacs.
258
259 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
260
261 Per-buffer window counters.
262 * buffer.h (struct buffer): New member window_count.
263 (buffer_window_count): New function.
264 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
265 Initialize window_count.
266 (Fkill_buffer): Verify window_count for the buffer being killed.
267 (modify_overlay): Do not force redisplay if buffer is not shown
268 in any window.
269 (init_buffer_once): Initialize window_count for buffer_defaults
270 and buffer_local_symbols.
271 * window.h (buffer_shared): Remove declaration.
272 (wset_buffer): Convert from inline ...
273 * window.c (wset_buffer): ... to an ordinary function.
274 (adjust_window_count): New function.
275 (make_parent_window): Use it.
276 * xdisp.c (buffer_shared): Remove.
277 (redisplay_internal, redisplay_window): Adjust users.
278 (buffer_shared_and_changed): Use per-buffer window counter.
279
280 2012-12-10 Eli Zaretskii <eliz@gnu.org>
281
282 Support for filesystem notifications on MS-Windows.
283 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
284 and this is a TTY frame, signal the caller that keyboard input is
285 available.
286
287 * w32xfns.c (drain_message_queue): Now returns an int: an
288 indication whether any WM_EMACS_FILENOTIFY messages were found in
289 the queue.
290
291 * w32inevt.c (handle_file_notifications): New function.
292 (w32_console_read_socket): Call it to process file notifications.
293
294 * w32console.c (initialize_w32_display): Record the main thread ID
295 in dwMainThreadId.
296
297 * deps.mk (inotify.o): New dependency list.
298
299 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
300
301 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
302 (WM_EMACS_END): Bump value by 1.
303 (notification_buffer_in_use, file_notifications)
304 (notifications_size, notifications_desc): Declare.
305 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
306 Add prototypes.
307
308 * w32term.c (lispy_file_action, queue_notifications): New functions.
309 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
310 <Qrenamed_to>: New symbols.
311 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
312
313 * w32notify.c: New file, implements file event notifications for
314 MS-Windows.
315
316 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
317 by posting it to the w32_read_socket queue.
318
319 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
320
321 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
322 (GLOBAL_SOURCES): Add w32notify.c
323 ($(BLD)/w32notify.$(O)): New set of dependencies.
324
325 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
326
327 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
328 Handle FILE_NOTIFY_EVENT.
329 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
330 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
331 w32notify-handle-event by default.
332
333 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
334 syms_of_w32notify.
335
336 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
337
338 Support for filesystem notifications on GNU/Linux via inotify.
339 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
340
341 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
342
343 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
344 (syms_of_keyboard): DEFSYM it.
345 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
346 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
347 Qfile_inotify events.
348 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
349 special-event-map to inotify-handle-event.
350
351 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
352
353 * Makefile.in (base_obj): Add inotify.o.
354
355 * inotify.c: New file.
356
357 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
358
359 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
360
361 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
362
363 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
364 DWORD_PTR, for compatibility with 64-bit builds.
365
366 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
367 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
368 (system_process_attributes): Use SIZE_T rather than DWORD, for
369 compatibility with 64-bit builds.
370
371 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
372
373 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
374
375 2012-12-10 Eli Zaretskii <eliz@gnu.org>
376
377 * indent.c (Fvertical_motion): If a display string will be
378 displayed on the left or the right margin, don't consider it as a
379 factor in cursor positioning. (Bug#13108)
380
381 2012-12-10 Martin Rudalics <rudalics@gmx.at>
382
383 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
384
385 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
386
387 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
388 for string length.
389
390 2012-12-08 Eli Zaretskii <eliz@gnu.org>
391
392 * w32.c (unsetenv): Return 0 if the input string is too long.
393
394 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
395
396 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
397 * alloc.c (xputenv): New function.
398 * dbusbind.c (Fdbus_init_bus):
399 * emacs.c (main):
400 * xterm.c (x_term_init):
401 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
402 * editfns.c (initial_tz): Move static var decl up.
403 (tzvalbuf_in_environ): New static var.
404 (init_editfns): Initialize these two static vars.
405 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
406 Save old TZ value on stack, if it's small.
407 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
408 instead, use xputenv+unsetenv to set and restore TZ.
409 (environbuf): Remove static var. All uses removed.
410 (Fset_time_zone_rule): Do not save TZ and environ;
411 no longer needed here.
412 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
413 Move to inside set_time_zone_rule; they don't need file scope any more.
414 (set_time_zone_rule): Maintain the TZ=value string separately.
415 (syms_of_editfns): Don't initialize initial_tz;
416 init_editfns now does it.
417 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
418 * lisp.h (xputenv): New decl.
419
420 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
421
422 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
423
424 2012-12-08 Eli Zaretskii <eliz@gnu.org>
425
426 * w32.c (unsetenv, sys_putenv): New functions.
427
428 2012-12-08 Chong Yidong <cyd@gnu.org>
429
430 * editfns.c (Finsert_char): Make the error message more
431 informative (Bug#12992).
432
433 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
434
435 Simplify get_lim_data.
436 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
437 Remove USG and vlimit methods; no longer used these days.
438 Add #error catchall just in case.
439
440 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
441 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
442 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
443 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
444 (deleted_pid_list, Fdelete_process, create_process)
445 (record_child_status_change, handle_child_signal, deliver_child_signal)
446 (init_process_emacs, syms_of_process):
447 Assume SIGCHLD is defined.
448 (parse_signal): Remove. All uses removed.
449 (abbr_to_signal): New static function.
450 (Fsignal_process): Use it to convert signal names to ints.
451 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
452 kill (getpgrp (), ...).
453 (emacs_sigaction_init): Assume SIGCHLD is defined.
454 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
455 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
456 * syssignal.h (EMACS_KILLPG): Remove.
457 All uses replaced by 'kill' with a negative pid.
458 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
459 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
460
461 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
462
463 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
464 This will cause a production Emacs to dump core instead of
465 infinite-looping.
466
467 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
468
469 * frame.c (make_frame): Do not set window's buffer to t.
470 * window.c (Fsplit_window_internal): Likewise. Previously it was
471 used to indicate that the window is being set up. Now we use
472 set_window_buffer for all new windows, so the condition in ...
473 (Fset_window_buffer): ... is always true and can be removed.
474
475 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
476
477 Convenient macro to check whether the buffer is hidden.
478 * buffer.h (BUFFER_HIDDEN_P): New macro.
479 * frame.c (make_frame): Use it. Adjust comment.
480 * buffer.c (candidate_buffer): New function.
481 (Fother_buffer, other_buffer_safely): Use it.
482
483 2012-12-06 Eli Zaretskii <eliz@gnu.org>
484
485 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
486 if the child process is still running. Instead, exit the wait
487 loop and return zero. (Bug#13086)
488
489 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
490
491 * frame.h (x_char_width, x_char_height): Remove prototypes.
492 * w32term.h (x_char_width, x_char_height): Likewise.
493 * xfns.c (x_char_width, x_char_height): Remove.
494 * w32fns.c (x_char_width, x_char_height): Likewise.
495 * nsfns.c (x_char_width, x_char_height): Likewise.
496 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
497 all window frames.
498 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
499 * keyboard.c (command_loop_1): Remove prototype.
500 (command_loop_2, top_level_1): Add static to match prototype.
501
502 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
503
504 Fix a recently-introduced delete-process race condition.
505 * callproc.c, process.h (record_kill_process):
506 New function, containing part of the old call_process_kill.
507 (call_process_kill): Use it.
508 This does not change call_process_kill's behavior.
509 * process.c (Fdelete_process): Use record_kill_process to fix a
510 race condition that could cause Emacs to lose track of a child.
511
512 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
513
514 Avoid code duplication between prev_frame and next_frame.
515 * frame.c (candidate_frame): New function. Add comment.
516 (prev_frame, next_frame): Use it. Adjust comment.
517
518 2012-12-06 Eli Zaretskii <eliz@gnu.org>
519
520 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
521 fails, signal an error instead of continuing with an empty
522 string. (Bug#13079)
523 Encode expanded temp file pattern before passing it to mkstemp or
524 mktemp.
525
526 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
527 Encode the file name before passing it to dostounix_filename, in
528 case it will downcase it (under w32-downcase-file-names).
529 (Bug#12933)
530
531 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
532
533 Minor call-process cleanups.
534 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
535 at the same time as other platforms, to simplify analysis.
536 No need for fd0_volatile since we have synch_process_fd.
537 Avoid needless emacs_close; arg is always negative.
538
539 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
540
541 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
542 processes.
543
544 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
545
546 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
547 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
548 and mouse_face_hidden members to a bitfields.
549 * frame.h (struct frame): Remove set-but-not-used space_width member.
550 (FRAME_SPACE_WIDTH): Remove.
551 * nsterm.m, w32term.c, xterm.c: Adjust users.
552 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
553 member. Adjust users. Convert term_initted, delete_in_insert_mode,
554 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
555 members to a bitfields.
556
557 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
558
559 Don't let call-process be a zombie factory (Bug#12980).
560 Fixing this bug required some cleanup of the signal-handling code.
561 As a side effect, this change also fixes a longstanding rare race
562 condition whereby Emacs could mistakenly kill unrelated processes,
563 and it fixes a bug where a second C-g does not kill a recalcitrant
564 synchronous process in GNU/Linux and similar platforms.
565 The patch should also fix the last vestiges of Bug#9488,
566 a bug which has mostly been fixed on the trunk by other changes.
567 * callproc.c, process.h (synch_process_alive, synch_process_death)
568 (synch_process_termsig, sync_process_retcode):
569 Remove. All uses removed, to simplify analysis and so that
570 less consing is done inside critical sections.
571 * callproc.c (call_process_exited): Remove. All uses replaced
572 with !synch_process_pid.
573 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
574 These take the role of what used to be in unwind-protect arg.
575 All uses changed.
576 (block_child_signal, unblock_child_signal):
577 New functions, to avoid races that could kill innocent-victim processes.
578 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
579 (call_process_kill): Record killed processes as deleted, so that
580 zombies do not clutter up the system. Do this inside a critical
581 section, to avoid a race that would allow the clutter.
582 (call_process_cleanup): Fix code so that the second C-g works again
583 on common platforms such as GNU/Linux.
584 (Fcall_process): Create the child process in a critical section,
585 to fix a race condition. If creating an asynchronous process,
586 record it as deleted so that zombies do not clutter up the system.
587 Do unwind-protect for WINDOWSNT too, as that's simpler in the
588 light of these changes. Omit unnecessary call to emacs_close
589 before failure, as the unwind-protect code does that.
590 * callproc.c (call_process_cleanup):
591 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
592 * process.c (record_deleted_pid): New function, containing
593 code refactored out of Fdelete_process.
594 (Fdelete_process): Use it.
595 (process_status_retrieved): Remove. All callers changed to use
596 child_status_change.
597 (record_child_status_change): Remove, folding its contents into ...
598 (handle_child_signal): ... this signal handler. Now, this
599 function is purely a handler for SIGCHLD, and is not called after
600 a synchronous waitpid returns; the synchronous code is moved to
601 wait_for_termination. There is no need to worry about reaping
602 more than one child now.
603 * sysdep.c (get_child_status, child_status_changed): New functions.
604 (wait_for_termination): Now takes int * status and bool
605 interruptible arguments, too. Do not record child status change;
606 that's now the caller's responsibility. All callers changed.
607 Reimplement in terms of get_child_status.
608 (wait_for_termination_1, interruptible_wait_for_termination):
609 Remove. All callers changed to use wait_for_termination.
610 * syswait.h: Include <stdbool.h>, for bool.
611 (record_child_status_change, interruptible_wait_for_termination):
612 Remove decls.
613 (record_deleted_pid, child_status_changed): New decls.
614 (wait_for_termination): Adjust to API changes noted above.
615
616 * bytecode.c, lisp.h (Qbytecode): Remove.
617 No longer needed after 2012-11-20 interactive-p changes.
618
619 2012-12-03 Eli Zaretskii <eliz@gnu.org>
620
621 * xdisp.c (redisplay_window): If the cursor is visible, but inside
622 the scroll margin, move point outside the margin. (Bug#13055)
623
624 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
625
626 * gtkutil.c (my_log_handler): New function.
627 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
628
629 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
630
631 * lisp.h (modify_region): Rename to...
632 (modify_region_1): ...new prototype.
633 * textprop.c (modify_region): Now static. Adjust users.
634 * insdel.c (modify_region): Rename to...
635 (modify_region_1): ...new function to work with current buffer.
636 Adjust comment and users. Use true and false for booleans.
637
638 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
639
640 * alloc.c (free_save_value): New function.
641 (safe_alloca_unwind): Use it.
642 * lisp.h (free_save_value): New prototype.
643 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
644 Add comment.
645 (save_excursion_restore): Adjust to match saved data structure.
646 Use free_save_value to offload some work from GC. Drop obsolete
647 #if 0 code.
648
649 2012-12-03 Chong Yidong <cyd@gnu.org>
650
651 * fileio.c (Vauto_save_list_file_name): Doc fix.
652
653 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
654
655 * w32fns.c: Remove prototype of atof.
656 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
657 builds.
658 (file_dialog_callback): Make it UINT_PTR.
659
660 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
661 with 64-bit builds.
662
663 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
664 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
665 defined.
666
667 2012-12-03 Glenn Morris <rgm@gnu.org>
668
669 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
670
671 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
672
673 Fix xpalloc confusion after memory is exhausted.
674 * alloc.c (xpalloc): Comment fix.
675 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
676 and signals an error, do not clear charset_table_size, as
677 charset_table is still valid.
678 * doprnt.c (evxprintf): Clear *BUF after freeing it.
679
680 Use execve to avoid need to munge environ (Bug#13054).
681 * callproc.c (Fcall_process):
682 * process.c (create_process):
683 Don't save and restore environ; no longer needed.
684 * callproc.c (child_setup):
685 Use execve, not execvp, to preserve environ.
686
687 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
688
689 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
690
691 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
692
693 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
694 display for sliced images (Bug#10500).
695
696 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
697
698 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
699
700 * doc.c (Fdocumentation): Re-add handling of function-documentation,
701 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
702
703 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
704
705 * xdisp.c (window_outdated): Remove eassert since it hits
706 some suspicious corner cases (see Bug#13007 and Bug#13012).
707 (mode_line_update_needed): New function.
708 (redisplay_internal, redisplay_window): Use it.
709 (ensure_selected_frame): New function.
710 (redisplay_internal, unwind_redisplay): Use it.
711 (redisplay_internal): Move comment about buffer_shared...
712 (buffer_shared_and_changed): ...near to its real use.
713
714 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
715
716 * callproc.c (Fcall_process): Don't misreport vfork failure.
717
718 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
719
720 * callproc.c (Fcall_process): Fix vfork portability problems.
721 Do not assume that fd[0], count, filefd, and save_environ survive
722 vfork. Fix bug whereby wrong errno value could be reported for
723 pipe failure. Some minor cleanups, too, as follows. Move buf and
724 bufsize to the context where they're needed. Change new_argv to
725 be of type char **, as this is more convenient and avoids casts.
726 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
727 Now local constants, not macros.
728
729 2012-11-18 Kenichi Handa <handa@gnu.org>
730
731 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
732 for the variable "f".
733
734 2012-11-13 Kenichi Handa <handa@gnu.org>
735
736 * font.c (font_unparse_xlfd): Exclude special characters from the
737 generating XLFD name.
738
739 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
740
741 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
742 * dired.c (stat_uname, stat_gname):
743 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
744
745 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
746 * dired.c (directory_files_internal, file_name_completion):
747 Assume EAGAIN and EINTR are defined.
748
749 * fileio.c (Fcopy_file): Assume EISDIR is defined.
750 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
751 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
752 * lread.c (readbyte_from_file): Assume EINTR is defined.
753 * process.c (wait_reading_process_output, send_process) [subprocesses]:
754 Assume EIO and EAGAIN are defined.
755 * unexcoff.c (write_segment): Assume EFAULT is defined.
756
757 2012-11-27 Eli Zaretskii <eliz@gnu.org>
758
759 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
760 (Bug#11964)
761
762 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
763 highlighting on the frame was cleared. Prevents assertion
764 violations when repeatedly clicking on the "Top" link of the
765 "bread-crumbs" in Info buffers.
766
767 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
768
769 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
770
771 2012-11-24 Ken Brown <kbrown@cornell.edu>
772
773 * keyboard.c (HAVE_MOUSE):
774 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
775 were always defined.
776
777 2012-11-24 Eli Zaretskii <eliz@gnu.org>
778
779 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
780 between bpos_covered and bpos_max. This fixes cursor display when
781 several display strings follow each other.
782
783 * .gdbinit (pgx): If the glyph's object is a string, display the
784 pointer to string data, rather than the value of the string object
785 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
786
787 * indent.c (Fvertical_motion): If the starting position is covered
788 by a display string, return to one position before that, to avoid
789 overshooting it inside move_it_to. (Bug#12930)
790
791 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
792
793 * frame.h (struct frame): Remove display_preempted member
794 since all users are dead long ago.
795 * nsterm.h (struct x_output): Use the only dummy member.
796 * w32menu.c (pending_menu_activation): Remove since not
797 really used.
798 (set_frame_menubar): Adjust user.
799 * w32term.h (struct x_output): Drop outdated #if 0 code.
800 (struct w32_output): Use bitfields for explicit_parent,
801 asked_for_visible and menubar_active members.
802 Drop unused pending_menu_activation member.
803 * xterm.h (struct x_output): Drop outdated #if 0 code.
804 Use bitfields for explicit_parent, asked_for_visible,
805 has_been_visible and net_wm_state_hidden_seen members.
806
807 2012-11-23 Eli Zaretskii <eliz@gnu.org>
808
809 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
810 of a literal "/". (Bug#12955)
811 (gl-stamp): Invoke fc.exe directly, not through cmd.
812
813 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
814
815 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
816 * dired.c: Assume HAVE_DIRENT_H.
817 (NAMLEN): Remove, replacing with ...
818 (dirent_namelen): New function. All uses changed. Use the GNU macro
819 _D_EXACT_NAMELEN if available, as it's faster than strlen.
820 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
821 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
822 * makefile.w32-in (DIR_H): Remove. All uses replaced with
823 $(NT_INC)/dirent.h.
824 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
825 * ndir.h: Rename to ../nt/inc/dirent.h.
826 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
827 Do not include <dirent.h>; no longer needed.
828 * w32.c: Include <dirent.h> rather than "ndir.h".
829
830 2012-11-23 Chong Yidong <cyd@gnu.org>
831
832 * xftfont.c (xftfont_open): Remove duplicate assignment.
833
834 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
835
836 * alloc.c (Fgarbage_collect): Unblock input after clearing
837 gc_in_progress to avoid note_mouse_highlight glitch with GC.
838 * frame.h (FRAME_MOUSE_UPDATE): New macro.
839 * msdos.c (IT_frame_up_to_date): Use it here...
840 * w32term.c (w32_frame_up_to_date): ...here...
841 * xterm.c (XTframe_up_to_date): ...and here...
842 * nsterm.m (ns_frame_up_to_date): ...but not here.
843 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
844 Adjust users.
845 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
846 Do not check whether GC is in progress.
847
848 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
849
850 * xdisp.c (window_buffer_changed): New function.
851 (update_menu_bar, update_tool_bar): Use it to
852 simplify large 'if' statements.
853 (redisplay_internal): Generalize commonly used
854 'tail' and 'frame' local variables.
855
856 2012-11-22 Eli Zaretskii <eliz@gnu.org>
857
858 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
859 with Windows system header.
860
861 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
862
863 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
864 * alloc.c: Assume unistd.h exists.
865 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
866 * sysdep.c (get_current_dir_name): Assume getcwd exists.
867 (getwd) [USG]: Remove; no longer needed.
868 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
869 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
870 * w32.h (getcwd): Remove decl.
871
872 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
873
874 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
875 Make it set selected_window as well.
876 (update_tool_bar): Use it.
877
878 2012-11-21 Ken Brown <kbrown@cornell.edu>
879
880 * emacs.c (main): Set the G_SLICE environment variable for all
881 Cygwin builds, not just GTK builds. See
882 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
883
884 2012-11-21 Eli Zaretskii <eliz@gnu.org>
885
886 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
887 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
888 Define for the MSVC compiler.
889
890 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
891
892 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
893 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
894 dostounix_filename. Prevents crashes down the road, because
895 dostounix_filename assumes it gets a unibyte string.
896 Reported by Michel de Ruiter <michel@sentient.nl>, see
897 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
898
899 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
900
901 Conflate Qnil and Qunbound for `symbol-function'.
902 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
903 * lread.c (init_obarray): Set `function' fields to Qnil.
904 * eval.c (Fcommandp): Ignore Qunbound.
905 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
906 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
907 Test NILP rather than Qunbound.
908 (Ffmakunbound): Set to Qnil.
909 (Fsymbol_function): Never signal an error.
910 (Finteractive_form): Ignore Qunbound.
911
912 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
913
914 * eval.c (interactive_p): Remove no-longer-used decl.
915
916 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
917
918 * xdisp.c (buffer_shared): Adjust comment.
919 (buffer_shared_and_changed): New function.
920 (prepare_menu_bars, redisplay_internal): Use it to
921 decide whether all windows or frames should be updated.
922 (window_outdated): New function.
923 (text_outside_line_unchanged_p, redisplay_window): Use it.
924 (redisplay_internal): Likewise. Fix indentation.
925
926 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
927
928 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
929 (syms_of_eval): Remove corresponding defsubr.
930 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
931
932 2012-11-19 Daniel Colascione <dancol@dancol.org>
933
934 * w32fns.c (Fx_file_dialog):
935 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
936 cygwin_convert_file_name*.
937
938 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
939 Rename cygwin_convert_path* to cygwin_convert_file_name*.
940
941 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
942
943 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
944
945 2012-11-18 Eli Zaretskii <eliz@gnu.org>
946
947 * w32select.c: Include w32common.h before w32term.h, so that
948 windows.h gets included before w32term.h uses some of its
949 features, see below.
950
951 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
952 New typedefs.
953 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
954 New prototypes.
955 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
956
957 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
958
959 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
960 (ns_select): Return at once if events are held (Bug#12834).
961
962 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
963
964 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
965 Needed following 2012-10-20 change. (Bug#12902)
966
967 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
968
969 * w32proc.c (waitpid): Remove unused label get_result.
970
971 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
972
973 * makefile.w32-in (SYSWAIT_H): New macro.
974 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
975 ($(BLD)/sysdep.$(O)): Update dependencies.
976
977 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
978
979 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
980 * callproc.c (relocate_fd): Assume F_DUPFD.
981 * emacs.c, term.c (O_RDWR): Remove.
982 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
983 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
984 * nsterm.m: Assume <fcntl.h> exists.
985 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
986 (create_pty, Fmake_network_process, server_accept_connection)
987 (wait_reading_process_output, init_process_emacs):
988 Assume O_NONBLOCK.
989 (wait_reading_process_output): Put in a special case for WINDOWSNT
990 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
991 It's not clear this is needed, but it's a more-conservative change.
992 (create_process): Assume FD_CLOEXEC.
993 (create_process, create_pty): Assume O_NOCTTY.
994 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
995 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
996 Omit if not DOS_NT, since F_GETFL is not defined there.
997 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
998 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
999 (O_NOCTTY): Remove.
1000 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
1001 lack it, since gnulib guarantees this.
1002 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
1003
1004 2012-11-17 Eli Zaretskii <eliz@gnu.org>
1005
1006 * w32.c (faccessat): Pretend that directories have the execute bit
1007 set. Emacs expects that, e.g., in files.el:cd-absolute.
1008
1009 * w32proc.c (create_child): Don't clip the PID of the child
1010 process to fit into an Emacs integer, as this is no longer a
1011 restriction.
1012 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
1013 reaping only the process specified by PID argument, if that is
1014 positive. Use PID instead of dead_child to know which process to
1015 reap. Wait for the child to die only if WNOHANG is not in
1016 OPTIONS.
1017 (sys_select): Don't set dead_child.
1018
1019 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
1020 as it is no longer needed.
1021
1022 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
1023 no longer needed.
1024 (record_child_status_change): Remove the setting of
1025 record_at_most_one_child for the !WNOHANG case.
1026
1027 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1028
1029 Fix problems in ns port found by static checking.
1030 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
1031 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
1032 not to process group.
1033 (ns_select): Use emacs_write, not write, as that's more robust
1034 in the presence of signals.
1035 (fd_handler:): Check for read errors.
1036
1037 2012-11-16 Glenn Morris <rgm@gnu.org>
1038
1039 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
1040
1041 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
1042
1043 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
1044
1045 2012-11-16 Eli Zaretskii <eliz@gnu.org>
1046
1047 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
1048 use the same value of thread handle.
1049 (start_timer_thread): If the timer thread exited (due to error),
1050 clean up by closing the two handles it used. Duplicate the caller
1051 thread's handle here, so it gets duplicated only once, when
1052 launching the timer thread. Set priority of the timer thread, not
1053 the caller thread.
1054 (getitimer): Don't duplicate the caller thread's handle here.
1055 (Bug#12832)
1056
1057 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
1058
1059 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
1060 called (Bug#12834).
1061
1062 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
1063
1064 Remove no-longer-used pty_max_bytes variable.
1065 * process.c (pty_max_bytes): Remove; unused.
1066 (send_process): Do not set it.
1067
1068 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
1069
1070 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
1071 Update dependencies.
1072
1073 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
1074
1075 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
1076 This follows up on the 2012-09-29 patch that removed indirection
1077 for the 'function' field. Reported by Sergey Vinokurov in
1078 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
1079
1080 2012-11-14 Eli Zaretskii <eliz@gnu.org>
1081
1082 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
1083 different name, as the MS runtime does not have such a function,
1084 and probably never will.) All callers changed. Ignore DIRFD
1085 value if PATH is an absolute file name, to match Posix spec
1086 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
1087 symlinks.
1088
1089 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
1090
1091 * xdisp.c (echo_area_display, redisplay_internal):
1092 Omit redundant check whether frame_garbaged is set.
1093
1094 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
1095
1096 Use faccessat, not access, when checking file permissions (Bug#12632).
1097 This fixes a bug that has been present in Emacs since its creation.
1098 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
1099 which must set some sort of record. (Torek's bug report was against
1100 a predecessor of GNU Emacs, but GNU Emacs happened to have the
1101 same common flaw.) See Torek's Usenet posting
1102 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
1103 Posted: Fri Apr 8 14:18:56 1983.
1104 * Makefile.in (LIB_EACCESS): New macro.
1105 (LIBES): Use it.
1106 * callproc.c (init_callproc):
1107 * charset.c (init_charset):
1108 * fileio.c (check_existing, check_executable, check_writable)
1109 (Ffile_readable_p):
1110 * lread.c (openp, load_path_check):
1111 * process.c (allocate_pty):
1112 * xrdb.c (file_p):
1113 Use effective UID when checking permissions, not real UID.
1114 * callproc.c (init_callproc):
1115 * charset.c (init_charset):
1116 * lread.c (load_path_check, init_lread):
1117 Test whether directories are accessible, not merely whether they exist.
1118 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
1119 * fileio.c (check_existing, check_executable, check_writable)
1120 (Ffile_readable_p):
1121 Use symbolic names instead of integers for the flags, as they're
1122 portable now.
1123 (check_writable): New arg AMODE. All uses changed.
1124 Set errno on failure.
1125 (Ffile_readable_p): Use faccessat, not stat + open + close.
1126 (Ffile_writable_p): No need to call check_existing + check_writable.
1127 Just call check_writable and then look at errno. This saves a syscall.
1128 dir should never be nil; replace an unnecessary runtime check
1129 with an eassert. When checking the parent directory of a nonexistent
1130 file, check that the directory is searchable as well as writable, as
1131 we can't create files in unsearchable directories.
1132 (file_directory_p): New function, which uses 'stat' on most platforms
1133 but faccessat with D_OK (for efficiency) if WINDOWSNT.
1134 (Ffile_directory_p, Fset_file_times): Use it.
1135 (file_accessible_directory_p): New function, which uses a single
1136 syscall for efficiency.
1137 (Ffile_accessible_directory_p): Use it.
1138 * xrdb.c (file_p): Use file_directory_p.
1139 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
1140 * lread.c (openp): When opening a file, use fstat rather than
1141 stat, as that avoids a permissions race. When not opening a file,
1142 use file_directory_p rather than stat.
1143 (dir_warning): First arg is now a usage string, not a format.
1144 Use errno. All uses changed.
1145 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
1146 that merely introduced a race.
1147 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
1148 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
1149 and similarly for the other O_* flags.
1150 * w32.c (sys_faccessat): Rename from sys_access and switch to
1151 faccessat's API. All uses changed.
1152 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
1153 (magic_db): Rename from magic_file_p.
1154 (magic_db, search_magic_path): Return an XrmDatabase rather than a
1155 char *, so that we don't have to test for file existence
1156 separately from opening the file for reading. This removes a race
1157 fixes a permission-checking problem, and simplifies the code.
1158 All uses changed.
1159 (file_p): Remove; no longer needed.
1160
1161 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
1162
1163 Omit glyphs initialization at startup.
1164 * dispnew.c (glyphs_initialized_initially_p): Remove.
1165 (adjust_frame_glyphs_initially): Likewise. Adjust users.
1166 (Fredraw_frame): Move actual code from here...
1167 (redraw_frame): ...to here. Add eassert. Adjust comment.
1168 (Fredraw_display): Use redraw_frame.
1169 * xdisp.c (clear_garbaged_frames): Likewise.
1170
1171 2012-11-13 Eli Zaretskii <eliz@gnu.org>
1172
1173 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
1174 passed to pint2str and pint2hrstr to be at most the size of the
1175 frame's decode_mode_spec_buffer. This avoids crashes with very
1176 large values of FIELD_WIDTH argument to decode_mode_spec.
1177 (Bug#12867)
1178
1179 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
1180
1181 Fix a race with verify-visited-file-modtime (Bug#12863).
1182 Since at least 1991 Emacs has ignored an mtime difference of no
1183 more than one second, but my guess is that this was to work around
1184 file system bugs that were fixed long ago. Since the race is
1185 causing problems now, let's remove that code.
1186 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
1187 whose time stamp is off by no more than a second. Insist that the
1188 file time stamps match exactly.
1189
1190 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1191
1192 * frame.h (struct frame): Convert external_tool_bar member to
1193 1-bit unsigned bitfield.
1194 * termhooks.h (struct terminal): Remove mouse_moved member since
1195 all users are long dead. Adjust comment on mouse_position_hook.
1196
1197 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1198
1199 Simplify by using FOR_EACH_FRAME here and there.
1200 * frame.c (next_frame, prev_frame, other_visible_frames)
1201 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
1202 * w32term.c (x_window_to_scroll_bar): Likewise.
1203 * window.c (window_list): Likewise.
1204 * xdisp.c (x_consider_frame_title): Likewise.
1205 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
1206 * xfns.c (x_window_to_frame, x_any_window_to_frame)
1207 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
1208 * xmenu.c (menubar_id_to_frame): Likewise.
1209 * xselect.c (frame_for_x_selection): Likewise.
1210 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
1211 (x_window_to_menu_bar): Likewise.
1212 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
1213
1214 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
1215
1216 * data.c (Qdefalias_fset_function): Now static.
1217
1218 Another tweak to vectorlike_header change.
1219 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
1220 Remove, and replace all uses with ...
1221 (next_in_free_list, set_next_in_free_list):
1222 New functions, which respect C's aliasing rules better.
1223
1224 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
1225
1226 * window.c (list4i): Rename from 'quad'. All uses changed.
1227 Needed because <sys/types.h> defines 'quad' on Solaris 10.
1228
1229 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
1230
1231 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
1232 warning about mixing declarations and code in ISO C90.
1233
1234 2012-11-10 Martin Rudalics <rudalics@gmx.at>
1235
1236 * window.c (Fsplit_window_internal): Set combination limit of
1237 new parent window to t iff Vwindow_combination_limit is t;
1238 fixing a regression introduced with the change from 2012-09-22.
1239 (Fset_window_combination_limit): Fix doc-string.
1240
1241 2012-11-10 Eli Zaretskii <eliz@gnu.org>
1242
1243 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
1244 amount when the scroll margins are too large. When scrolling
1245 backwards in the buffer, give up if cannot reach point or the
1246 scroll margin within a reasonable number of screen lines.
1247 Fixes point position in window under scroll-up/down-aggressively when
1248 point is positioned many lines beyond the window top/bottom.
1249 (Bug#12811)
1250
1251 * ralloc.c (relinquish): If real_morecore fails to return memory
1252 to the system, don't crash; instead, leave the last heap
1253 unchanged and return. (Bug#12774)
1254
1255 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1256
1257 * lisp.h (AUTOLOADP): New macro.
1258 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
1259 * data.c (Ffset): Remove special ad-advice-info handling.
1260 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
1261 (Fsubr_arity): CSE.
1262 (Finteractive_form): Simplify.
1263 (Fquo): Don't insist on having at least 2 arguments.
1264 (Qdefalias_fset_function): New var.
1265
1266 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1267
1268 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
1269
1270 * nsfont.m (Qcondensed, Qexpanded): New variables.
1271 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
1272 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
1273
1274 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1275
1276 Fix recently introduced crash on MS-Windows (Bug#12839).
1277 * w32term.h (struct scroll_bar): Use convenient header.
1278 (SCROLL_BAR_VEC_SIZE): Remove.
1279 * w32term.c (x_scroll_bar_create): Use VECSIZE.
1280
1281 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1282
1283 Tweak last vectorlike_header change.
1284 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
1285 vectorlike object on the free list. This is introduced to avoid
1286 some (but not all) pointer casting and aliasing problems, see
1287 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
1288 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
1289 objects.
1290 (xvectype, xvecsize): Use them to examine Lisp_Object values.
1291
1292 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1293
1294 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
1295 been removed, so remove them here also.
1296
1297 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1298
1299 * doc.c (Fdocumentation): Handle new property
1300 dynamic-docstring-function to replace the old ad-advice-info.
1301
1302 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
1303
1304 * fns.c (Qeql, hashtest_eq): Now static.
1305
1306 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1307
1308 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
1309 * fns.c (hashfn_eq, hashfn_eql, sxhash):
1310 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
1311 * buffer.c (compare_overlays): Use XLI rather than XHASH.
1312
1313 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
1314
1315 Use same hash function for hashfn_profiler as for hash_string etc.
1316 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
1317 * lisp.h (sxhash_combine): New inline function, with the contents
1318 of the old SXHASH_COMBINE.
1319 * profiler.c (hashfn_profiler): Use it, instead of having a
1320 special hash function containing a comparison that always yields 1.
1321
1322 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1323
1324 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
1325 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
1326 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
1327 Remove unused vars.
1328
1329 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
1330
1331 * image.c (xpm_make_color_table_h): Fix compiler error because
1332 make_hash_table changed.
1333
1334 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
1335
1336 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
1337
1338 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1339
1340 Use ad-hoc comparison function for the profiler's hash-tables.
1341 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
1342 (make_log): Use them.
1343 (handle_profiler_signal): Don't inhibit quit any longer since we don't
1344 call Fequal any more.
1345 (Ffunction_equal): New function.
1346 (cmpfn_profiler, hashfn_profiler): New functions.
1347 (syms_of_profiler): Initialize them.
1348 * lisp.h (struct hash_table_test): New struct.
1349 (struct Lisp_Hash_Table): Use it.
1350 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
1351 * fns.c (make_hash_table): Take a struct to describe the test.
1352 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1353 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
1354 (hash_lookup, hash_remove_from_table): Move assertion checking of
1355 hashfn result here. Check hash-equality before calling cmpfn.
1356 (Fmake_hash_table): Adjust call to make_hash_table.
1357 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
1358 (syms_of_fns): Initialize them.
1359 * emacs.c (main): Move syms_of_fns earlier.
1360 * xterm.c (syms_of_xterm):
1361 * category.c (hash_get_category_set): Adjust call to make_hash_table.
1362 * print.c (print_object): Adjust to new hash-table struct.
1363 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
1364
1365 2012-11-08 Eli Zaretskii <eliz@gnu.org>
1366
1367 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
1368 value of w32-scroll-lock-modifier is neither nil nor one of the
1369 known key modifiers. (Bug#12806)
1370
1371 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1372
1373 Shrink struct vectorlike_header to the only size field.
1374 * lisp.h (enum pvec_type): Avoid explicit enum member values.
1375 Adjust comment.
1376 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
1377 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
1378 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
1379 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
1380 information from the vector header. Adjust comment.
1381 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
1382 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
1383 layout.
1384 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
1385 (struct vectorlike_header): Remove next member. Adjust comment.
1386 (struct Lisp_Subr): Add convenient header. Adjust comment.
1387 (allocate_pseudovector): Adjust prototype.
1388 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1389 (sweep_string, lisp_malloc): Remove useless prototypes.
1390 (enum mem_type): Adjust comment.
1391 (NEXT_IN_FREE_LIST): New macro.
1392 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1393 (Fmake_bool_vector): Likewise.
1394 (struct large_vector): New type to represent allocation unit for
1395 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1396 (large_vectors): Change type to struct large_vector.
1397 (allocate_vector_from_block): Simplify.
1398 (PSEUDOVECTOR_NBYTES): Replace with...
1399 (vector_nbytes): ...new function. Adjust users.
1400 (sweep_vectors): Adjust processing of large vectors.
1401 (allocate_vectorlike): Likewise.
1402 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1403 Add easserts. Adjust XSETPVECTYPESIZE usage.
1404 (allocate_buffer): Use BUFFER_PVEC_INIT.
1405 (live_vector_p): Adjust to match large vector.
1406 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1407 * buffer.h (struct buffer): Add next member.
1408 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1409 New macros.
1410 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1411 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1412 (copy_hash_table): Adjust to match vector header change.
1413 * lread.c (defsubr): Use XSETPVECTYPE.
1414 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1415 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1416 (xvecsize): New command.
1417
1418 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1419
1420 * keyboard.c (event_to_kboard): Do not dereference
1421 frame_or_window field of SELECTION_REQUEST_EVENT
1422 and SELECTION_CLEAR_EVENT events (Bug#12814).
1423 * xterm.h (struct selection_input_event): Adjust comment.
1424
1425 2012-11-07 Eli Zaretskii <eliz@gnu.org>
1426
1427 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1428 such as Scroll Lock, if the respective keys are treated as
1429 function keys, not as modifiers. This avoids destroying non-ASCII
1430 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
1431
1432 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1433
1434 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1435
1436 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1437
1438 Restore some duplicate definitions (Bug#12814).
1439 This undoes part of the 2012-11-03 changes. Some people build
1440 with plain -g rather than with -g3, and they need the duplicate
1441 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1442 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1443 Define as macros, as well as as enums or as constants.
1444
1445 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1446
1447 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1448 to keypad keys (Bug#12816).
1449
1450 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1451
1452 Minor adjustments of recently-changed frame functions.
1453 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1454 known to be a frame (we're in the FRAMEP branch).
1455 * lisp.h (Qframep): Remove decl. frame.h declares this.
1456 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1457 since they're meant for Lisp fixnum values.
1458
1459 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1460
1461 * window.c (Fwindow_combination_limit): Revert to the only
1462 required argument and adjust docstring as suggested in
1463 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1464 by Martin Rudalics <rudalics@gmx.at>.
1465
1466 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1467
1468 Widely used frame validity and checking functions.
1469 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1470 * frame.c (decode_live_frame, decode_any_frame): New functions.
1471 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1472 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1473 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1474 (Fframe_pointer_visible_p): Use decode_any_frame.
1475 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1476 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1477 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1478 (Fframe_focus): Likewise. Allow zero number of arguments.
1479 Adjust docstring.
1480 (frame_buffer_list, frame_buffer_predicate): Remove.
1481 * lisp.h (frame_buffer_predicate): Remove prototype.
1482 * buffer.c (Fother_buffer): Use decode_any_frame.
1483 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1484 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1485 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1486 (Fclose_font, Ffont_info): Use decode_live_frame.
1487 * fontset.c (check_fontset_name): Likewise.
1488 * terminal.c (Fframe_terminal): Likewise.
1489 * w32fns.c (check_x_frame): Likewise.
1490 * window.c (Fminibuffer_window, Fwindow_at)
1491 (Fcurrent_window_configuration): Likewise.
1492 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1493 Likewise. Allow zero number of arguments. Adjust docstring.
1494 * dispnew.c (Fredraw_frame): Likewise.
1495 * xfaces.c (frame_or_selected_frame): Remove.
1496 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1497 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1498 (Fframe_face_alist): Use decode_live_frame.
1499 * xfns.c (check_x_frame): Likewise.
1500
1501 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1502
1503 * window.c (quad): New function.
1504 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1505 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1506 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1507 (Fwindow_line_height): Use it.
1508 (Fwindow_fringes): Use list3.
1509 (Fwindow_scroll_bars): Use list4.
1510 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1511 (Fwindow_combination_limit): Allow zero number of arguments.
1512
1513 2012-11-05 Eli Zaretskii <eliz@gnu.org>
1514
1515 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1516
1517 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
1518 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
1519 file descriptor 2 for standard error. (Bug#12805)
1520
1521 2012-11-05 Chong Yidong <cyd@gnu.org>
1522
1523 * process.c (wait_reading_process_output): Revert previous change.
1524
1525 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1526
1527 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1528 This removes code that has been obsolete since around 1990.
1529 * callproc.c (Fcall_process):
1530 * emacs.c (main):
1531 * process.c (create_process):
1532 * term.c (dissociate_if_controlling_tty):
1533 Assume setsid exists.
1534 * callproc.c (child_setup): Assume setpgid exists and behaves as
1535 per POSIX.1-1988 or later.
1536 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1537 * emacs.c (shut_down_emacs):
1538 * sysdep.c (sys_suspend, init_foreground_group):
1539 Assume getpgrp behaves as per POSIX.1-1998 or later.
1540 * msdos.c (setpgrp): Remove.
1541 (tcgetpgrp, setpgid, setsid): New functions.
1542 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1543 * term.c (no_controlling_tty): Remove; unused.
1544 * w32proc.c (setpgrp): Remove.
1545 (setsid, tcgetpgrp): New functions.
1546
1547 Simplify by assuming __fpending.
1548 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1549 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1550 Do not assume that __fpending's result fits in int.
1551
1552 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1553
1554 Remove EMACS_OUTQSIZE+sleep hack.
1555 * dispnew.c (update_frame_1): Remove hack for terminals slower
1556 than 2400 bps, which throttled Emacs by having it sleep.
1557 This code hasn't worked since at least 2007, when the multi-tty stuff
1558 was added, and anyway those old terminals are long dead.
1559 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1560 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1561
1562 Fix data-loss with --version (Bug#9574).
1563 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1564 as we can't assume that emacs_strerror is initialized, and strerror
1565 is good enough here.
1566 (main): Invoke atexit earlier, to catch earlier instances of
1567 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1568
1569 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1570
1571 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1572 (keyDown): Remap keypad keys to X11 virtual key codes.
1573
1574 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1575
1576 Fix data-loss with --batch (Bug#9574).
1577 * emacs.c: Include <close-stream.h>.
1578 (close_output_streams): New function.
1579 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1580 and handles errors appropriately.
1581 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1582 does that now.
1583
1584 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1585 The symptom is a diagnostic "GLib-WARNING **: In call to
1586 g_spawn_sync(), exit status of a child process was requested but
1587 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1588 waitpid(), so exit status can't be returned." The diagnostic
1589 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1590 The real bug is a race condition between Emacs and glib: Emacs
1591 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1592 so that glib can't find it. Work around the bug by invoking
1593 waitpid only on subprocesses that Emacs itself creates.
1594 * process.c (create_process, record_child_status_change):
1595 Don't use special value -1 in pid field, as the caller now must
1596 know the pid rather than having the callee infer it.
1597 The inference was sometimes incorrect anyway, due to another race.
1598 (create_process): Set new 'alive' member if child is created.
1599 (process_status_retrieved): New function.
1600 (record_child_status_change): Use it.
1601 Accept negative 1st argument, which means to wait for the
1602 processes that Emacs already knows about. Move special-case code
1603 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1604 processes that have already been waited for, by testing and
1605 clearing new 'alive' member.
1606 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1607 now does this internally.
1608 (handle_child_signal): Let record_child_status_change do all
1609 the work, since we do not want to reap all exited child processes,
1610 only the child processes that Emacs itself created.
1611 * process.h (Lisp_Process): New boolean member 'alive'.
1612
1613 Omit duplicate definitions no longer needed with gcc -g3.
1614 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1615 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1616 Define only as macros. There's no longer any need to also define
1617 these symbols as enums or as constants, since we now assume
1618 gcc -g3 when debugging.
1619
1620 2012-11-03 Eli Zaretskii <eliz@gnu.org>
1621
1622 * lisp.mk: Adjust comments to the fact that term/internal is now
1623 loaded from loadup.el.
1624
1625 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1626 (msdos_fatal_signal): New function.
1627 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1628 its argument list.
1629
1630 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1631 for GCC versions before 4.
1632 (emacs_raise): Define to call msdos_fatal_signal.
1633
1634 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1635 iterator when starting in the middle of a display or overlay
1636 string. (Bug#12745)
1637
1638 2012-11-03 Chong Yidong <cyd@gnu.org>
1639
1640 * process.c (wait_reading_process_output): Clean up the last
1641 change.
1642
1643 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1644
1645 * process.c (wait_reading_process_output): Avoid a race condition
1646 with SIGIO delivery (Bug#11536).
1647
1648 2012-11-03 Chong Yidong <cyd@gnu.org>
1649
1650 * buffer.c (cursor_type): Untabify docstring.
1651
1652 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1653
1654 * frame.h (struct frame): Drop can_have_scroll_bars member
1655 which is meaningless for a long time. Adjust comments.
1656 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1657 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1658
1659 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1660
1661 * window.c (decode_next_window_args): Update window arg after
1662 calling decode_live_window and so fix crash reported at
1663 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1664 by Juanma Barranquero <lekktu@gmail.com>.
1665 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1666 * font.c (Ffont_at): Likewise.
1667
1668 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1669
1670 * widget.c (resize_cb): New function.
1671 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1672 (EmacsFrameResize): Check if all is up to date before changing frame
1673 size.
1674
1675 2012-11-02 Eli Zaretskii <eliz@gnu.org>
1676
1677 Implement backtrace output for fatal errors on MS-Windows.
1678 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1679 (BACKTRACE_LIMIT_MAX): New macro.
1680 (w32_backtrace): New function.
1681 (emacs_abort): Use w32_backtrace when the user chooses not to
1682 attach a debugger. Update the text of the abort dialog.
1683
1684 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1685
1686 Window-related stuff cleanup here and there.
1687 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1688 Use decode_any_window.
1689 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1690 * xdisp.c (Fformat_mode_line): Likewise.
1691 * font.c (Ffont_at): Use decode_live_window.
1692 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1693 * window.c (decode_next_window_args): Likewise.
1694 (decode_any_window): Remove static.
1695 * window.h (decode_any_window): Add prototype.
1696 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1697 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1698 respectively.
1699
1700 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1701
1702 Remove pad from struct input_event.
1703 * termhooks.h (struct input_event): Remove padding field.
1704 Adjust comment.
1705 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1706 member is never cons for a long time. Adjust comment.
1707 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1708 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1709 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1710 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1711
1712 2012-11-01 Eli Zaretskii <eliz@gnu.org>
1713
1714 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1715
1716 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1717
1718 Fix crash when using Emacs as commit editor for git (Bug#12697).
1719 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1720 and it is configured in conf_post.h.
1721 (Fcall_process): Don't invoke both setsid and setpgid; the former
1722 is enough, if it exists.
1723 * callproc.c (Fcall_process, child_setup):
1724 * process.c (create_process): Use setpgid.
1725 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1726 for the real thing.
1727 * dispnew.c (init_display): Initialize the foreground group
1728 if we are running a tty display.
1729 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1730 * lisp.h (init_foreground_group): New decl.
1731 * sysdep.c (inherited_pgroup): New static var.
1732 (init_foreground_group, tcsetpgrp_without_stopping)
1733 (narrow_foreground_group, widen_foreground_group): New functions.
1734 (init_sys_modes): Narrow foreground group.
1735 (reset_sys_modes): Widen foreground group.
1736
1737 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
1738
1739 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1740
1741 2012-10-31 Martin Rudalics <rudalics@gmx.at>
1742
1743 * minibuf.c (read_minibuf): Restore current buffer since
1744 choose_minibuf_frame calling Fset_frame_selected_window may
1745 change it (Bug#12766).
1746
1747 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1748
1749 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1750
1751 2012-10-30 Kenichi Handa <handa@gnu.org>
1752
1753 * font.c (Ffont_at): If WINDOW is specified and it is not
1754 displaying the current buffer, signal an error.
1755
1756 2012-10-29 Daniel Colascione <dancol@dancol.org>
1757
1758 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1759 In preparation for fixing bug#12739, move these functions from
1760 here...
1761
1762 * coding.h, coding.c: ... to here, and compile them only when
1763 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1764 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1765
1766 2012-10-28 Eli Zaretskii <eliz@gnu.org>
1767
1768 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1769 (timer_loop, getitimer, setitimer): Use it instead of
1770 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1771 'clock'.
1772 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1773 literal 10000.
1774
1775 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1776
1777 * nsterm.m (NO_APPDEFINED_DATA): New define.
1778 (last_appdefined_event_data): New variable
1779 (last_appdefined_event): Remove.
1780 (ns_select): Initialize t from last_appdefined_event_data instead
1781 of [last_appdefined_event data1].
1782 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1783 remove last_appdefined_event (Bug#12698).
1784
1785 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1786
1787 * frame.c (x_set_font): Catch internal error.
1788
1789 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1790
1791 Avoid overflow in w32 implementation of interval timers.
1792 When possible, for ITIMER_PROF count only times the main thread
1793 actually executes.
1794 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1795 'volatile ULONGLONG' types. All the other data which was
1796 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1797 (GetThreadTimes_Proc): New typedef.
1798 (w32_get_timer_time): New function, returns a suitable time value
1799 for the timer.
1800 (timer_loop): Enter critical section when accessing ULONGLONG
1801 values of the itimer_data struct, as these accesses are no longer
1802 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1803 Remove unused variable.
1804 (init_timers): Initialize s_pfn_Get_Thread_Times.
1805 (start_timer_thread): Don't assign itimer->caller_thread here.
1806 (getitimer): Assign itimer->caller_thread here.
1807 (setitimer): Always call getitimer to get the value of ticks_now.
1808 (sys_spawnve): Avoid compiler warning about format mismatch.
1809
1810 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1811
1812 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1813 mouse movement events if the menu bar is active. This avoids
1814 producing a busy "hour-glass" cursor by Windows if the mouse
1815 pointer is positioned over a tooltip shown for some menu item.
1816
1817 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1818
1819 Don't assume process IDs fit in int.
1820 * emacs.c (shut_down_emacs) [!DOS_NT]:
1821 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1822 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1823 Use pid_t, not int, to store process IDs, as 'int'
1824 is not wide enough on a few platforms (e.g., AIX and IRIX).
1825
1826 2012-10-23 Kenichi Handa <handa@gnu.org>
1827
1828 The following change is to make face-font-rescale-alist work
1829 correctly for non-ASCII fonts.
1830
1831 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1832 (font_open_for_lface): Handle Vface_font_rescale_alist.
1833
1834 2012-10-23 Chong Yidong <cyd@gnu.org>
1835
1836 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1837
1838 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1839
1840 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1841 for screen font.
1842 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1843
1844 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1845 event (Bug#12681).
1846
1847 2012-10-21 Glenn Morris <rgm@gnu.org>
1848
1849 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1850
1851 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1852
1853 Port to OpenBSD 5.1.
1854 * frame.c (Fmouse_position, Fmouse_pixel_position):
1855 * xdisp.c (produce_stretch_glyph):
1856 Declare local vars only when they're needed.
1857 This is clearer and avoids a warning on OpenBSD about unused vars.
1858 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1859 This is safer, and avoids OpenBSD warnings about unused vars.
1860 * keyboard.c (record_menu_key): Remove unnecessary decl.
1861 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1862 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1863 as our definition clashes with OpenBSD's.
1864 * xfaces.c (load_face_colors, check_lface_attrs)
1865 (get_lface_attributes_no_remap, get_lface_attributes)
1866 (lface_fully_specified_p, x_supports_face_attributes_p)
1867 (tty_supports_face_attributes_p, face_fontset, realize_face)
1868 (realize_x_face, realize_tty_face):
1869 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1870 merely Lisp_Object *. This is more informative and avoids
1871 a warning on OpenBSD about accessing beyond an object's size.
1872
1873 2012-10-20 Chong Yidong <cyd@gnu.org>
1874
1875 * lread.c (Fload): Doc fix (Bug#12592).
1876
1877 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1878
1879 * font.c (Ffont_at): Fix previous change.
1880
1881 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1882
1883 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1884 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1885 for the reasons.
1886
1887 * alloc.c (NSTATICS): Decrease to 0x800.
1888
1889 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1890
1891 * fns.c (Fnreverse): Include the problem element when signaling an
1892 error (bug#12677).
1893
1894 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1895
1896 * nsterm.m (ns_select): Check writefds before call to
1897 FD_ISSET (Bug#12668).
1898
1899 2012-10-18 Daniel Colascione <dancol@dancol.org>
1900
1901 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1902 (staticpro): If we run out of staticpro slots, die with an
1903 informative error instead of just calling emacs_abort.
1904
1905 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1906
1907 Fix two flaws reported by Dmitry Antipov.
1908 * window.c (Ftemp_output_buffer_show): Remove.
1909 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1910 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1911
1912 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1913
1914 * makefile.w32-in ($(BLD)/w32.$(O)):
1915 ($(BLD)/vm-limit.$(O)):
1916 ($(BLD)/term.$(O)):
1917 ($(BLD)/unexw32.$(O)):
1918 ($(BLD)/fileio.$(O)):
1919 ($(BLD)/dispnew.$(O)): Update dependencies.
1920
1921 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1922 Add prototypes.
1923
1924 * w32proc.c: Include ctype.h.
1925
1926 * w32.h (init_environment, check_windows_init_file)
1927 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1928 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1929 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1930 (sys_link): Add prototypes.
1931
1932 * w32.c: Include w32select.h.
1933 (sys_access, e_malloc, sys_select): Add prototypes.
1934 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1935
1936 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1937
1938 * unexw32.c: Include lisp.h and w32.h.
1939
1940 * term.c [WINDOWSNT]: Include w32term.h.
1941
1942 * process.c [WINDOWSNT]: Add prototype of sys_select.
1943
1944 * fileio.c [WINDOWSNT]: Include w32.h.
1945
1946 * dispnew.c [WINDOWSNT]: Include w32.h.
1947
1948 * cygw32.c (Fcygwin_convert_path_to_windows)
1949 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1950 Lisp_Object values. (Bug#12661)
1951
1952 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1953 to Lisp_Object. (Bug#12661)
1954
1955 2012-10-17 Kenichi Handa <handa@gnu.org>
1956
1957 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1958 invalidate.
1959
1960 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1961
1962 * buffer.c (Fkill_buffer): When unchaining the marker,
1963 reset its buffer pointer to NULL (Bug#12652).
1964
1965 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1966
1967 Do not verify indirection counters of killed buffers (Bug#12579).
1968 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1969 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1970
1971 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1972
1973 * alloc.c (Fmake_byte_code): Fix typo in comment.
1974 * print.c (print_interval): Define as static to match prototype.
1975 * indent.c (disptab_matches_widthtab, recompute_width_table):
1976 Convert to eassert.
1977
1978 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1979
1980 * editfns.c (get_system_name): Remove.
1981 * lisp.h (get_system_name): Remove prototype.
1982 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1983 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1984
1985 2012-10-15 Daniel Colascione <dancol@dancol.org>
1986
1987 * dbusbind.c: Add comment explaining reason for previous change.
1988
1989 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1990
1991 * window.c (Fwindow_end): Rewrite check whether cached position
1992 can be used (Bug#12600).
1993 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1994 Set windows_or_buffers_changed.
1995
1996 2012-10-15 Daniel Colascione <dancol@dancol.org>
1997
1998 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1999 enabled by undefining the symbol "interface", which the platform
2000 headers define to something incompatible.
2001
2002 2012-10-14 Daniel Colascione <dancol@dancol.org>
2003
2004 * image.c (init_tiff_functions, init_imagemagick_functions)
2005 (init_svg_functions): Fix cygw32 build break by using these
2006 functions only when WINDOWSNT _and_ HAVE_NTGUI.
2007
2008 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
2009
2010 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
2011
2012 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
2013
2014 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
2015
2016 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
2017
2018 * coding.c (detect_coding): Set coding->id before calling
2019 this->detector.
2020
2021 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
2022
2023 * fileio.c: Formatting fixes.
2024
2025 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
2026
2027 Fix some stat-related races.
2028 * fileio.c (Fwrite_region): Avoid race condition if a file is
2029 removed or renamed by some other process immediately after Emacs
2030 writes it but before Emacs stats it. Do not assume that stat (or
2031 fstat) succeeds.
2032 * image.c (slurp_file): Resolve the file name with fopen + fstat
2033 rather than stat + fopen.
2034 (pbm_read_file) [0]: Remove unused code with stat race.
2035 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
2036 Remove ineffective code with stat race.
2037
2038 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2039
2040 * doc.c (get_doc_string): Don't signal an error if the file is missing.
2041
2042 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2043
2044 * nsterm.m (hold_event_q): New static variable.
2045 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
2046 ! q_event_ptr.
2047 (hold_event): New function.
2048 (ns_read_socket): If hold_event_q have events, store them and
2049 return (Bug#12384).
2050 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
2051 is zero (Bug#12384).
2052
2053 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
2054
2055 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
2056
2057 2012-10-12 Eli Zaretskii <eliz@gnu.org>
2058
2059 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
2060
2061 * fileio.c (check_existing): New function.
2062 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
2063 instead of calling 'stat', when what's needed is to check whether
2064 a file exists. This avoids expensive system calls on MS-Windows.
2065 (Bug#12587)
2066
2067 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
2068
2069 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
2070 determine whether a file exists and is not a directory.
2071
2072 * lisp.h (check_existing): Add prototype.
2073
2074 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2075
2076 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
2077
2078 2012-10-12 Glenn Morris <rgm@gnu.org>
2079
2080 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
2081
2082 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2083
2084 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
2085
2086 * eval.c (Fautoload): Remember previous autoload status in load-history.
2087
2088 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2089
2090 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
2091 * lread.c (load_each_byte, new_backquote_flag, readchar)
2092 (read_filtered_event, lisp_file_lexically_bound_p)
2093 (safe_to_load_version, Fload, complete_filename_p, openp)
2094 (build_load_history, readevalloop, read_escape, read1)
2095 (string_to_number, read_vector, read_list):
2096 * macros.c (Fstart_kbd_macro):
2097 * marker.c (CONSIDER):
2098 * menu.c (parse_single_submenu, digest_single_submenu)
2099 (find_and_return_menu_selection, Fx_popup_menu):
2100 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
2101 (Ftry_completion):
2102 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
2103 (ns_menu_show):
2104 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
2105 (xmenu_show, xdialog_show):
2106 Use bool for booleans.
2107 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
2108 as it's not a predicate. All uses changed. Omit unnecessary
2109 buffer termination.
2110
2111 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2112
2113 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
2114 (save_excursion_restore): Do not restore mark if it was not saved.
2115
2116 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2117
2118 * marker.c (cached_modiff): EMACS_INT, not int.
2119
2120 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
2121 instead of having a wrong decl.
2122 * nsmenu.m (waiting_for_input): Remove wrong decl.
2123
2124 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2125
2126 keyboard.c, keymap.c: Use bool for booleans.
2127 * dispnew.c (sit_for): Distinguish between 3-way display_option
2128 and boolean do_display.
2129 * keyboard.c (single_kboard, this_command_key_count_reset)
2130 (waiting_for_input, echoing, immediate_quit, input_pending)
2131 (interrupt_input, interrupts_deferred, pop_kboard)
2132 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
2133 (command_loop_1, adjust_point_for_property)
2134 (safe_run_hooks_error, input_polling_used, read_char):
2135 (help_char_p, readable_events, kbd_buffer_events_waiting)
2136 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
2137 (lucid_event_type_list_p, get_input_pending):
2138 (gobble_input, menu_separator_name_p, menu_bar_item)
2139 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
2140 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
2141 (keyremap_step, test_undefined, read_key_sequence)
2142 (detect_input_pending, detect_input_pending_ignore_squeezables)
2143 (detect_input_pending_run_timers, requeued_events_pending_p)
2144 (quit_throw_to_read_char, Fset_input_interrupt_mode):
2145 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
2146 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
2147 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
2148 (accessible_keymaps_1, Fkey_description, push_key_description):
2149 (shadow_lookup, struct where_is_internal_data)
2150 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
2151 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
2152 (describe_map, describe_vector):
2153 * menu.c (single_menu_item):
2154 * nsmenu.m (ns_update_menubar):
2155 * process.c (wait_reading_process_output):
2156 * search.c (scan_buffer, scan_newline):
2157 Use bool for boolean.
2158 * keyboard.c (timers_run, swallow_events)
2159 (detect_input_pending_run_timers):
2160 * process.c (wait_reading_process_output):
2161 Use unsigned for counter where wraparound-on-overflow is desired,
2162 since unsigned is guaranteed to have that behavior and signed is not.
2163 (read_char): Use ptrdiff_t for string length.
2164 (get_input_pending): Remove first argument, since it was always
2165 the same pointer-to-int (now pointer-to-boolean) &input_pending,
2166 and behave as if it had that value. Return new value of
2167 input_pending. All callers changed.
2168 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
2169 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
2170 a string length.
2171 * keymap.c (push_key_description): Omit last arg, which was always 1.
2172 All callers changed.
2173
2174 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
2175
2176 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
2177
2178 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
2179 ($(BLD)/term.$(O)): Update dependencies.
2180
2181 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2182
2183 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
2184 * lisp.h (enum pvec_type): Adjust comments and omit explicit
2185 initializer for PVEC_NORMAL_VECTOR.
2186
2187 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2188
2189 Clean out old termopts cruft.
2190 * termopts.h (flow_control, meta_key): Remove unused decls.
2191 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
2192 Don't include termopts.h.
2193
2194 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2195
2196 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2197
2198 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2199
2200 * commands.h (immediate_quit): Remove duplicate decl.
2201
2202 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
2203
2204 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
2205 caching.
2206 (nsfont_open): Remove setting of Vfonts_in_cache.
2207 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
2208
2209 2012-10-09 Eli Zaretskii <eliz@gnu.org>
2210
2211 * w32fns.c (w32_last_error): Change the return value to DWORD, to
2212 match what GetLastError returns. Explain why the function is
2213 needed.
2214
2215 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
2216 'is_tooltip_frame', to avoid confusion with its global namesake.
2217
2218 2012-10-08 Daniel Colascione <dancol@dancol.org>
2219
2220 * xdisp.c (start_hourglass): Call w32_note_current_window when
2221 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
2222 build that caused Emacs to display the hourglass cursor forever.
2223
2224 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
2225 which is broken under remote desktop, calculate the number of
2226 colors available for a display based on the display's number of
2227 planes and number of bits per pixel per plane. (bug#10397).
2228
2229 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
2230
2231 * nsfont.m (Vfonts_in_cache): New variable.
2232 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
2233 are used. Add cached fonts to Vfonts_in_cache.
2234 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
2235
2236 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
2237
2238 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
2239 in nt/config.nt.
2240 (FONT_H): Define after FRAME_H.
2241 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
2242 Update dependencies.
2243
2244 * w32term.c: Remove leftover declaration of keyboard_codepage.
2245
2246 2012-10-08 Eli Zaretskii <eliz@gnu.org>
2247
2248 * makefile.w32-in (FONT_H): Add $(FRAME_H).
2249 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
2250 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
2251 (GLOBAL_SOURCES): Add cygw32.c.
2252 ($(BLD)/unexw32.$(O)):
2253 ($(BLD)/w32.$(O)):
2254 ($(BLD)/w32console.$(O)):
2255 ($(BLD)/w32fns.$(O)):
2256 ($(BLD)/w32heap.$(O)):
2257 ($(BLD)/w32menu.$(O)):
2258 ($(BLD)/w32proc.$(O)): Add w32common.h.
2259
2260 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
2261 'const char *'.
2262 (x_to_w32_color): Don't modify the argument, modify a copy instead.
2263
2264 2012-10-08 Daniel Colascione <dancol@dancol.org>
2265
2266 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
2267 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
2268 accidental message numbering hole. Change other messages to
2269 match.
2270
2271 * w32select.h (HAVE_W32SELECT): Remove.
2272
2273 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
2274 w32common.h instead of w32heap.h.
2275
2276 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
2277 (get_allocation_unit, get_processor_type, get_w32_major_version)
2278 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2279 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2280 (OS_NT, os_subtype, cache_system_info): Move declarations to
2281 w32common.
2282
2283 * w32heap.c: Include w32common.h.
2284 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
2285 (w32_minor_version, w32_build_number, w32_subtype):
2286 Remove duplicate definitions.
2287
2288 * w32fns.c: Include w32common.h; include w32heap.h only in
2289 WINDOWSNT.
2290
2291 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
2292 Use `report_file_error' instead of `error' in order to better
2293 inform users of what went wrong. Increase NTGUI_UNICODE file
2294 dialog box file name length to 32k, the maximum allowed by the NT
2295 kernel.
2296
2297 * w32common.h: New file.
2298 (ROUND_UP, ROUND_DOWN, get_page_size)
2299 (get_allocation_unit, get_processor_type, get_w32_major_version)
2300 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2301 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2302 (OS_NT, os_subtype, cache_system_info): Move here.
2303
2304 * unexw32.c, unexcw.c: Include w32common.h.
2305
2306 * emacs.c (main): Use (defined (WINDOWSNT) || defined
2307 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
2308 to call syms_of_w32select.
2309
2310 * cygw32.h: Remove obsolete EXFUN declarations.
2311
2312 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
2313
2314 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
2315 of w32inevt.o from SOME_MACHINE_OBJECTS.
2316
2317 2012-10-08 Daniel Colascione <dancol@dancol.org>
2318
2319 * image.c: Permanent fix for JPEG compilation issue --- limit
2320 jpeglib `boolean' redefinition to Cygwin builds.
2321
2322 2012-10-08 Eli Zaretskii <eliz@gnu.org>
2323
2324 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
2325
2326 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
2327 Cygwin.
2328
2329 2012-10-08 Daniel Colascione <dancol@dancol.org>
2330
2331 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
2332 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
2333 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
2334 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
2335 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
2336 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
2337 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
2338 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
2339 now a supported configuration.
2340
2341 * Makefile.in: consolidate image variables into LIBIMAGE; add
2342 W32_OBJ and W32_LIBS. Compile new files.
2343
2344 * conf_post.h:
2345 (_DebPrint) declare tracing facility for W32 debugging. We need
2346 to unify tracing later.
2347
2348 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
2349 unconditional use of W32 Unicode functions. Cygwin runs only on
2350 100% Unicode operating systems.
2351
2352 * cygw32.c: New file. Define Cygwin-specific facilities.
2353 (Fcygwin_convert_path_to_windows)
2354 (Fcygwin_convert_path_from_windows): New user functions for
2355 accessing Cygwin path-munging routines.
2356
2357 * cygw32.h: New file.
2358 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
2359 UTF-16LE strings temporarily inside non-Lisp-visible string
2360 objects.
2361
2362 (w32_strerror): Just what it says on the tin.
2363
2364 * emacs.c: Make the NS fork-then-exec code for daemon-launching
2365 also run for Cygwin; both systems have the same problem with using
2366 GUI facilities in a forked child. Also call syms_of_cygw32,
2367 syms_of_w32select in correct places.
2368
2369 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
2370 needs fork-then-exec for daemon launching.
2371
2372 * font.h: Include frame.h.
2373
2374 * image.c: Use the image library cache machinery only when we're
2375 compiling for native WINDOWSNT; Cygwin can use shared libraries
2376 like any other Unixlike system.
2377
2378 * keyboard.c: Clarify a comment regarding the input loop.
2379
2380 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
2381 functions directly instead of trying to detect at runtime that our
2382 host operating system supports them. We make this change for two
2383 reasons: Cygwin lacks support for the multibyte character
2384 conversion functions used by the legacy menu code, and Cygwin
2385 never needs to rely on non-Unicode APIs.
2386
2387 * unexw32.c (hinst): Declare extern.
2388
2389 * w32.c: Change header order;
2390 (w32_strerror): Move to w32fns.c because we need it for
2391 non-WINDOWSNT builds.
2392
2393 * w32.h: Add #error macro to make sure we don't include w32.h for
2394 Cygwin builds. Remove w32select declarations.
2395
2396 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
2397 w32fns.c. w32console.c is WINDOWSNT-only.
2398
2399 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2400 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2401 POSIXy alternative.
2402 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2403 (w32_major_version, w32_minor_version, w32_build_number)
2404 (os_subtype, sound_type): Define here
2405 (w32_defined_color): Make color parameter const for consistency
2406 with other _defined_color functions.
2407 (w32_createwindow): Unconditionally call w32_init_class instead of
2408 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2409 through the code is complex and unnecessary because class
2410 registration is practically free.
2411 (w32_name_of_message): New EMACSDEBUG-only function.
2412 (Fset_message_beep): Move here
2413 (Fx_open_connection): Require that the display name for Windows be
2414 "w32" for consistency, emacsclient disambiguation, and maybe, one
2415 day, multi-window-system support.
2416 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2417 Cygwin files for W32 GUI facilities, since these clearly don't
2418 expect Cygwin names.
2419 (_DebPrint): Define.
2420 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2421 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2422 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2423 (w32_last_error): Remove.
2424
2425 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
2426
2427 * w32heap.c (syspage_mask): Declare here.
2428 (cache_system_info): Remove.
2429
2430 * w32inevt.c (faked_key): Define globally, not statically.
2431 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2432 (w32_console_toggle_lock_key): Move to w32fns.c.
2433
2434 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2435
2436 * w32proc.c (_DebPrint): Move to w32fns.c.
2437 * w32select.c: Include string.h, stdio.h for Cygwin.
2438 * w32select.h: New File.
2439
2440 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2441 get_osfhandle.
2442 (w32_message_fd): New variable. Under Cygwin, holds the file
2443 descriptor the system used to tell us about pending thread
2444 messages.
2445
2446 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2447 that prevented compilation under non-WINDOWSNT systems.
2448
2449 (w32_initialize): Open /dev/windows and assign it to
2450 w32_message_fd. Provide w32 feature.
2451
2452 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2453 (WM_EMACS_INPUT_READY): add.
2454 (prepend_msg, w32_message_fd): Declare globally.
2455
2456 * w32xfns.c:
2457 (keyboard_handle): Use only when WINDOWSNT.
2458 (notify_msg_ready): New function. Posts a message to the main
2459 thread's message queue under CYGWIN, which wakes up the main
2460 thread from select(2) by making the /dev/windows file descriptor
2461 ready. Under WINDOWSNT, it sets an event the same way the old
2462 code did.
2463
2464 (post, prepend_msg): Actually call notify_msg_ready instead of
2465 setting the input event directly.
2466
2467 2012-10-07 Eli Zaretskii <eliz@gnu.org>
2468
2469 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2470 but it still has blocs in it, don't return it to the system,
2471 instead of aborting. (Bug#12402)
2472
2473 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2474
2475 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
2476
2477 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2478 MAC_OS_X_VERSION_10_6.
2479 (syms_of_nsterm): Remove comment about Panther and above for
2480 ns-antialias-text.
2481 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2482 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2483 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2484
2485 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2486 MAC_OS_X_VERSION_10_4.
2487
2488 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2489 MAC_OS_X_VERSION_10_2.
2490
2491 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2492
2493 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2494 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2495
2496 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2497 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
2498 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2499 Remove ns_in_resize check.
2500 (ns_clear_frame_area): Remove resize handle code.
2501
2502 * nsfns.m (ns_in_resize): Remove.
2503 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2504 Remove ns_in_resize check.
2505
2506 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2507
2508 Improve sys_siglist detection.
2509 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2510 defined as a macro, as is done in Solaris.
2511 (sys_siglist_entries): New macro.
2512 (save_strsignal): Use it.
2513 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2514 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2515
2516 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2517
2518 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2519 fullscreen/Fullscreen.
2520
2521 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2522 tobar_height is new.
2523
2524 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2525 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2526 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2527 (windowDidResize:): Check for correct window if old style fullscreen.
2528 Capitalize word in comment. Remove incorrect comment.
2529 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2530 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2531 error in drawing background.
2532 (toggleFullScreen:): Remove comment. Rearrange calls.
2533 Set toolbar values to zero, save old height in tobar_height.
2534 Restore tool bar height when leaving fullscreen.
2535 (canBecomeMainWindow): New function.
2536
2537 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2538
2539 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2540
2541 2012-10-05 Eli Zaretskii <eliz@gnu.org>
2542
2543 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2544
2545 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
2546 that time stamps of directories could also be changed.
2547 Don't request the too broad GENERIC_WRITE, only the more restrictive
2548 FILE_WRITE_ATTRIBUTES access rights.
2549
2550 * fileio.c (Fset_file_times): Special-case ignoring errors for
2551 directories only on MSDOS, not on MS-Windows.
2552
2553 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
2554
2555 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2556
2557 2012-10-04 Eli Zaretskii <eliz@gnu.org>
2558
2559 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2560 see whether CreateFile failed.
2561
2562 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2563
2564 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2565 to avoid similar races.
2566 * keyboard.c (pending_signals): Now bool, not int.
2567
2568 Port timers to OpenBSD, plus check for timer failures.
2569 OpenBSD problem reported by Han Boetes.
2570 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2571 and/or setitimer.
2572 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2573 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2574 like OpenBSD, which has timer_settime but does not declare it.
2575 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2576 whether to use itimerspec-related primitives. All uses of
2577 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2578
2579 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2580
2581 * profiler.c (handle_profiler_signal): Fix a malloc race
2582 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2583
2584 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2585
2586 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2587
2588 2012-10-02 Eli Zaretskii <eliz@gnu.org>
2589
2590 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2591 consistent with the change in return value of 'safe_strsignal'.
2592
2593 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2594
2595 Prefer plain 'static' to 'static inline' (Bug#12541).
2596 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2597 (bidi_set_sor_type, bidi_push_embedding_level)
2598 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2599 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2600 (bidi_cache_search, bidi_cache_ensure_space)
2601 (bidi_cache_iterator_state, bidi_cache_find)
2602 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2603 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2604 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2605 Now 'static', not 'static inline'.
2606
2607 Count overruns when profiling; change units to ns.
2608 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2609 Give extra weight to samples after overruns, to attempt to count
2610 the time more accurately.
2611 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2612 the underlying primitives nominally do ns.
2613 (Fprofiler_cpu_start): Document the change. Mention that
2614 the sampling intervals are only approximate.
2615
2616 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2617
2618 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2619
2620 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2621 case for the special 0 coding-system.
2622
2623 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2624 (Fmake_overlay): Remove redundant tests.
2625 (fix_start_end_in_overlays): Remove redundant recentering.
2626
2627 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
2628
2629 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2630 Update dependencies.
2631
2632 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2633
2634 Fix a malloc race condition involving strsignal.
2635 A signal can arrive in the middle of a malloc, and Emacs's signal
2636 handler can invoke strsignal, which can invoke malloc, which is
2637 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2638 Fix it by altering the signal handler so that it does not invoke
2639 strsignal.
2640 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2641 * process.c (status_message): Use const pointer, in case strsignal
2642 is #defined to safe_strsignal.
2643 * sysdep.c (sys_siglist, init_signals): Always define and
2644 initialize a substitute sys_siglist if the system does not define
2645 one, even if HAVE_STRSIGNAL.
2646 (safe_strsignal): Rename from strsignal. Always define,
2647 using sys_siglist. Return a const pointer.
2648 * syssignal.h (safe_strsignal): New decl.
2649 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2650
2651 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2652
2653 * w32proc.c (timer_loop): Fix code that waits for timer
2654 expiration, to avoid high CPU usage.
2655
2656 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2657
2658 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2659 (sweep_weak_table): Remove redundant prototypes.
2660
2661 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2662
2663 * emacs.c: Move the inclusion of TERM_HEADER after including
2664 windows.h on WINDOWSNT. This avoids compilation problems with
2665 MSVC.
2666
2667 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2668
2669 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2670 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2671 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2672 as the previous version used 'void *'.
2673
2674 * ralloc.c (ROUNDUP): Fix last change.
2675 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2676 'size_t'.
2677
2678 * w32proc.c <disable_itimers>: New static flag.
2679 (init_timers): Initialize it to zero, after creating the critical
2680 sections used by the timer threads.
2681 (term_timers): Set to 1 before deleting the critical sections.
2682 (getitimer, setitimer): If disable_itimers is non-zero, return an
2683 error indication without doing anything. Reported by Fabrice
2684 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2685 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2686 return results.
2687 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2688 support timers.
2689
2690 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2691 term_ntproc after all the other bookkeeping, to get timers working
2692 as long as possible.
2693
2694 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2695
2696 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2697 Suggested by Juri Linkov in
2698 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2699
2700 Prefer plain 'static' to 'static inline' (Bug#12541).
2701 With static functions, modern compilers inline pretty well by
2702 themselves; advice from programmers often hurts as much as it helps.
2703 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2704 this change shrinks the text size of the Emacs executable by 1.1%
2705 without affecting CPU significantly in my benchmark.
2706 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2707 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2708 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2709 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2710 (bset_auto_fill_function, bset_auto_save_file_format)
2711 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2712 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2713 (bset_cache_long_line_scans, bset_case_fold_search)
2714 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2715 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2716 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2717 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2718 (bset_header_line_format, bset_indicate_buffer_boundaries)
2719 (bset_indicate_empty_lines, bset_invisibility_spec)
2720 (bset_left_fringe_width, bset_major_mode, bset_mark)
2721 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2722 (bset_name, bset_overwrite_mode, bset_pt_marker)
2723 (bset_right_fringe_width, bset_save_length)
2724 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2725 (bset_scroll_up_aggressively, bset_selective_display)
2726 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2727 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2728 (set_buffer_overlays_after):
2729 * category.c (bset_category_table):
2730 * charset.c (read_hex):
2731 * coding.c (produce_composition, produce_charset)
2732 (handle_composition_annotation, handle_charset_annotation)
2733 (char_encodable_p):
2734 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2735 (assign_row, set_frame_matrix_frame, make_current)
2736 (add_row_entry):
2737 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2738 * fns.c (maybe_resize_hash_table):
2739 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2740 * gmalloc.c (register_heapinfo):
2741 * image.c (lookup_image_type):
2742 * intervals.c (set_interval_object, set_interval_left)
2743 (set_interval_right, copy_interval_parent, rotate_right)
2744 (rotate_left, balance_possible_root_interval):
2745 * keyboard.c (kset_echo_string, kset_kbd_queue)
2746 (kset_keyboard_translate_table, kset_last_prefix_arg)
2747 (kset_last_repeatable_command, kset_local_function_key_map)
2748 (kset_overriding_terminal_local_map, kset_real_last_command)
2749 (kset_system_key_syms, clear_event, set_prop):
2750 * lread.c (digit_to_number):
2751 * marker.c (attach_marker, live_buffer, set_marker_internal):
2752 * nsterm.m (ns_compute_glyph_string_overhangs):
2753 * process.c (pset_buffer, pset_command)
2754 (pset_decode_coding_system, pset_decoding_buf)
2755 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2756 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2757 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2758 * syntax.c (bset_syntax_table, dec_bytepos):
2759 * terminal.c (tset_param_alist):
2760 * textprop.c (interval_has_some_properties)
2761 (interval_has_some_properties_list):
2762 * window.c (wset_combination_limit, wset_dedicated)
2763 (wset_display_table, wset_hchild, wset_left_fringe_width)
2764 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2765 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2766 (wset_right_fringe_width, wset_right_margin_cols)
2767 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2768 (wset_vertical_scroll_bar_type, wset_window_parameters):
2769 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2770 (wset_column_number_displayed, wset_region_showing)
2771 (window_box_edges, run_window_scroll_functions)
2772 (append_glyph_string_lists, prepend_glyph_string_lists)
2773 (append_glyph_string, set_glyph_string_background_width)
2774 (append_glyph, append_composite_glyph)
2775 (take_vertical_position_into_account):
2776 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2777 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2778 (lface_hash, lface_same_font_attributes_p, lookup_face):
2779 * xml.c (libxml2_loaded_p):
2780 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2781 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2782 Now 'static', not 'static inline'.
2783
2784 * bidi.c: Tune.
2785 (bidi_copy_it): Do the whole copy with a single memcpy.
2786 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2787
2788 Revert the FOLLOW-SYMLINKS change for file-attributes.
2789 Doing it right would require several changes to Tramp, and there's
2790 not enough time to get that tested before the freeze today.
2791 * dired.c (directory_files_internal, Ffile_attributes):
2792 Undo last change.
2793
2794 * frame.c (x_report_frame_params): Port better to wider ints.
2795 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2796 or that pointers can be printed in 15 decimal digits.
2797 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2798
2799 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2800
2801 Support x64 build on MS-Windows.
2802 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2803 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2804 compatibility with x64.
2805 (x_get_focus_frame): Add prototype.
2806
2807 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2808 defining an XRectangle structure.
2809
2810 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2811 arithmetics for compatibility with x64.
2812
2813 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2814 compatibility with x64.
2815
2816 * w32heap.h: Adjust prototypes and declarations.
2817
2818 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2819 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2820 DWORD, long, and unsigned long, for compatibility with x64.
2821 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2822 (sbrk): Argument is now of type ptrdiff_t.
2823
2824 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2825 less than 0x0500.
2826 (w32_msg_pump): Use WPARAM type for 'result'.
2827
2828 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2829 architecture.
2830 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2831 compatibility with x64.
2832
2833 * vm-limit.c (lim_data): Now size_t.
2834 (check_memory_limits): Adjust prototypes of real_morecore and
2835 __morecore to receive argument of type ptrdiff_t. Use size_t for
2836 five_percent and data_size.
2837
2838 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2839 variables, for compatibility with x64.
2840 (rva_to_section, offset_to_section, relocate_offset)
2841 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2842 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2843 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2844 for compatibility with x64.
2845
2846 * sysdep.c (STDERR_FILENO): Define if not already defined.
2847
2848 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2849 (__morecore): Argument type is now ptrdiff_t.
2850 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2851 (relinquish): Use ptrdiff_t type for 'excess'.
2852 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2853
2854 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2855 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2856 instead of a literal number.
2857
2858 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2859 (min): Define only if not already defined.
2860
2861 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2862 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2863 hosts.
2864
2865 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2866 'bitmaps' is a pointer.
2867
2868 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2869
2870 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2871
2872 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2873
2874 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2875 * dired.c (directory_files_internal, Ffile_attributes):
2876 New arg follow_symlinks. All uses changed.
2877
2878 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2879
2880 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2881
2882 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2883
2884 Support atimers and CPU profiler via profile.c on MS-Windows.
2885 * w32proc.c (sig_mask, crit_sig): New static variables.
2886 (sys_signal): Support SIGALRM and SIGPROF.
2887 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2888 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2889 sigfillset, and sigprocmask are no longer no-ops.
2890 (sigismember): New function.
2891 (struct itimer_data): New definition.
2892 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2893 (crit_prof): New static variables.
2894 (MAX_SINGLE_SLEEP): New definition.
2895 (timer_loop, stop_timer_thread, term_timers, init_timers)
2896 (start_timer_thread, getitimer, setitimer): New functions.
2897 (alarm): No longer a no-op, calls setitimer.
2898
2899 * w32.c (term_ntproc): Call term_timers.
2900 (init_ntproc): Make sure all signals are unblocked at startup, to
2901 erase any traces of dumping. Call init_timers.
2902
2903 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2904 Windows-specific code to display the hourglass mouse pointer is no
2905 longer used.
2906 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2907 to hourglass timer expiration.
2908 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2909 Remove, no longer used.
2910 (w32_note_current_window, show_hourglass, hide_hourglass):
2911 New functions, in support of hourglass cursor display similar to other
2912 window systems.
2913 (syms_of_w32fns): Don't initialize hourglass_timer.
2914
2915 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2916 WINDOWSNT as well.
2917 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2918
2919 * w32.h (init_timers, term_timers): Add prototypes.
2920
2921 2012-09-30 Kenichi Handa <handa@gnu.org>
2922
2923 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2924 to the buffer relocation which may be caused by ccl_driver.
2925
2926 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2927
2928 * xfns.c (Fx_file_dialog): Update comment.
2929
2930 * w32fns.c (Fx_file_dialog): Update comment.
2931
2932 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2933 Initialize panel name field if OSX >= 10.6.
2934
2935 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2936
2937 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2938
2939 * nsterm.m (NEW_STYLE_FS): New define.
2940 (ns_fullscreen_hook, windowWillEnterFullScreen)
2941 (windowDidEnterFullScreen, windowWillExitFullScreen)
2942 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2943 (setFSValue): New functions.
2944 (EmacsFSWindow): New implementation.
2945 (canBecomeKeyWindow): New function for EmacsFSWindow.
2946 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2947 (dealloc): Release nonfs_window if in fullscreen.
2948 (updateFrameSize:): Call windowDidMove to update top/left.
2949 (windowWillResize:toSize:): Check if frame is still maximized.
2950 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2951 next_maximized, maximized_width, maximized_height and nonfs_window.
2952 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2953 tbar_height.
2954 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2955 fullscreen. Set maximized_width/height. Act on next_maximized.
2956
2957 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2958 (EmacsView): Add variables for fullscreen.
2959 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2960 (EmacsFSWindow): New interface for fullscreen.
2961
2962 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2963
2964 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2965
2966 2012-09-30 Chong Yidong <cyd@gnu.org>
2967
2968 * fns.c (Frandom): Doc fix.
2969
2970 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2971
2972 * window.c (Vwindow_combination_limit): New default value.
2973 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2974
2975 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2976
2977 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2978 Suggested by Eli Zaretskii in
2979 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2980
2981 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2982
2983 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2984 HAVE_TIMER_SETTIME is defined.
2985
2986 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2987
2988 Profiler improvements: more-accurate timers, overflow checks.
2989 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2990 signal.h, setjmp.h. Include systime.h instead.
2991 (saturated_add): New function.
2992 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2993 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2994 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2995 New static vars.
2996 (enum profiler_cpu_running): New enum.
2997 (profiler_cpu_running): Now of that enum type, not bool.
2998 All uses changed to store the new value.
2999 (handle_profiler_signal): Rename from sigprof_handler_1,
3000 for consistency with other handlers. Do not check whether
3001 cpu_log is a hash-table if garbage collecting, since it
3002 doesn't matter in that case.
3003 (deliver_profiler_signal): Rename from sigprof_handler,
3004 for consistency with other handlers.
3005 (setup_cpu_timer): New function, with much of what used to be in
3006 Fprofiler_cpu_start. Check for out-of-range argument.
3007 Prefer timer_settime if available, and prefer
3008 thread cputime clocks, then process cputime clocks, then
3009 monotonic clocks, to the old realtime clock. Use make_timeval
3010 to round more-correctly when falling back to setitimer.
3011 (Fprofiler_cpu_start): Use it.
3012 (Fprofiler_cpu_stop): Prefer timer_settime if available.
3013 Don't assume that passing NULL as the 2nd argument of setitimer
3014 is the same as passing a pointer to all-zero storage.
3015 Ignore SIGPROF afterwards.
3016 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
3017 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
3018 non-fatal signal handlers. Ignore SIGPROF on startup.
3019 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
3020 in profiler.c, since sysdep.c now uses it.
3021
3022 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
3023 Suggested by Eli Zaretskii in
3024 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3025
3026 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
3027
3028 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3029
3030 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
3031
3032 * lisp.h (struct backtrace): Remove indirection for `function' field.
3033 * xdisp.c (redisplay_internal):
3034 * profiler.c (record_backtrace, sigprof_handler_1):
3035 * alloc.c (Fgarbage_collect):
3036 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
3037 (Fbacktrace_frame): Adjust accordingly.
3038
3039 2012-09-28 Glenn Morris <rgm@gnu.org>
3040
3041 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
3042 (Frun_hook_with_args_until_failure): Doc fixes.
3043
3044 2012-09-28 Eli Zaretskii <eliz@gnu.org>
3045
3046 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
3047 Qautomatic_redisplay and change the symbol name. All users changed.
3048
3049 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
3050
3051 * profiler.c (sigprof_handler): Fix race condition.
3052
3053 2012-09-28 Glenn Morris <rgm@gnu.org>
3054
3055 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
3056
3057 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
3058
3059 Check more robustly for timer_settime.
3060 * Makefile.in (LIB_TIMER_TIME): New macro.
3061 (LIBES): Add it.
3062 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
3063 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
3064 call timer_settime.
3065
3066 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3067
3068 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
3069
3070 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
3071
3072 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3073
3074 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
3075
3076 * character.h (MAYBE_UNIFY_CHAR): Remove.
3077 * charset.c, charset.h (maybe_unify_char): Now static.
3078 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
3079 Since this stuff is now private to charset.c, there's no need for
3080 a public macro and no need to inline by hand.
3081
3082 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3083 Stefan Monnier <monnier@iro.umontreal.ca>
3084 Juanma Barranquero <lekktu@gmail.com>
3085
3086 * profiler.c: New file.
3087 * Makefile.in (base_obj): Add profiler.o.
3088 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
3089 ($(BLD)/profiler.$(O)): New target.
3090 * emacs.c (main): Call syms_of_profiler.
3091 * alloc.c (Qautomatic_gc): New constant.
3092 (MALLOC_PROBE): New macro.
3093 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
3094 (total_bytes_of_live_objects): New function.
3095 (Fgarbage_collect): Use it. Record itself in backtrace_list.
3096 Call malloc_probe for the memory profiler.
3097 (syms_of_alloc): Define Qautomatic_gc.
3098 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
3099 race condition.
3100 (struct backtrace): Move definition...
3101 * lisp.h (struct backtrace): ..here.
3102 (Qautomatic_gc, profiler_memory_running): Declare vars.
3103 (malloc_probe, syms_of_profiler): Declare functions.
3104 * xdisp.c (Qautomatic_redisplay): New constant.
3105 (redisplay_internal): Record itself in backtrace_list.
3106 (syms_of_xdisp): Define Qautomatic_redisplay.
3107
3108 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3109 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
3110
3111 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
3112
3113 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
3114
3115 Prefer POSIX timers if available.
3116 They avoid a race if the timer is too close to the current time.
3117 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
3118 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
3119 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
3120
3121 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3122
3123 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
3124 CHAR_STRING_ADVANCE.
3125 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
3126 STRING_CHAR_ADVANCE.
3127
3128 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
3129
3130 Move Vlibrary_cache to emacs.c and reset before dumping.
3131
3132 * lisp.h (reset_image_types): Declare.
3133 [WINDOWSNT] (Vlibrary_cache): Declare.
3134
3135 * image.c (reset_image_types): New function.
3136
3137 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
3138 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
3139 (Fdump_emacs): Reset Vlibrary_cache and image_types.
3140
3141 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
3142 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
3143
3144 * w32.h (Vlibrary_cache): Do not declare.
3145
3146 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3147
3148 * w32proc.c (sys_signal): Handle all signals defined by the
3149 MS-Windows runtime, not just SIGCHLD. Actually install the signal
3150 handlers for signals supported by Windows. Don't override
3151 term_ntproc as the handler for SIGABRT.
3152 (sigaction): Rewrite to call sys_signal instead of duplicating its
3153 code.
3154 (sys_kill): Improve commentary.
3155
3156 * w32.c (term_ntproc): Accept (and ignore) one argument, for
3157 consistency with a signature of a signal handler. All callers
3158 changed.
3159 (init_ntproc): Accept an argument DUMPING. If dumping, don't
3160 install term_ntproc as a signal handler for SIGABRT, as that
3161 should be done by the dumped Emacs.
3162
3163 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
3164
3165 * w32select.c (term_w32select): Protect against repeated
3166 invocation by setting clipboard_owner to NULL after calling
3167 DestroyWindow.
3168
3169 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
3170 and term_ntproc to their modified signatures.
3171
3172 * character.c (char_string, string_char): Remove calls to
3173 MAYBE_UNIFY_CHAR. See the discussion starting at
3174 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
3175 for the details.
3176
3177 2012-09-25 Chong Yidong <cyd@gnu.org>
3178
3179 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
3180
3181 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
3182
3183 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
3184 when encountering an unknown bytecode.
3185
3186 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
3187
3188 image.c, indent.c: Use bool for booleans.
3189 * dispextern.h (struct image_type): Members valid_p, load, init
3190 now return bool, not int. All uses changed.
3191 * image.c: Omit unnecessary static decls.
3192 (x_create_bitmap_mask, x_build_heuristic_mask):
3193 Return void, not int, since callers don't care about the return value.
3194 (x_create_bitmap_mask, define_image_type, valid_image_p)
3195 (struct image_keyword, parse_image_spec, image_spec_value)
3196 (check_image_size, image_background)
3197 (image_background_transparent, x_clear_image_1)
3198 (postprocess_image, lookup_image, x_check_image_size)
3199 (x_create_x_image_and_pixmap, xbm_image_p)
3200 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
3201 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
3202 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
3203 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
3204 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
3205 (png_image_p, init_png_functions, png_load_body, png_load)
3206 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
3207 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
3208 (init_gif_functions, gif_load, imagemagick_image_p)
3209 (imagemagick_load_image, imagemagick_load, svg_image_p)
3210 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
3211 (gs_load):
3212 * nsimage.m (ns_load_image):
3213 * nsterm.m (ns_defined_color):
3214 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
3215 * xfns.c (x_defined_color):
3216 * xterm.c (x_alloc_lighter_color_for_widget)
3217 (x_alloc_nearest_color_1, x_alloc_nearest_color)
3218 (x_alloc_lighter_color):
3219 * indent.c (disptab_matches_widthtab, current_column)
3220 (scan_for_column, string_display_width, indented_beyond_p)
3221 (compute_motion, vmotion, Fvertical_motion):
3222 Use bool for booleans.
3223
3224 2012-09-24 Chong Yidong <cyd@gnu.org>
3225
3226 * chartab.c (Fset_char_table_default): Obsolete function removed.
3227
3228 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3229
3230 Move pid_t related decls out of lisp.h.
3231 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
3232 (interruptible_wait_for_termination):
3233 Move these decls from lisp.h to syswait.h, since they use pid_t.
3234 Needed on FreeBSD; see Herbert J. Skuhra in
3235 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
3236 * callproc.c: Include syswait.h.
3237
3238 gnutls.c, gtkutil.c: Use bool for boolean.
3239 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
3240 (emacs_gnutls_handle_error):
3241 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
3242 (xg_hide_tooltip, xg_create_frame_widgets)
3243 (create_dialog, xg_uses_old_file_dialog)
3244 (xg_get_file_with_chooser, xg_get_file_with_selection)
3245 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
3246 (xg_item_label_same_p, xg_update_menubar)
3247 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
3248 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
3249 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
3250 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
3251 (update_frame_tool_bar, free_frame_tool_bar):
3252 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
3253 * nsmenu.m (ns_update_menubar):
3254 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
3255 * xfns.c (Fx_show_tip) [USE_GTK]:
3256 Use bool for boolean.
3257 * gtkutil.c (xg_update_frame_menubar):
3258 * xmenu.c (update_frame_menubar):
3259 Return void, not int, since caller ignores return value.
3260 * gtkutil.c (xg_change_toolbar_position):
3261 Return void, not 1.
3262
3263 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
3264
3265 * makefile.w32-in (BLOCKINPUT_H): Remove.
3266 (SYSSIGNAL_H): New macro.
3267 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
3268 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
3269 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
3270 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
3271 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
3272 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
3273 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
3274 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
3275 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
3276 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
3277 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
3278 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
3279 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
3280 ($(BLD)/w32xfns.$(O)): Update dependencies.
3281
3282 2012-09-23 Eli Zaretskii <eliz@gnu.org>
3283
3284 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
3285 fatal_error_backtrace.
3286
3287 * w32proc.c (sys_kill): Undo last change: don't do anything when
3288 invoked to deliver SIGABRT to our own process. This is now
3289 handled by emacs_raise.
3290
3291 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
3292
3293 * w32term.c (w32_read_socket): Remove leftover reference to
3294 interrupt_input_pending.
3295
3296 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3297
3298 Do not use SA_NODEFER.
3299 Problem reported by Dani Moncayo in
3300 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
3301 * alloc.c (die):
3302 * sysdep.c (emacs_abort): Do not reset signal handler.
3303 * emacs.c (terminate_due_to_signal): Reset signal handler here.
3304 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
3305 wanted even on POSIXish hosts, and it doesn't work on Windows.
3306
3307 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3308
3309 * xterm.c (x_term_init): Call fixup_locale before and after calling
3310 gtk_init (Bug#12392).
3311
3312 2012-09-23 Chong Yidong <cyd@gnu.org>
3313
3314 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
3315 Vdynamic_library_alist.
3316
3317 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
3318 (Fgnutls_available_p): Caller changed.
3319
3320 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
3321 (Flibxml_parse_xml_region): Likewise.
3322
3323 * dispextern.h (struct image_type): Remove arg from init function.
3324
3325 * image.c (Finit_image_library, lookup_image_type)
3326 (define_image_type): Remove now-unneeded second arg.
3327 (init_xpm_functions, init_png_functions, init_jpeg_functions)
3328 (init_tiff_functions, init_gif_functions, init_svg_functions):
3329 Arglist and w32_delayed_load calling convention changed.
3330 (gs_type): Remove init_gs_functions; there is no such function.
3331 (valid_image_p, make_image): Fix caller to lookup_image_type.
3332
3333 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3334
3335 Simplify and avoid signal-handling races (Bug#12471).
3336 * alloc.c (die):
3337 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
3338 Avoid recursive loop if there's a fatal error in the function itself.
3339 * atimer.c (pending_atimers):
3340 * blockinput.h: Don't include "atimer.h"; no longer needed.
3341 (interrupt_input_pending): Remove. All uses removed.
3342 pending_signals now counts both atimers and ordinary interrupts.
3343 This is less racy than having three separate pending-signal flags.
3344 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
3345 (input_blocked_p):
3346 Rename from their upper-case counterparts BLOCK_INPUT,
3347 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
3348 INPUT_BLOCKED_P, and turn into functions. All uses changed.
3349 This makes it easier to access volatile variables more accurately.
3350 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
3351 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
3352 that's more reliable if the code is buggy and sets
3353 interrupt_input_blocked to a negative value. All uses changed.
3354 * atimer.c (deliver_alarm_signal):
3355 Remove. No need to deliver this to the parent; any thread can
3356 handle this signal now. All uses replaced by underlying handler.
3357 * atimer.c (turn_on_atimers):
3358 * dispnew.c (handle_window_change_signal):
3359 * emacs.c (handle_danger_signal):
3360 * keyboard.c (kbd_buffer_get_event):
3361 Don't reestablish signal handler; not needed with sigaction.
3362 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
3363 (UNBLOCK_INPUT_TO):
3364 Rework to avoid unnecessary accesses to volatile variables.
3365 (UNBLOCK_INPUT_TO): Now a function.
3366 (totally_unblock_input, unblock_input): New decls.
3367 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
3368 (init_data): Remove. Necessary stuff now done in init_signal.
3369 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
3370 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
3371 (fatal_error_code): Remove; no longer needed.
3372 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
3373 it doesn't always backtrace. All uses changed. No need to reset
3374 signal to default, since sigaction and/or die does that for us now.
3375 Use emacs_raise (FOO), not kill (getpid (), FOO).
3376 (main): Check more-accurately whether we're dumping.
3377 Move fatal-error setup to sysdep.c
3378 * floatfns.c: Do not include "syssignal.h"; no longer needed.
3379 * gtkutil.c (xg_get_file_name, xg_get_font):
3380 Remove no-longer-needed signal-mask manipulation.
3381 * keyboard.c, process.c (POLL_FOR_INPUT):
3382 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
3383 * keyboard.c (read_avail_input): Remove.
3384 All uses replaced by gobble_input.
3385 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
3386 (kbd_buffer_store_event_hold, gobble_input):
3387 (record_asynch_buffer_change) [USABLE_SIGIO]:
3388 (store_user_signal_events):
3389 No need to mess with signal mask.
3390 (gobble_input): If blocking input and there are terminals, simply
3391 set pending_signals to 1 and return. All hooks changed to not
3392 worry about whether input is blocked.
3393 (process_pending_signals): Clear pending_signals before processing
3394 them, in case a signal comes in while we're processing.
3395 By convention callers now test pending_signals before calling us.
3396 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3397 New functions, to support changes to blockinput.h.
3398 (handle_input_available_signal): Now extern.
3399 (reinvoke_input_signal): Remove. All uses replaced by
3400 handle_async_input.
3401 (quit_count): Now volatile, since a signal handler uses it.
3402 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3403 All callers changed. Block SIGINT only if not already blocked.
3404 Clear sigmask reliably, even if Fsignal returns, which it can.
3405 Omit unnecessary accesses to volatile var.
3406 (quit_throw_to_read_char): No need to restore sigmask.
3407 * keyboard.c (gobble_input, handle_user_signal):
3408 * process.c (wait_reading_process_output):
3409 Call signal-handling code rather than killing ourselves.
3410 * lisp.h: Include <float.h>, for...
3411 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3412 (pending_signals): Now volatile.
3413 (syms_of_data): Now const if IEEE floating point.
3414 (handle_input_available_signal) [USABLE_SIGIO]:
3415 (terminate_due_to_signal, record_child_status_change): New decls.
3416 * process.c (create_process): Avoid disaster if memory is exhausted
3417 while we're processing a vfork, by tightening the critical section
3418 around the vfork.
3419 (send_process_frame, process_sent_to, handle_pipe_signal)
3420 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3421 ignores SIGPIPE.
3422 (send_process): No need for setjmp/longjmp any more, since the
3423 SIGPIPE stuff is now gone. Instead, report an error if errno
3424 is EPIPE.
3425 (record_child_status_change): Now extern. PID and W are now args.
3426 Return void, not bool. All callers changed.
3427 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3428 Remove. All uses removed. This bug should be fixed now in a
3429 different way.
3430 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3431 and record the child status change directly. This avoids the
3432 need to futz with the signal mask.
3433 (process_fatal_action): Move here from emacs.c.
3434 (emacs_sigaction_flags): New function, containing
3435 much of what used to be in emacs_sigaction_init.
3436 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3437 caught by emacs, to make races less likely.
3438 (deliver_process_signal): Rename from handle_on_main_thread.
3439 All uses changed.
3440 (BACKTRACE_LIMIT_MAX): Now at top level.
3441 (thread_backtrace_buffer, threadback_backtrace_pointers):
3442 New static vars.
3443 (deliver_thread_signal, deliver_fatal_thread_signal):
3444 New functions, for more-accurate delivery of thread-specific signals.
3445 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3446 (deliver_arith_signal): Handle in this thread, not
3447 in the main thread, since it's triggered by this thread.
3448 (maybe_fatal_sig): New function.
3449 (init_signals): New arg DUMPING so that we can be more accurate
3450 about whether we're dumping. Caller changed.
3451 Treat thread-specific signals differently from process-general signals.
3452 Block all signals while handling fatal error; that's safer.
3453 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3454 on IEEE hosts.
3455 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3456 Ignore SIGPIPE unless batch.
3457 (emacs_backtrace): Output backtrace for the appropriate thread,
3458 which is not necessarily the main thread.
3459 * syssignal.h: Include <stdbool.h>.
3460 (emacs_raise): New macro.
3461 * xterm.c (x_connection_signal): Remove; no longer needed
3462 now that we use sigaction.
3463 (x_connection_closed): No need to mess with sigmask now.
3464 (x_initialize): No need to reset SIGPIPE handler here, since
3465 init_signals does this for us now.
3466
3467 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3468
3469 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
3470 background rect may be larger (Bug#12245).
3471
3472 2012-09-23 Chong Yidong <cyd@gnu.org>
3473
3474 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3475
3476 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3477
3478 * .gdbinit: Just stop at fatal_error_backtrace.
3479 See Stefan Monnier's request in
3480 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3481 Remove no-longer-used query of system type.
3482
3483 2012-09-22 Chong Yidong <cyd@gnu.org>
3484
3485 * search.c (Freplace_match): Doc fix (Bug#12325).
3486
3487 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3488
3489 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3490 (Fline_end_position): Doc fix.
3491
3492 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3493
3494 2012-09-22 Chong Yidong <cyd@gnu.org>
3495
3496 * dispextern.h (struct image_type): Add new slot, storing a type
3497 initialization function.
3498
3499 * image.c (define_image_type): Call the image initializer function
3500 if it is defined. Arguments and return value changed.
3501 (valid_image_p, make_image): Callers changed.
3502 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3503 (gif_type, imagemagick_type, svg_type, gs_type):
3504 Add initialization functions.
3505 (Finit_image_library): Call lookup_image_type.
3506 (CHECK_LIB_AVAILABLE): Macro deleted.
3507 (lookup_image_type): Call define_image_type here, rather than via
3508 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3509 (syms_of_image): Move define_image_type calls for xbm_type and
3510 pbm_type to lookup_image_type.
3511
3512 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3513
3514 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3515 'idle_timers' from here ...
3516 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3517 lists, to avoid infloops when the timer does something stupid,
3518 like reinvoke itself with the same or smaller time-out.
3519 (Bug#12447)
3520
3521 2012-09-22 Martin Rudalics <rudalics@gmx.at>
3522
3523 * window.c (Fsplit_window_internal): Handle only Qt value of
3524 Vwindow_combination_limit separately.
3525 (Qtemp_buffer_resize): New symbol.
3526 (Vwindow_combination_limit): New default value.
3527 Rewrite doc-string.
3528
3529 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3530
3531 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3532 the new overlay string. (Bug#10159)
3533
3534 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3535
3536 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3537 or that fprintf is async-signal-safe. POSIX doesn't require
3538 either assumption.
3539
3540 2012-09-22 Chong Yidong <cyd@gnu.org>
3541
3542 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3543 (Bug#8207).
3544
3545 2012-09-22 Kenichi Handa <handa@gnu.org>
3546
3547 * composite.c (composition_reseat_it): Handle the case that a
3548 grapheme cluster is not covered by a single font (Bug#12352).
3549
3550 2012-09-21 Chong Yidong <cyd@gnu.org>
3551
3552 * image.c (define_image_type): Avoid adding duplicate types to
3553 image_types (Bug#12463). Suggested by Jörg Walter.
3554
3555 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3556
3557 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3558 (print_load_command_name): Add case LC_DATA_IN_CODE.
3559 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3560
3561 2012-09-21 Glenn Morris <rgm@gnu.org>
3562
3563 * eval.c (Frun_hook_with_args_until_success)
3564 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3565
3566 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
3567
3568 * fileio.c (Ffile_selinux_context): Only call freecon when
3569 lgetfilecon succeeded.
3570 (Fset_file_selinux_context): Likewise. (Bug#12444)
3571
3572 2012-09-21 Eli Zaretskii <eliz@gnu.org>
3573
3574 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3575 reordering, locate the cursor by calling set_cursor_from_row; if
3576 that fails, clear the desired glyph matrix before returning a
3577 failure indication to the caller. Fixes leaving garbled display
3578 when fast scrolling with a down-key. (Bug#12403)
3579 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3580 scrolling through multibyte text.
3581
3582 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3583
3584 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3585 calling mark_vectorlike since that's the one that marks the window.
3586 (mark_discard_killed_buffers): Mark the final cdr.
3587 * window.h (struct window): Move prev/next_buffers to the
3588 non-standard fields.
3589 * window.c (make_window): Initialize prev/next_buffers manually.
3590
3591 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3592
3593 Omit unused arg EXPECTED from socket hooks.
3594 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3595 * nsterm.m (ns_term_init):
3596 * termhooks.h (struct terminal.read_socket_hook):
3597 * w32inevt.c (w32_console_read_socket):
3598 * w32term.c (w32_read_socket):
3599 * xterm.c (XTread_socket):
3600 Omit unused arg EXPECTED. All callers changed.
3601 (store_user_signal_events): Return void, not int, since callers no
3602 longer care about the return value. All uses changed.
3603
3604 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
3605
3606 * w32gui.h (XParseGeometry): Do not declare.
3607
3608 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3609
3610 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
3611 Ignore 'expected'. See Eli Zaretskii in
3612 <http://bugs.gnu.org/12471#8> (last line).
3613
3614 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3615 (XParseGeometry): Now static. Substitute extremal values for
3616 values that are out of range.
3617
3618 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3619
3620 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3621
3622 * nsfns.m (XParseGeometry): Remove.
3623 (Fx_create_frame): Call x_set_offset to correctly interpret
3624 top_pos in geometry.
3625
3626 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
3627 (Fx_parse_geometry): If there is a space in string, call
3628 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3629
3630 2012-09-17 Eli Zaretskii <eliz@gnu.org>
3631
3632 * search.c (scan_buffer): Use character positions in calls to
3633 region_cache_forward and region_cache_backward, not byte
3634 positions. (Bug#12196)
3635
3636 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3637 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3638
3639 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3640 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3641 emacs_blocked_malloc, now deleted.
3642
3643 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3644
3645 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3646 The workaround was for improving performance on Solaris 2.4, but
3647 is getting in the way now. Emacs will still work if someone is
3648 still running Solaris 2.4 in a museum somewhere; Sun dropped
3649 support for Solaris 2.4 in 2003.
3650 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3651 * process.c (create_process) [HAVE_WORKING_VFORK]:
3652 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3653 since Emacs no longer uses vfork on that platform.
3654
3655 2012-09-17 Glenn Morris <rgm@gnu.org>
3656
3657 * emacs.c: Use COPYRIGHT.
3658
3659 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3660
3661 Remove configure's --without-sync-input option (Bug#12450).
3662 When auditing signal-handling in preparation for cleaning it up,
3663 I found that SYNC_INPUT has race conditions and would be a real
3664 pain to fix. Since it's an undocumented and deprecated
3665 configure-time option, now seems like a good time to remove it.
3666 Also see <http://bugs.gnu.org/11080#16>.
3667 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3668 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3669 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3670 (malloc_hysteresis):
3671 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3672 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3673 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3674 (dont_register_blocks, bytes_used_when_reconsidered)
3675 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3676 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3677 [!SYSTEM_MALLOC && !SYNC_INPUT]:
3678 Remove. All uses removed.
3679 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3680 implementation, one that depends on whether the new macro
3681 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3682 is defined.
3683 * atimer.c (run_timers, handle_alarm_signal):
3684 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3685 (handle_async_input, process_pending_signals)
3686 (handle_input_available_signal, init_keyboard):
3687 * nsterm.m (ns_read_socket):
3688 * process.c (wait_reading_process_output):
3689 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3690 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3691 (emacs_write):
3692 * xterm.c (XTread_socket):
3693 Assume SYNC_INPUT.
3694 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3695 * eval.c (handling_signal): Remove. All uses removed.
3696 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3697 All uses replaced with the SYNC_INPUT version.
3698 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3699 Remove decls.
3700 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3701 Now static.
3702
3703 * font.c (Ffont_shape_gstring): Remove unused local.
3704
3705 2012-09-16 Glenn Morris <rgm@gnu.org>
3706
3707 * Makefile.in (clean): No longer run nextstep's clean.
3708
3709 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3710 (ns_frag): Remove.
3711 (ns-app): Move here from ns.mk, and simplify.
3712 (clean): Simplify nextstep entry.
3713 * ns.mk: Remove file.
3714
3715 2012-09-17 Kenichi Handa <handa@gnu.org>
3716
3717 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3718 not covert the last few charactes.
3719
3720 2012-09-16 Kenichi Handa <handa@gnu.org>
3721
3722 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3723 here, but just check the validity of glyphs in the glyph-string.
3724
3725 2012-09-16 Martin Rudalics <rudalics@gmx.at>
3726
3727 * window.c (Fwindow_parameter, Fset_window_parameter):
3728 Accept any window as argument (Bug#12452).
3729
3730 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3731
3732 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3733 to ns_term_init to avoid memory leak.
3734
3735 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3736 explicit retain/release.
3737 (ns_term_init): Only allow one display. Initialize outerpool and
3738 ns_*_types.
3739
3740 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3741
3742 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3743 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3744 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3745 the Microsoft problem in a different way, by altering ../nt/config.nt.
3746
3747 2012-09-15 Eli Zaretskii <eliz@gnu.org>
3748
3749 * w32xfns.c:
3750 * w32uniscribe.c:
3751 * w32term.c:
3752 * w32select.c:
3753 * w32reg.c:
3754 * w32proc.c:
3755 * w32menu.c:
3756 * w32inevt.c:
3757 * w32heap.c:
3758 * w32font.c:
3759 * w32fns.c:
3760 * w32console.c:
3761 * w32.c:
3762 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3763 by lisp.h. This completes removal of setjmp.h inclusion
3764 erroneously announced in the previous commit. (Bug#12446)
3765
3766 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3767 more accurate.
3768
3769 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3770 not defined as a macro. The latter happens on MS-Windows.
3771 (Bug#12446)
3772
3773 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3774
3775 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3776 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3777 Some instances of '#include <setjmp.h>' removed, if the
3778 only reason for the instance was because "lisp.h" was included.
3779 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3780 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3781 and _longjmp with the new symbols. Emacs already uses _setjmp if
3782 available, so this change affects only POSIXish hosts that have
3783 sigsetjmp but not _setjmp, such as some versions of Solaris and
3784 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3785 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3786 (png_load_body) [HAVE_PNG]:
3787 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3788 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3789 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3790 since PNG requires jmp_buf. This is the only exception to the
3791 general rule that we now use sys_setjmp and sys_longjmp.
3792 This exception is OK since this code does not change the signal
3793 mask or longjmp out of a signal handler.
3794
3795 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3796
3797 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3798 Include "syssignal.h", for 'main_thread'.
3799
3800 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3801
3802 Avoid out-of-range marker position (Bug#12426).
3803 * insdel.c (replace_range, replace_range_2):
3804 Adjust markers before overlays, as suggested by comments.
3805 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3806 Remove redundant check before calling offset_intervals.
3807
3808 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3809
3810 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3811 current buffer (Bug#12387).
3812
3813 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3814
3815 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3816
3817 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3818
3819 Use a more backwards-compatible timer format (Bug#12430).
3820 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3821 vector element, not from the 4th, since PSECS is now at the end.
3822 (Fcurrent_idle_time): Doc fix.
3823
3824 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3825
3826 Function to mark objects and remove killed buffers at once.
3827 * alloc.c (discard_killed_buffers): Rename to ...
3828 (mark_discard_killed buffers) ... new name. Add marking
3829 of remaining objects. Fix comment. Adjust users.
3830 (mark_object): Do not touch frame buffer lists here.
3831 * frame.c (delete_frame): Reset frame buffer lists here.
3832
3833 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3834
3835 Better workaround for GNOME bug when --enable-gcc-warnings.
3836 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3837 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3838 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3839
3840 Simplify SIGIO usage (Bug#12408).
3841 The code that dealt with SIGIO was crufty and confusing, e.g., it
3842 played tricks like "#undef SIGIO" but these tricks were not used
3843 consistently. Simplify mostly by not #undeffing standard symbols,
3844 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3845 or not as we please) rather than "defined SIGIO" (standard symbol
3846 that we probably shouldn't #undef).
3847 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3848 Modules that need it can include it.
3849 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3850 * dispextern.h (ignore_sigio): New decl.
3851 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3852 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3853 * emacs.c (shut_down_emacs):
3854 * keyboard.c (kbd_buffer_store_event_hold):
3855 Use ignore_sigio rather than invoking 'signal' directly.
3856 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3857 for FIONREAD.
3858 (FIONREAD, SIGIO): Do not #undef.
3859 (tty_read_avail_input): Use #error rather than a syntax error.
3860 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3861 for I_PIPE, used by SETUP_SLAVE_PTY.
3862 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3863 * sysdep.c (croak): Remove; no longer needed. This bit of
3864 temporary code, with Fred N. Fish's comment that it's temporary,
3865 has been in Emacs since at least 1992!
3866 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3867 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3868 * syssignal.h (croak): Remove decl.
3869 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3870 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3871 now that we're termios-only.
3872 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3873 * term.c (dissociate_if_controlling_tty): Use #error rather than
3874 a run-time error.
3875
3876 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3877 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3878 to work around GNOME bug 683906.
3879 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3880 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3881 This works around GCC bug 54561.
3882
3883 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3884
3885 More fixes for 'volatile' and setjmp/longjmp.
3886 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3887 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3888 (png_load_body) [HAVE_PNG]:
3889 (jpeg_load_body) [HAVE_JPEG]:
3890 New function, with most of the old parent function's body.
3891 (png_load) [HAVE_PNG]:
3892 (jpeg_load) [HAVE_JPEG]:
3893 Invoke the new function, to avoid longjmp munging our locals.
3894 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3895 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3896 longjmp is passed 2, as the C standard doesn't guarantee this.
3897 Instead, store the failure code into mgr->failure_code.
3898
3899 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3900
3901 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3902 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3903 (syms_of_keyboard): Remove support for unread-command-char.
3904
3905 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3906
3907 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3908 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3909 violation. (Bug#12426)
3910
3911 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3912
3913 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3914
3915 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3916
3917 * eval.c: Add `inhibit-debugger'.
3918 (Qinhibit_debugger): New symbol.
3919 (call_debugger): Bind it instead of Qdebug_on_error.
3920 (maybe_call_debugger): Test Vinhibit_debugger.
3921 (syms_of_eval): Define inhibit-debugger.
3922 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3923 (syms_of_xdisp): Remove inhibit-debug-on-message.
3924
3925 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3926
3927 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3928 If a nonvolatile local variable is written before a _longjmp to
3929 the frame containing the variable, and is read after the _longjmp,
3930 the value read is indeterminate. Some local variables of type
3931 'struct handler' and 'struct catchtag' are used in this way, so
3932 mark each of their slots as volatile if the slot can be set before
3933 _longjmp and read afterwards.
3934 * lisp.h (struct handler): var and chosen_clause are now volatile.
3935 (struct catchtag): val, next, and pdlcount are now volatile.
3936
3937 * bidi.c (bidi_push_it, bidi_pop_it):
3938 * fns.c (copy_hash_table):
3939 * image.c (define_image_type):
3940 * keyboard.c (kbd_buffer_store_event_hold):
3941 * process.c (Fprocess_send_eof):
3942 * xfaces.c (x_create_gc) [HAVE_NS]:
3943 * xgselect.c (xg_select):
3944 Prefer assignment to memcpy when either will do.
3945
3946 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3947 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3948 time an item is removed. No need to mark this function 'inline';
3949 the compiler knows better than we do.
3950
3951 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3952
3953 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3954 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3955 to change_frame_size (Bug#12388).
3956 (windowDidResize:): Pass YES to updateFrameSize.
3957
3958 * nsterm.h: Add delay parameter to updateFrameSize.
3959
3960 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3961
3962 Discard killed buffers from deleted window and frame objects.
3963 This reduces an amount of references to killed buffers and
3964 helps GC to reclaim them faster.
3965 * alloc.c (discard_killed_buffers): New function.
3966 (mark_object): Use it for deleted windows and frames.
3967 (mark_object): If symbol's value is set up for a killed buffer
3968 or deleted frame, restore its global binding.
3969 * data.c (swap_in_global_binding): Add GC notice.
3970 (swap_in_symval_forwarding): Use convenient set_blv_where.
3971 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3972 * window.h: ... to here.
3973
3974 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3975
3976 Convenient macro to check whether the buffer is live.
3977 * buffer.h (BUFFER_LIVE_P): New macro.
3978 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3979 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3980
3981 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3982
3983 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3984 composition cases (Bug#12364).
3985
3986 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3987 overhang of succeeding glyphs overlapping box cursor.
3988
3989 * w32term.c (x_draw_glyph_string): Likewise.
3990
3991 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3992
3993 Simplify, document, and port floating-point (Bug#12381).
3994 The porting part of this patch fixes bugs on non-IEEE platforms
3995 with frexp, ldexp, logb.
3996 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3997 Now static.
3998 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3999 support, by removing commented-out code and briefly listing the
4000 C89 functions excluded. The commented-out stuff was confusing
4001 maintenance, e.g., we thought we needed cbrt but it was commented out.
4002 (logb): Remove decl; no longer needed.
4003 (isfinite): New macro, if not already supplied.
4004 (isnan): Don't replace any existing macro.
4005 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
4006 are present on all C89 platforms.
4007 (Ffrexp): Do not special-case zero, as frexp does the right thing
4008 for that case.
4009 (Flogb): Do not use logb, as it doesn't have the desired meaning
4010 on hosts that use non-base-2 floating point. Instead, stick with
4011 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
4012 frexp, to avoid getting an unspecified result.
4013
4014 * xdisp.c (Qinhibit_debug_on_message): Now static.
4015
4016 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
4017
4018 * nsterm.m (ns_update_begin): Set clip path to whole view by using
4019 NSBezierPath (Bug#12131).
4020
4021 2012-09-10 Chong Yidong <cyd@gnu.org>
4022
4023 * fns.c (Fdelq, Fdelete): Doc fix.
4024
4025 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
4026
4027 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
4028 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
4029
4030 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
4031
4032 * lisp.h (make_lisp_ptr): New macro to replace XSET.
4033 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
4034 Use it.
4035
4036 2012-09-09 Eli Zaretskii <eliz@gnu.org>
4037
4038 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
4039 left fringe if the window has a left margin. This avoids leaving
4040 traces of the cursor because its leftmost pixel is not drawn over.
4041
4042 * dispnew.c (update_window_line): When the left margin area of a
4043 screen line is updated, set the redraw_fringe_bitmaps_p flag of
4044 that screen line. (Bug#12277)
4045
4046 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
4047
4048 Assume C89 or later for math functions (Bug#12381).
4049 This simplifies the code, and makes it a bit smaller and faster,
4050 and (most important) makes it easier to clean up signal handling
4051 since we can stop worring about floating-point exceptions in
4052 library code. That was a problem before C89, but the problem
4053 went away many years ago on all practical Emacs targets.
4054 * data.c, image.c, lread.c, print.c:
4055 Don't include <math.h>; no longer needed.
4056 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
4057 might be autoconfigured, as that never happens.
4058 * data.c (fmod):
4059 * doprnt.c (DBL_MAX_10_EXP):
4060 * print.c (DBL_DIG):
4061 Remove. C89 or later always defines these.
4062 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
4063 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
4064 (arith_error, domain_error, domain_error2):
4065 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
4066 no longer needed -- we simply return what C returns. All uses removed.
4067 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
4068 the wrapped code.
4069 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
4070 Remove. All uses expanded, as these macros are no longer used
4071 more than once and are now more trouble than they're worth.
4072 (Ftan): Use tan, not sin / cos.
4073 (Flogb): Assume C89 frexp.
4074 (fmod_float): Assume C89 fmod.
4075 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
4076 (init_floatfns): Remove. All uses removed.
4077
4078 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4079
4080 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
4081 compositeToPoint for OSX < 10.6 (Bug#12390).
4082
4083 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
4084
4085 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
4086 This produces more-accurate results.
4087
4088 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4089
4090 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
4091 changes (Bug#12088).
4092
4093 2012-09-08 Chong Yidong <cyd@gnu.org>
4094
4095 * syntax.c (Fstring_to_syntax): Doc fix.
4096
4097 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4098
4099 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
4100 in the internal border.
4101 (x_set_window_size): Remove static variables and their usage.
4102 (ns_redraw_scroll_bars): Fix NSTRACE arg.
4103 (ns_after_update_window_line, ns_draw_fringe_bitmap):
4104 Remove fringe/internal border adjustment (Bug#11052).
4105 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
4106 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
4107 (ns_fix_rect_ibw): Remove.
4108 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
4109 (ns_dumpglyphs_box_or_relief): Ditto.
4110 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
4111 adjustment.
4112 (ns_dumpglyphs_image): Ditto.
4113 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
4114 border adjustment.
4115 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
4116 their usage. Add fringe_extended_p and its use as in other terms.
4117 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
4118 scroll bar was removed.
4119 (updateFrameSize): New function.
4120 (windowDidResize): Move code to updateFrameSize and call it.
4121
4122 * nsterm.h (EmacsView): Add updateFrameSize.
4123
4124 2012-09-07 Chong Yidong <cyd@gnu.org>
4125
4126 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
4127
4128 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
4129
4130 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4131
4132 More signal-handler cleanup (Bug#12327).
4133 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
4134 Problem introduced when merging patches. Noted by Eli Zaretskii in
4135 <http://bugs.gnu.org/12327#67>.
4136 * floatfns.c: Comment fix.
4137 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
4138 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
4139 and anyway the declaration is harmless even if SIGDANGER is not defined.
4140 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
4141 defined BROKEN_FIONREAD). systty.h formerly did this, but other
4142 source files not surprisingly expected syssignal.h to define, or
4143 not define, SIGIO, and it's cleaner to do it that way, for consistency.
4144 Include <sys/ioctl.h>, for FIONREAD.
4145 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
4146 This eliminates a problem whereby other files mysteriously had
4147 to include "syssignal.h" before including "systty.h" if they
4148 wanted to use "#ifdef SIGIO".
4149
4150 2012-09-07 Eli Zaretskii <eliz@gnu.org>
4151
4152 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
4153
4154 * w32.c (sigemptyset): Empty the set.
4155 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
4156
4157 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
4158
4159 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
4160
4161 * alloc.c (mark_buffer): Revert unsafe marking optimization.
4162 (mark_object): Likewise for frame objects.
4163
4164 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4165
4166 * syssignal.h (handle_on_main_thread): Always declare,
4167 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
4168 This ports to platforms without HAVE_PTHREAD.
4169
4170 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4171
4172 Signal-handler cleanup (Bug#12327).
4173 Emacs's signal handlers were written in the old 4.2BSD style with
4174 sigblock and sigmask and so forth, and this led to some
4175 inefficiencies and confusion. Rewrite these to use
4176 pthread_sigmask etc. without copying signal sets around. Also,
4177 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
4178 'signal', and instead use functions that do not attempt to take
4179 over the system name space. This patch causes Emacs's text
4180 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
4181 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
4182 Do not include <signal.h> or "syssignal.h", as these
4183 modules do not use signals.
4184 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
4185 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
4186 Do not include <signal.h>, as "syssignal.h" does that for us now.
4187 * atimer.c (sigmask_atimers): New function.
4188 (block_atimers, unblock_atimers): New functions,
4189 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
4190 All uses replaced.
4191 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
4192 no longer needed here.
4193 * emacs.c (main): Inspect existing signal handler with sigaction,
4194 so that there's no need to block and unblock SIGHUP.
4195 * sysdep.c (struct save_signal): New member 'action', replacing
4196 old member 'handler'.
4197 (save_signal_handlers, restore_signal_handlers):
4198 Use sigaction instead of 'signal' to save and restore.
4199 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
4200 New function. All users of 'signal' modified to use set_sighandler
4201 if they're writeonly, and to use sys_signal if they're read+write.
4202 (emacs_sigaction_init, forwarded_signal): New functions.
4203 (sys_signal): Remove. All uses replaced by calls to sigaction
4204 and emacs_sigaction_init, or by direct calls to 'signal'.
4205 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
4206 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
4207 all uses replaced by pthread_sigmask etc. calls.
4208 * syssignal.h: Include <signal.h>.
4209 (emacs_sigaction_init, forwarded_signal): New decls.
4210 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
4211 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
4212 (sigmask, sys_sigmask): Remove; no longer needed.
4213 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
4214 (sigblock, sigunblock, sigfree):
4215 (sigsetmask) [!defined sigsetmask]:
4216 Remove. All uses replaced by pthread_sigmask.
4217 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
4218 no longer need to be replaced, and its typical old uses
4219 are now done via emacs_sigaction_init and sigaction.
4220 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
4221 (sys_sigdel): Remove; unused.
4222 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
4223
4224 2012-09-06 Eli Zaretskii <eliz@gnu.org>
4225
4226 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
4227 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
4228
4229 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4230
4231 Explicitly mark buffer_defaults and buffer_local_symbols.
4232 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
4233 mark_local_symbols here.
4234 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
4235 since special buffers aren't marked here any more.
4236 (allocate_buffer): Chain new buffer with all_buffers here...
4237 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
4238 not here.
4239 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
4240 (syms_of_buffer): Remove staticpro of the above.
4241 (init_buffer_once): Set names for buffer_defaults and
4242 buffer_local_symbols.
4243
4244 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4245
4246 Use bool for booleans in font-related modules.
4247 * font.c (font_intern_prop, font_style_to_value)
4248 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
4249 (generate_otf_features, font_check_otf_features, font_check_otf)
4250 (font_match_p, font_list_entities, font_at):
4251 * fontset.c (fontset_id_valid_p, reorder_font_vector
4252 (fontset_find_font, Fset_fontset_font)
4253 (face_suitable_for_char_p) [0]:
4254 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
4255 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
4256 (m17n_flt_initialized, ftfont_shape_by_flt):
4257 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
4258 * nsfont.m (nsfont_draw):
4259 * w32font.c (w32font_draw):
4260 * w32term.c (x_draw_glyphless_glyph_string_foreground):
4261 Use bool for booleans.
4262 * font.h: Adjust to above API changes.
4263 (struct font, struct font_driver, struct font_driver_list):
4264 Use bool for booleans.
4265 (struct font): Remove useless member encoding_type.
4266 All users removed.
4267 * fontset.c, xftfont.c: Omit unnecessary static decls.
4268
4269 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4270
4271 * alloc.c (mark_object): Revert window marking code
4272 since it's unsafe for the Fset_window_configuration.
4273
4274 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4275
4276 Fix race conditions with signal handlers and errno (Bug#12327).
4277 Be more systematic about preserving errno whenever a signal
4278 handler returns, even if it's not in the main thread. Do this by
4279 renaming signal handlers to distinguish between signal delivery
4280 and signal handling. All uses changed.
4281 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
4282 * data.c (deliver_arith_signal): Rename from arith_error.
4283 * dispnew.c (deliver_window_change_signal): Rename from
4284 window_change_signal.
4285 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
4286 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
4287 * keyboard.c (deliver_input_available_signal): Rename from
4288 input_available_signal.
4289 (deliver_user_signal): Rename from handle_user_signal.
4290 (deliver_interrupt_signal): Rename from interrupt_signal.
4291 * process.c (deliver_pipe_signal): Rename from send_process_trap.
4292 (deliver_child_signal): Rename from sigchld_handler.
4293 * atimer.c (handle_alarm_signal):
4294 * data.c (handle_arith_signal):
4295 * dispnew.c (handle_window_change_signal):
4296 * emacs.c (handle_fatal_signal, handle_danger_signal):
4297 * keyboard.c (handle_input_available_signal):
4298 * keyboard.c (handle_user_signal, handle_interrupt_signal):
4299 * process.c (handle_pipe_signal, handle_child_signal):
4300 New functions, with the actual signal-handling code taken from the
4301 original respective signal handlers, sans the sporadic attempts to
4302 preserve errno, since that's now done by handle_on_main_thread.
4303 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
4304 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
4305 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4306 Move to sysdep.c.
4307 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4308 Move initialization of main_thread to sysdep.c's init_signals.
4309 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
4310 our usage, and simplifies the mainline code.
4311 (record_child_status_change): New static function, as a helper
4312 for handle_child_signal, and with most of the old child handler's
4313 contents.
4314 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
4315 (handle_child_signal): Use the above.
4316 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4317 Moved here from emacs.c.
4318 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
4319 code moved here from emacs.c's main function.
4320 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
4321 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
4322 This lets callers save and restore errno properly.
4323
4324 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4325
4326 Remove redundant or unused things here and there.
4327 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
4328 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
4329 * editfns.c (Fcompare_buffer_substrings): Likewise.
4330 * frame.h (struct terminal, struct font_driver_list):
4331 Remove redundant declarations.
4332 * window.h (Qleft, Qright): Likewise.
4333
4334 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4335
4336 Do not mark objects from deleted buffers, windows and frames.
4337 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
4338 (mark_object): Likewise for windows and frames.
4339
4340 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4341
4342 * alloc.c (valid_lisp_object_p): Treat killed buffers,
4343 buffer_defaults and buffer_local_symbols as valid objects.
4344 Return special value to denote them.
4345
4346 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4347
4348 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
4349 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
4350 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
4351 (file_name_absolute_p, Fsubstitute_in_file_name):
4352 (check_executable, check_writable, Ffile_accessible_directory_p)
4353 (Fset_file_selinux_context, Fdefault_file_modes)
4354 (Finsert_file_contents, choose_write_coding_system)
4355 (Fwrite_region, build_annotations, a_write, e_write)
4356 (Fdo_auto_save):
4357 * filelock.c (boot_time_initialized, get_boot_time)
4358 (get_boot_time_1, lock_file_1, within_one_second):
4359 * floatfns.c (in_float):
4360 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
4361 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
4362 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
4363 * lisp.h (struct Lisp_Hash_Table.cmpfn):
4364 * window.c (compare_window_configurations):
4365 Use bool for booleans.
4366 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
4367 (Fdefault_file_modes): Now mode_t, not int, for modes.
4368 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
4369 (internal_delete_file): Now returns void, not a (boolean) int,
4370 since nobody was looking at the return value.
4371 * lisp.h, window.h: Adjust to above API changes.
4372
4373 * xdisp.c (set_message): Simplify and reindent last change.
4374
4375 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
4376
4377 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
4378
4379 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
4380
4381 * eval.c (call_debugger): Make the function non-static so that we
4382 can call it from set_message.
4383
4384 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
4385 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
4386
4387 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4388
4389 Give more-useful info on a fatal error (Bug#12328).
4390 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4391 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4392 of doing the work ourselves.
4393 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4394 do most of the work.
4395 (fatal_error_backtrace): New function, taken from the guts
4396 of the old fatal_error_signal, but with a new option to output
4397 a backtrace.
4398 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4399 info about the signal than just its number.
4400 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4401 * sysdep.c: Include <execinfo.h>
4402 (emacs_backtrace): New function, taken partly from the previous
4403 code of the 'die' function.
4404 (emacs_abort): Call fatal_error_backtrace rather than abort.
4405
4406 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4407
4408 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4409 eager (load-time) macro-expansion.
4410 * lisp.mk (lisp): Add macroexp.
4411
4412 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4413
4414 Simplify redefinition of 'abort' (Bug#12316).
4415 Do not try to redefine the 'abort' function. Instead, redo
4416 the code so that it calls 'emacs_abort' rather than 'abort'.
4417 This removes the need for the NO_ABORT configure-time macro
4418 and makes it easier to change the abort code to do a backtrace.
4419 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4420 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4421 Remove; sysdep.c's emacs_abort now takes its place.
4422 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4423 'abort' changed to use 'emacs_abort'.
4424 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4425 (abort) [!defined abort]: Rename to ...
4426 (emacs_abort): ... new name.
4427 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4428 the place of the old 'abort' in emacs.c.
4429 * w32.c, w32fns.c (abort): Do not #undef.
4430 * w32.c (emacs_abort): Rename from w32_abort.
4431
4432 2012-09-04 Eli Zaretskii <eliz@gnu.org>
4433
4434 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4435 offsets[j].dv, since the y axis of the screen coordinates points
4436 down, while the y axis of the font definition coordinates points
4437 up. This fixes display of Arabic diacritics such as KASRA and
4438 KASRATAN. (Bug#11860)
4439
4440 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4441
4442 Be more systematic about _setjmp vs setjmp.
4443 * alloc.c (test_setjmp, mark_stack):
4444 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4445 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4446 (png_load, my_error_exit, jpeg_load):
4447 * process.c (send_process_trap, send_process):
4448 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4449 The underscored versions are up to 30x faster on some hosts.
4450 Formerly, the code used setjmp+longjmp sometimes and
4451 _setjmp+_longjmp at other times, with no particular reason to
4452 prefer setjmp+longjmp.
4453
4454 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4455
4456 Fix minor problem found by static checking.
4457 * buffer.c (Fdelete_all_overlays): Return nil.
4458
4459 2012-09-03 Martin Rudalics <rudalics@gmx.at>
4460
4461 * buffer.c (Fdelete_all_overlays): New function.
4462
4463 2012-09-03 Chong Yidong <cyd@gnu.org>
4464
4465 * gtkutil.c: Add extern decl for Qxft.
4466
4467 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4468
4469 * emacs.c, eval.c: Use bool for boolean.
4470 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4471 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4472 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4473 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4474 (main, decode_env_path, Fdaemon_initialized):
4475 * eval.c (call_debugger, Finteractive_p, interactive_p):
4476 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4477 (maybe_call_debugger, Fbacktrace):
4478 * process.c (read_process_output, exec_sentinel):
4479 Use bool for booleans.
4480 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4481 All callers changed.
4482 * eval.c (interactive_p): Omit always-true boolean argument
4483 EXCLUDE_SUBRS_P. All callers changed.
4484 * dispextern.h, lisp.h: Reflect above API changes.
4485 * firstfile.c (dummy): Use the address of 'main', whose signature
4486 won't change, instead of the address of 'initialize', whose
4487 signature just changed from int to bool.
4488 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4489 * msdos.c (fatal_error_in_progress): ... from here.
4490 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4491 of incrementing it.
4492 (redisplay_internal, unwind_redisplay): Simply clear
4493 REDISPLAYING_P when unwinding, instead of saving its previous,
4494 always-false value and then restoring it.
4495
4496 Clean up some extern decls.
4497 Mostly, this hoists extern decls out of .c files and into .h files.
4498 That way, we're more likely to catch errors if the interfaces change.
4499 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4500 declare xg_mark_data.
4501 * dispextern.h (x_frame_parm_handlers):
4502 * font.h (Qxft):
4503 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4504 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4505 (Qultra_bold, Qoblique, Qitalic):
4506 Move extern decl here from .c file.
4507 * alloc.c (xg_mark_data) [USE_GTK]:
4508 * doc.c (Qclosure):
4509 * eval.c (Qlexical_binding):
4510 * fns.c (time) [!HAVE_UNISTD_H]:
4511 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4512 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4513 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4514 * lread.c (Qinternal_interpreter_environment):
4515 * minibuf.c (Qbuffer):
4516 * process.c (QCfamily, QCfilter):
4517 * widget.c (free_frame_faces):
4518 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4519 * xfont.c (x_clear_errors):
4520 * xterm.c (x_frame_parm_handlers):
4521 Remove now-redundant extern decls.
4522 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4523 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4524 Now static.
4525 * xfaces.c: Remove unnecessary static decls.
4526 * xterm.c (updating_frame): Remove decl of nonexistent object.
4527
4528 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4529 when building globals.h, as the objects that are not built on
4530 this host are not needed to compile C files on this host.
4531
4532 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4533
4534 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4535
4536 * frame.h: Add missing prototype for x_wm_set_size_hint.
4537
4538 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4539
4540 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4541 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4542 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4543 (Fsubstitute_command_keys):
4544 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4545 (save_excursion_save, save_excursion_restore)
4546 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4547 (format_time_string, general_insert_function)
4548 (make_buffer_string, make_buffer_string_both)
4549 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4550 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4551 (copy_text, insert_1, insert_1_both, insert_from_string)
4552 (insert_from_string_before_markers, insert_from_string_1)
4553 (insert_from_buffer, insert_from_buffer_1, replace_range)
4554 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4555 (del_range_2, modify_region):
4556 * intervals.c (intervals_equal, balance_possible_root_interval)
4557 (adjust_intervals_for_insertion, merge_properties_sticky)
4558 (graft_intervals_into_buffer, lookup_char_property)
4559 (adjust_for_invis_intang, set_point_both)
4560 (get_property_and_range, compare_string_intervals)
4561 (set_intervals_multibyte_1, set_intervals_multibyte):
4562 * keyboard.c (decode_timer):
4563 Use bool for boolean.
4564 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4565 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4566
4567 2012-09-02 Chong Yidong <cyd@gnu.org>
4568
4569 * keymap.c (push_key_description): Print M-TAB as C-M-i
4570 (Bug#11758).
4571
4572 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
4573
4574 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4575 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4576 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4577 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4578 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4579 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4580 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4581
4582 2012-09-01 Eli Zaretskii <eliz@gnu.org>
4583
4584 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4585 more than one grapheme cluster passed to the shaper: compute the
4586 offset adjustment values separately for each cluster. (Bug#11860)
4587
4588 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4589 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4590 about implicit conversions from integer to pointer.
4591
4592 2012-09-01 Daniel Colascione <dancol@dancol.org>
4593
4594 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4595 system used too early.
4596
4597 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4598
4599 Better seed support for (random).
4600 * emacs.c (main): Call init_random.
4601 * fns.c (Frandom): Set the seed from a string argument, if given.
4602 Remove long-obsolete Gentzel cruft.
4603 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4604 (init_random): New function.
4605
4606 2012-09-01 Daniel Colascione <dancol@dancol.org>
4607
4608 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4609 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4610 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4611 x_wm_set_size_hint, x_query_colors, x_real_positions,
4612 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4613 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4614 all of which have been moved to common code.
4615
4616 * xfaces.c: Include TERM_HEADER instead of listing all possible
4617 window-system headers.
4618
4619 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4620 to match header.
4621
4622 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4623 directly accessing frame internals.
4624
4625 * w32font.h: Include font.h. Define syms_of_w32font and
4626 globals_of_w32font.
4627
4628 * process.c: Include TERM_HEADER instead of listing all possible
4629 window-system headers.
4630
4631 * nsterm.h: Remove declarations now in frame.h.
4632 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
4633
4634 * menu.c: Include TERM_HEADER instead of listing all possible
4635 window-system headers.
4636
4637 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4638 window system.
4639
4640 * keyboard.c: Include TERM_HEADER instead of listing all possible
4641 window-system headers.
4642
4643 * image.c: Include TERM_HEADER instead of listing all possible
4644 window-system headers. Declare Vlibrary_cache when compiling for
4645 Windows.
4646
4647 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4648 window system declarations.
4649
4650 * frame.h: Move common functions here: set_frame_menubar,
4651 x_set_window_size, x_sync, x_get_focus_frame,
4652 x_set_mouse_position, x_set_mouse_pixel_position,
4653 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4654 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4655 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4656 x_activate_menubar, x_real_positions, x_bitmap_icon,
4657 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4658 and x_query_colors.
4659
4660 * frame.c: Include TERM_HEADER instead of listing all possible
4661 window-system headers.
4662
4663 * font.c: Include TERM_HEADER instead of listing all possible
4664 window-system headers.
4665
4666 * emacs.c: Include TERM_HEADER.
4667
4668 * dispnew.c: Include TERM_HEADER instead of listing all possible
4669 window-system headers.
4670
4671 * ccl.h: Include character.h.
4672
4673 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4674 the current window system; include in list of objects to link into
4675 Emacs.
4676
4677 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4678
4679 Remove mark_ttys function and fix tty_display_info initialization.
4680 * lisp.h (mark_ttys): Remove prototype.
4681 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4682 to mark_ttys because all possible values of 'top_frame' slot are
4683 the frames which are reachable from Vframe_list.
4684 * term.c (mark_ttys): Remove.
4685 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4686
4687 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4688
4689 Change struct frame bitfields from unsigned char to unsigned.
4690 * frame.h (struct frame): Change type of 'display_preempted',
4691 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4692 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4693 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4694 bitfields from unsigned char to unsigned.
4695
4696 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4697
4698 Remove unused member of struct x_output and struct w32_output.
4699 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4700 * w32term.h (struct w32_output): Likewise.
4701
4702 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4703
4704 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4705 does not become zero (Bug#12234).
4706
4707 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4708
4709 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4710 for GCC 4.7.1 x86-64.
4711
4712 2012-08-30 Glenn Morris <rgm@gnu.org>
4713
4714 * lread.c (init_lread): For out-of-tree builds, only add the
4715 source directory's site-lisp dir to the load-path if it exists,
4716 consistent with in-tree builds. (Bug#12302)
4717
4718 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4719
4720 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4721 button_values to NULL. Call setStykeMask so dialogs get a close button.
4722 (windowShouldClose:): Set window_closed.
4723 (dealloc): New member, free button_values.
4724 (process_dialog:): Make member function. Remove window argument,
4725 replace window with self. Count buttons and allocate and store values
4726 in button_values.
4727 (addButton:value:row:): value is int with the name tag. Call setTag
4728 with tag. Remove return self, declare return value as void.
4729 (addString:row:): Remove return self, declare return value as void.
4730 (addSplit): Remove return self, declare return value as void.
4731 (clicked:): Remove return self, declare return value as void.
4732 Set dialog_return to button_values[seltag]. Code formatting change.
4733 (initFromContents:isQuestion:): Adjust call to process_dialog.
4734 Code formatting change.
4735 (timeout_handler:): Set timer_fired to YES.
4736 (runDialogAt:): Set timer_fired to NO.
4737 Handle click on close button as quit.
4738
4739 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4740 Add window_closed and button_values. Add void as return value for
4741 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4742 Add process_dialog as new member.
4743
4744 2012-08-28 Eli Zaretskii <eliz@gnu.org>
4745
4746 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4747 is not one of the heaps we manage. (Bug#12242)
4748
4749 2012-08-28 Glenn Morris <rgm@gnu.org>
4750
4751 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4752
4753 2012-08-28 Martin Rudalics <rudalics@gmx.at>
4754
4755 * window.c (Fset_window_configuration): Remove handling of
4756 auto-buffer-name window parameter. Install revision of reverted
4757 fix.
4758
4759 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4760
4761 Do not allow to set major mode for a dead buffer.
4762 * buffer.c (Fset_buffer_major_mode): Signal an error
4763 if the buffer is dead.
4764 (Fother_buffer, other_buffer_safely): Remove redundant
4765 nested declaration.
4766
4767 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4768
4769 Always use set_buffer_if_live to restore original buffer at unwind.
4770 * buffer.h (record_unwind_current_buffer): New function.
4771 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4772 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4773 * undo.c, window.c: Adjust users.
4774 * buffer.c (set_buffer_if_live): Fix comment.
4775
4776 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4777
4778 Fix usage of set_buffer_internal.
4779 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4780 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4781 * coding.c (decode_coding): Omit redundant test.
4782 * fileio.c (decide_coding_unwind): Likewise.
4783 * fns.c (secure_hash): Likewise.
4784 * insdel.c (modify_region): Likewise.
4785 * keyboard.c (command_loop_1): Likewise.
4786 * print.c (PRINTFINISH): Likewise.
4787 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4788
4789 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4790
4791 * dispnew.c: Use bool for boolean.
4792 (frame_garbaged, display_completed, delayed_size_change)
4793 (fonts_changed_p, add_window_display_history)
4794 (add_frame_display_history, verify_row_hash)
4795 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4796 (row_equal_p, realloc_glyph_pool)
4797 (allocate_matrices_for_frame_redisplay)
4798 (showing_window_margins_p)
4799 (adjust_frame_glyphs_for_frame_redisplay)
4800 (build_frame_matrix_from_leaf_window, make_current)
4801 (mirrored_line_dance, mirror_line_dance, update_frame)
4802 (update_window_tree, update_single_window)
4803 (check_current_matrix_flags, update_window, update_text_area)
4804 (update_window_line, set_window_update_flags, scrolling_window)
4805 (update_frame_1, scrolling, buffer_posn_from_coords)
4806 (do_pending_window_change, change_frame_size)
4807 (change_frame_size_1, sit_for):
4808 Use bool for boolean.
4809 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4810 and remove last int (actually boolean) argument, which was always 0.
4811 All callers changed.
4812 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4813 * dispextern.h (struct composition_it): Use bool for boolean.
4814 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4815 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4816 * dired.c (file_name_completion):
4817 Use bool for boolean. (This was missed in an earlier change.)
4818
4819 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4820
4821 * window.c (Fset_window_configuration): Revert first part of
4822 last change.
4823
4824 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4825
4826 * nsterm.h (NSPanel): New class variable dialog_return.
4827
4828 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4829 Initialize dialog_return.
4830 (windowShouldClose:): Use stop instead of stopModalWithCode.
4831 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4832 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4833 event.
4834 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4835 modal loop returns.
4836
4837 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4838
4839 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4840 * composite.c (find_composition, composition_gstring_p)
4841 (composition_reseat_it, find_automatic_composition):
4842 * data.c (let_shadows_buffer_binding_p)
4843 (let_shadows_global_binding_p, set_internal, make_blv)
4844 (Fmake_variable_buffer_local, Fmake_local_variable)
4845 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4846 (cons_to_signed, arith_driver):
4847 * dbusbind.c (xd_in_read_queued_messages):
4848 * dired.c (directory_files_internal, file_name_completion):
4849 Use bool for booleans.
4850 * dired.c (file_name_completion):
4851 * process.h (fd_callback):
4852 Omit int (actually boolean) argument. It wasn't being used.
4853 All uses changed.
4854 * composite.h, lisp.h: Reflect above API changes.
4855
4856 * cmds.c, coding.c: Use bool for booleans.
4857 * cmds.c (move_point, Fself_insert_command):
4858 * coding.h (struct composition status, struct coding_system):
4859 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4860 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4861 (emacs_mule_char, decode_coding_emacs_mule)
4862 (encode_coding_emacs_mule, detect_coding_iso_2022)
4863 (decode_coding_iso_2022, encode_invocation_designation)
4864 (encode_designation_at_bol, encode_coding_iso_2022)
4865 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4866 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4867 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4868 (encode_coding_raw_text, detect_coding_charset)
4869 (decode_coding_charset, encode_coding_charset, detect_eol)
4870 (detect_coding, get_translation_table, produce_chars)
4871 (consume_chars, reused_workbuf_in_use)
4872 (make_conversion_work_buffer, code_conversion_save)
4873 (decode_coding_object, encode_coding_object)
4874 (detect_coding_system, char_encodable_p)
4875 (Funencodable_char_position, code_convert_region)
4876 (code_convert_string, code_convert_string_norecord)
4877 (Fset_coding_system_priority):
4878 * fileio.c (Finsert_file_contents):
4879 Use bool for booleans.
4880 * coding.h, lisp.h: Reflect above API changes.
4881 * coding.c: Remove unnecessary static function decls.
4882 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4883 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4884 not a boolean 'int', since callers never look at the return value.
4885 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4886 * coding.h (decoding_buffer_size, encoding_buffer_size)
4887 (emacs_mule_string_char): Remove unused extern decls.
4888 (struct iso_2022_spec, struct coding_system):
4889 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4890 (struct emacs_mule_spec): Remove unused field 'full_support'.
4891 All initializations removed.
4892 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4893
4894 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4895
4896 Fix spare memory change (Bug#12286).
4897 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4898 (valid_lisp_object_p): Likewise.
4899
4900 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4901
4902 * window.c (Fset_window_configuration): Record any window's old
4903 buffer if it's replaced (see Bug#8789). If the new current
4904 buffer doesn't appear in the selected window, go to its old
4905 point (Bug#12208).
4906
4907 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4908
4909 Special MEM_TYPE_SPARE to denote reserved memory.
4910 * alloc.c (enum mem_type): New memory type.
4911 (refill_memory_reserve): Use new type for spare memory.
4912 This prevents live_cons_p and live_string_p from incorrect
4913 detection of uninitialized objects from spare memory as live.
4914
4915 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4916
4917 Spelling fixes.
4918 * Makefile.in (.PHONY): versioclean -> versionclean.
4919
4920 Remove unused external symbols.
4921 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4922 * window.c (Qwindow_valid_p, decode_valid_window):
4923 Now static, not extern.
4924 * data.c (Qinterval): Remove; unused.
4925 (syms_of_data): Do not define 'interval'.
4926 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4927 * window.h (decode_valid_window):
4928 Remove decls.
4929
4930 * character.c, charset.c, chartab.c: Use bool for booleans.
4931 * character.c (lisp_string_width, string_count_byte8)
4932 (string_escape_byte8):
4933 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4934 (load_charset_map_from_file, map_charset_chars)
4935 (Fdefine_charset_internal, define_charset_internal)
4936 (Fdeclare_equiv_charset, find_charsets_in_text)
4937 (Ffind_charset_region, char_charset, Fiso_charset):
4938 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4939 (sub_char_table_set, sub_char_table_set_range)
4940 (char_table_set_range, optimize_sub_char_table)
4941 (map_sub_char_table):
4942 Use bool for boolean.
4943 * character.c (str_to_unibyte): Omit last boolean argument; it was
4944 always 0. All callers changed.
4945 * character.h, charset.h: Adjust to match previous changes.
4946 * character.h (char_printable_p): Remove decl of nonexistent function.
4947 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4948 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4949 are all boolean, so make them single-bit bitfields.
4950
4951 * lisp.h (ASET): Remove attempt to detect side effects.
4952 It was meant to be temporary and it often doesn't work,
4953 because when IDX has side effects the behavior of IDX==IDX
4954 is undefined. See Stefan Monnier in
4955 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4956
4957 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4958
4959 * lisp.h (functionp): New function (extracted from Ffunctionp).
4960 (FUNCTIONP): Use it.
4961 * eval.c (Ffunctionp): Use it.
4962
4963 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4964
4965 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4966 as that's faster and simpler than static storage. Don't bother
4967 with the g_main_context_query overhead if g_main_context_pending
4968 says no events are pending.
4969 (gfds, gfds_size): Remove these static vars.
4970 (xgselect_initialize): Remove; no longer needed.
4971 All uses and decls removed.
4972
4973 * emacs.c (fatal_error_signal_hook): Remove.
4974 All uses removed. This leftover from old code was always 0.
4975
4976 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4977 * casefiddle.c (casify_object, casify_region):
4978 * casetab.c (set_case_table):
4979 * category.c, category.h (word_boundary_p):
4980 * category.h (CHAR_HAS_CATEGORY):
4981 Use bool for booleans, instead of int.
4982
4983 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4984
4985 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4986
4987 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4988
4989 On assertion failure, print backtrace if available.
4990 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4991 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4992 * Makefile.in (LIB_EXECINFO): New macro.
4993 (LIBES): Use it.
4994
4995 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4996 * bytecode.c (exec_byte_code):
4997 * callint.c (check_mark, Fcall_interactively):
4998 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4999 (getenv_internal, sync_process_alive, call_process_exited):
5000 * lisp.h (USE_SAFE_ALLOCA):
5001 Use bool for booleans, instead of int.
5002 * lisp.h, process.h: Adjust prototypes to match above changes.
5003 * callint.c (Fcall_interactively): Don't assume the mark's
5004 offset fits in 'int'.
5005
5006 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
5007
5008 * buffer.c, buffer.h: Use bool for boolean.
5009 * buffer.c (reset_buffer_local_variables)
5010 (buffer_lisp_local_variables, Fset_buffer_modified_p)
5011 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
5012 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
5013 (overlay_touches_p, overlay_strings, Foverlay_put)
5014 (report_overlay_modification, call_overlay_mod_hooks):
5015 (mmap_enlarge, mmap_set_vars):
5016 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
5017 Use bool for booleans, instead of int.
5018 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
5019 since the 1-or-0 return value is always ignored anyway.
5020 (mmap_initialized_p):
5021 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
5022 * buffer.h, lisp.h: Adjust prototypes to match above changes.
5023
5024 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5025
5026 * bidi.c: Use bool for boolean.
5027 This is a bit more readable, and makes the text segment of bidi.o
5028 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
5029 Presumably it's faster too.
5030 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
5031 Now bool.
5032 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5033 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
5034 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
5035 (bidi_explicit_dir_char, bidi_level_of_next_char)
5036 (bidi_find_other_level_edge, bidi_move_to_visually_next):
5037 Use bool for booleans, instead of int.
5038 * dispextern.h (bidi_init_it, bidi_paragraph_init)
5039 (bidi_unshelve_cache): Adjust decls to match code.
5040
5041 2012-08-23 Martin Rudalics <rudalics@gmx.at>
5042
5043 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
5044 argument.
5045
5046 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5047
5048 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
5049 * atimer.h: Include <stdbool.h>.
5050
5051 2012-08-22 Dan Nicolaescu <dann@gnu.org>
5052
5053 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
5054 compile time tests instead of run time tests on systems that do
5055 not use them.
5056 (FRAME_MAC_P): Remove leftover from deleted code.
5057 * frame.c (syms_of_frame): Remove leftover from deleted code.
5058
5059 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
5060
5061 * nsterm.m (insertText:): Don't clear modifiers if code is space.
5062
5063 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
5064
5065 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
5066 Otherwise, the compiler complains about (A?B:C) where B is void
5067 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
5068 (fontset_add): Return void, for FONTSET_ADD.
5069
5070 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5071
5072 * alloc.c: Use bool for booleans.
5073 (gc_in_progress, abort_on_gc)
5074 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5075 (dont_register_blocks) [GC_MALLOC_CHECK]:
5076 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
5077 (check_string_bytes, make_specified_string, memory_full)
5078 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
5079 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
5080 (mark_stack, valid_pointer_p, make_pure_string)
5081 (Fgarbage_collect, survives_gc_p, gc_sweep):
5082 Use bool for booleans, instead of int.
5083 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5084 Remove unused local.
5085 * alloc.c (PURE_POINTER_P):
5086 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
5087 * editfns.c (Fformat):
5088 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
5089 (Fdo_auto_save):
5090 * fns.c (sweep_weak_table):
5091 * lisp.h (suppress_checking, push_message, survives_gc_p)
5092 (make_pure_string, gc_in_progress, abort_on_gc):
5093 * lread.c (readchar, read1):
5094 * print.c (Fprin1_to_string):
5095 * xdisp.c (push_message):
5096 Use bool for booleans affected directly or indirectly by
5097 alloc.c's changes.
5098
5099 Make recently-introduced setters macros.
5100 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
5101 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
5102 (set_fontset_default, set_fontset_fallback): Rename from their
5103 upper-case counterparts, and make them functions rather than macros.
5104 This is more consistent with the other recently-introduced setters.
5105 These don't need to be inline, since they're local.
5106
5107 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
5108
5109 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
5110 the loop (Bug#12247).
5111
5112 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5113
5114 * lisp.h (vcopy): Use memcpy rather than our own loop.
5115 This fixes a performance regression introduced by the recent
5116 addition of vcopy. This means 'vcopy' will need to be modified
5117 for a copying collector, but that's OK. Also, tighten the
5118 checking in the assertion.
5119
5120 2012-08-21 Eli Zaretskii <eliz@gnu.org>
5121
5122 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
5123 components for RTL text (Bug#11860). Adjust X-OFFSET of each
5124 non-base glyph for the width of the base character, according to
5125 what x_draw_composite_glyph_string_foreground expects.
5126 Generate WADJUST value according to composition_gstring_width's
5127 expectations, to produce correct width of the composed character.
5128 Reverse the sign of the DU offset produced by ScriptPlace.
5129
5130 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5131
5132 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
5133
5134 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5135
5136 Avoid direct writes to contents member of struct Lisp_Vector.
5137 * lisp.h (vcopy): New function to copy data into vector.
5138 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
5139 * fns.c (Ffillarray): Use ASET.
5140 * keyboard.c (timer_check_2): Use AREF and ASET.
5141 (append_tool_bar_item, Frecent_keys): Use vcopy.
5142 * lread.c (read_vector): Use ASET.
5143 * msdos.c (Frecent_doskeys): Use vcopy.
5144 * xface.c (Finternal_copy_lisp_face): Use vcopy.
5145 (Finternal_merge_in_global_face): Use ASET and vcopy.
5146 * xfont.c (xfont_list_pattern): Likewise.
5147
5148 2012-08-21 Martin Rudalics <rudalics@gmx.at>
5149
5150 * window.c (Fwindow_point): For the selected window always return
5151 the position of its buffer's point.
5152 (Fset_window_point): For the selected window always go in its
5153 buffer to the specified position.
5154
5155 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5156
5157 Setter macros for fontsets.
5158 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
5159 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
5160 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
5161 Adjust users.
5162
5163 2012-08-20 Glenn Morris <rgm@gnu.org>
5164
5165 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5166 Don't assume that `ln -f' works.
5167
5168 2012-08-20 Eli Zaretskii <eliz@gnu.org>
5169
5170 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
5171 and later about non-assignments with no effect. See discussion at
5172 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
5173 details.
5174
5175 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5176
5177 Inline setter functions for Lisp_Objects slots of struct specbinding.
5178 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
5179 Adjust users.
5180
5181 2012-08-20 Martin Rudalics <rudalics@gmx.at>
5182
5183 * window.c (select_window): Always make selected window's buffer
5184 current.
5185
5186 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5187
5188 Use AREF and ASET for docstrings of category tables.
5189 * category.h (CATEGORY_DOCSTRING): Use AREF.
5190 (SET_CATEGORY_DOCSTRING): Use ASET.
5191 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
5192
5193 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5194
5195 Inline setter functions for hash table members.
5196 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
5197 (set_hash_hash, set_hash_index): Rename with _slot suffix.
5198 (set_hash_key_and_value, set_hash_index, set_hash_next)
5199 (set_hash_hash): New functions.
5200 * charset.c, fns.c: Adjust users.
5201
5202 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5203
5204 Inline getter and setter functions for per-buffer values.
5205 * buffer.h (per_buffer_default, set_per_buffer_default)
5206 (per_buffer_value, set_per_buffer_value): New functions.
5207 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
5208 * buffer.c, data.c: Adjust users.
5209
5210 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
5211
5212 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
5213
5214 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
5215
5216 Rely on <config.h> + <unistd.h> to declare 'environ',
5217 as gnulib does this if the system doesn't.
5218 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
5219 Remove declaration. MS-Windows declares it on stdlib.h which is
5220 included by conf_post.h.
5221 * emacs.c (environ) [DOUG_LEA_MALLOC]:
5222 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
5223 * vm-limit.c: Include <unistd.h>, for 'environ'.
5224
5225 * unexaix.c, unexcoff.c: Include "mem-limits.h".
5226 (start_of_data): Remove decl; mem-limits.h provides it.
5227
5228 * xdisp.c (handle_invisible_prop): Make it a bit faster
5229 and avoid a gcc -Wmaybe-uninitialized diagnostic.
5230
5231 2012-08-19 Chong Yidong <cyd@gnu.org>
5232
5233 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
5234 ends (Bug#3874).
5235
5236 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
5237
5238 * .gdbinit: Use call instead of set when calling a function in the
5239 inferior.
5240
5241 * data.c (set_internal): Don't use set_blv_found.
5242 (Fkill_local_variable): Likewise.
5243
5244 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
5245
5246 * nsfont.m (ns_ascii_average_width): Ensure the string
5247 ascii_printable is initialized with a null-terminated character
5248 array. Otherwise, it can contain undesired extra characters.
5249
5250 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5251
5252 port new setting code to Sun C 5.8 2005/10/13
5253 * chartab.c, lisp.h (char_table_set, char_table_set_range):
5254 Return void, not Lisp_Object. Otherwise, the compiler
5255 complains about (A?B:C) where B is void and C is Lisp_Object
5256 when compiling CHAR_TABLE_SET, due to the recent change to
5257 the API of sub_char_table_set_contents.
5258
5259 2012-08-18 Chong Yidong <cyd@gnu.org>
5260
5261 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
5262 for the string case (Bug#3874).
5263
5264 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5265
5266 * buffer.h (BSET): Remove (Bug#12215).
5267 Replace all uses with calls to new setter functions.
5268 (bset_bidi_paragraph_direction, bset_case_canon_table)
5269 (bset_case_eqv_table, bset_directory, bset_display_count)
5270 (bset_display_time, bset_downcase_table)
5271 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
5272 (bset_last_selected_window, bset_local_var_alist)
5273 (bset_mark_active, bset_point_before_scroll, bset_read_only)
5274 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
5275 (bset_width_table):
5276 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5277 (bset_auto_fill_function, bset_auto_save_file_format)
5278 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5279 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5280 (bset_cache_long_line_scans, bset_case_fold_search)
5281 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5282 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5283 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5284 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5285 (bset_header_line_format, bset_indicate_buffer_boundaries)
5286 (bset_indicate_empty_lines, bset_invisibility_spec)
5287 (bset_left_fringe_width, bset_major_mode, bset_mark)
5288 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5289 (bset_name, bset_overwrite_mode, bset_pt_marker)
5290 (bset_right_fringe_width, bset_save_length)
5291 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5292 (bset_scroll_up_aggressively, bset_selective_display)
5293 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5294 (bset_word_wrap, bset_zv_marker):
5295 * category.c (bset_category_table):
5296 * syntax.c (bset_syntax_table):
5297 New setter functions.
5298
5299 * process.h (PSET): Remove (Bug#12215).
5300 Replace all uses with calls to new setter functions.
5301 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5302 (PROCESS_INLINE): New macro.
5303 (pset_childp): New setter function.
5304 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
5305 * process.c (PROCESS_INLINE):
5306 Define to EXTERN_INLINE, so that the corresponding functions
5307 are compiled into code.
5308 (pset_buffer, pset_command, pset_decode_coding_system)
5309 (pset_decoding_buf, pset_encode_coding_system)
5310 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
5311 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
5312 (pset_type, pset_write_queue): New setter functions.
5313
5314 * window.h (WSET): Remove (Bug#12215).
5315 Replace all uses with calls to new setter functions.
5316 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5317 (WINDOW_INLINE): New macro.
5318 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
5319 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
5320 (wset_total_lines, wset_vertical_scroll_bar)
5321 (wset_window_end_pos, wset_window_end_valid)
5322 (wset_window_end_vpos): New setter functions.
5323 * window.c (WINDOW_INLINE):
5324 Define to EXTERN_INLINE, so that the corresponding functions
5325 are compiled into code.
5326 (wset_combination_limit, wset_dedicated, wset_display_table)
5327 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
5328 (wset_new_normal, wset_new_total, wset_next_buffers)
5329 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5330 (wset_prev_buffers, wset_right_fringe_width)
5331 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
5332 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
5333 (wset_window_parameters):
5334 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5335 (wset_column_number_displayed, wset_region_showing):
5336 New setter functions.
5337
5338 * termhooks.h (TSET): Remove (Bug#12215).
5339 Replace all uses with calls to new setter functions.
5340 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5341 (TERMHOOKS_INLINE): New macro.
5342 (tset_charset_list, tset_selection_alist): New setter functions.
5343 * terminal.c (TERMHOOKS_INLINE):
5344 Define to EXTERN_INLINE, so that the corresponding functions
5345 are compiled into code.
5346 (tset_param_alist): New setter function.
5347
5348 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5349
5350 * keyboard.h (KSET): Remove (Bug#12215).
5351 Replace all uses with calls to new setter functions.
5352 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5353 (KEYBOARD_INLINE): New macro.
5354 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
5355 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
5356 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
5357 New setter functions.
5358 * keyboard.c (KEYBOARD_INLINE):
5359 Define to EXTERN_INLINE, so that the corresponding functions
5360 are compiled into code.
5361 (kset_echo_string, kset_kbd_queue)
5362 (kset_keyboard_translate_table, kset_last_prefix_arg)
5363 (kset_last_repeatable_command, kset_local_function_key_map)
5364 (kset_overriding_terminal_local_map, kset_real_last_command)
5365 (kset_system_key_syms): New setter functions.
5366
5367 * frame.h (FSET): Remove (Bug#12215).
5368 Replace all uses with calls to new setter functions.
5369 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5370 (FRAME_INLINE): New macro.
5371 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
5372 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
5373 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
5374 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
5375 (fset_param_alist, fset_root_window, fset_scroll_bars)
5376 (fset_selected_window, fset_title, fset_tool_bar_items)
5377 (fset_tool_bar_position, fset_tool_bar_window): New functions.
5378 * frame.c (FRAME_INLINE):
5379 Define to EXTERN_INLINE, so that the corresponding functions
5380 are compiled into code.
5381 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
5382
5383 A few more naming-convention fixes for getters and setters.
5384 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
5385 and rename from buffer_overlays_set_before.
5386 (set_buffer_overlays_after): Move here from buffer.h, and rename
5387 from buffer_overlays_set_after.
5388 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5389 All uses changed.
5390 (set_buffer_intervals): Rename from buffer_set_intervals.
5391 * intervals.c (set_interval_object): Move here from intervals.h,
5392 and rename from interval_set_object.
5393 (set_interval_left): Move here from intervals.h, and rename from
5394 interval_set_left.
5395 (set_interval_right): Move here from intervals.h, and rename from
5396 interval_set_right.
5397 (copy_interval_parent): Move here from intervals.h, and rename from
5398 interval_copy_parent.
5399 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5400 (set_interval_plist): Rename from interval_set_plist.
5401 Return void, not Lisp_Object, since no caller uses the result.
5402 * lisp.h (string_intervals): Rename from string_get_intervals.
5403 (set_string_intervals): Rename from string_set_intervals.
5404
5405 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5406 (set_char_table_contents): Rename from char_table_set_contents.
5407 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
5408 All uses changed. See the end of
5409 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5410
5411 * lisp.h (CSET): Remove (Bug#12215).
5412 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5413 (set_char_table_purpose): New functions,
5414 replacing CSET. All uses changed. For example, replace
5415 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
5416 "set_char_table_parent (char_table, parent);".
5417 The old version was confusing because it used the same name
5418 'parent' for two different things.
5419
5420 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5421
5422 Functions to get and set Lisp_Object fields of buffer-local variables.
5423 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5424 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5425 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
5426 * data.c, eval.c, frame.c: Adjust users.
5427
5428 2012-08-17 Chong Yidong <cyd@gnu.org>
5429
5430 * xfaces.c (merge_face_vectors): If the target font specfies a
5431 font spec, make the font's attributes take precedence over
5432 directly-specified attributes.
5433 (merge_face_ref): Recognize :font.
5434
5435 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5436
5437 Do not use memcpy for copying intervals.
5438 * intervals.c (reproduce_interval): New function.
5439 (reproduce_tree, reproduce_tree_obj): Use it.
5440 (reproduce_tree_obj): Remove prototype.
5441
5442 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5443
5444 * lisp.h (duration_to_sec_usec): Remove unused decl.
5445
5446 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5447
5448 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5449 to an allocated instance of NSString, not to the class itself.
5450
5451 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
5452
5453 * makefile.w32-in (C_CTYPE_H): New macro.
5454 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5455 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5456 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5457
5458 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5459
5460 Use ASCII tests for character types.
5461 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5462 * xfns.c, xterm.c:
5463 Don't include <ctype.h>; was not needed.
5464 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5465 * sysdep.c, xfaces.c:
5466 Include <c-ctype.h> instead of <ctype.h>.
5467 * nsterm.m: Include <c-ctype.h>.
5468 * charset.c (read_hex):
5469 * doc.c (Fsnarf_documentation):
5470 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5471 (DRIVE_LETTER) [DOS_NT]:
5472 (Ffile_name_directory, Fexpand_file_name)
5473 (Fsubstitute_in_file_name):
5474 * font.c (font_parse_xlfd, font_parse_fcname):
5475 * frame.c (x_set_font_backend):
5476 * gtkutil.c (xg_get_font):
5477 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5478 * nsimage.m (hexchar):
5479 * nsterm.m (ns_xlfd_to_fontname):
5480 * sysdep.c (system_process_attributes):
5481 * xfaces.c (hash_string_case_insensitive):
5482 Use C-locale tests instead of locale-specific tests for character
5483 types, since we want the ASCII interpretation here, not the
5484 interpretation suitable for whatever happens to be the current locale.
5485
5486 2012-08-16 Martin Rudalics <rudalics@gmx.at>
5487
5488 Consistently check windows for validity/liveness
5489 (Bug#11984, Bug#12025, Bug#12026).
5490 * lisp.h (CHECK_VALID_WINDOW): New macro.
5491 * window.c (decode_window): Rename to decode_live_window.
5492 (decode_valid_window, Fwindow_valid_p): New functions.
5493 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5494 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5495 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5496 (Fwindow_prev_sibling, Fwindow_combination_limit)
5497 (Fset_window_combination_limit, Fwindow_use_time)
5498 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5499 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5500 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5501 (Fwindow_hscroll, Fset_window_hscroll)
5502 (Fwindow_redisplay_end_trigger)
5503 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5504 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5505 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5506 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5507 (Fwindow_end, Fset_window_point, Fset_window_start)
5508 (Fpos_visible_in_window_p, Fwindow_line_height)
5509 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5510 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5511 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5512 (Fset_window_parameter, Fwindow_display_table)
5513 (Fset_window_display_table, Fdelete_other_windows_internal)
5514 (Fset_window_buffer, Fset_window_new_total)
5515 (Fset_window_new_normal, Fdelete_window_internal)
5516 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5517 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5518 (Fwindow_scroll_bars): Check whether argument window is a valid or
5519 live window. Update doc-strings.
5520 (syms_of_window): New symbol Qwindow_valid_p.
5521 * keyboard.c (Fposn_at_x_y): Check whether argument
5522 frame_or_window denotes a valid window.
5523
5524 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5525
5526 Fix previous char table change.
5527 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5528 * chartab.c (optimize_sub_char_table): Likewise.
5529
5530 2012-08-16 Chong Yidong <cyd@gnu.org>
5531
5532 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5533
5534 * xfont.c (xfont_open):
5535 * xftfont.c (xftfont_open): Set the font's max_width field.
5536
5537 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5538 min_width to space_width and average_width to the average over
5539 printable ASCII characters.
5540 (ns_char_width): Code cleanup.
5541 (ns_ascii_average_width): New utility function.
5542
5543 * font.h (struct font): Update comments.
5544
5545 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5546
5547 Simple interface to set Lisp_Object fields of character tables.
5548 * lisp.h (CSET): New macro.
5549 (char_table_set_extras, char_table_set_contents)
5550 (sub_char_table_set_contents): New function.
5551 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5552 * syntax.c: Adjust users.
5553
5554 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5555
5556 * eval.c (eval_sub): Bind lexical-binding.
5557 * lread.c (Qlexical_binding): Make non-static.
5558
5559 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5560
5561 * nsmenu.m (popupSession): Remove.
5562 (pop_down_menu): Remove endModalSession.
5563 (timeout_handler:): New method.
5564 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5565 Call runModalForWindow. Check timer_fired when it returns.
5566 If not set, cancel timer and break out of loop.
5567 Otherwise loop again, with a new timeout.
5568
5569 * nsterm.m: Include fcntl.h if present.
5570 (fd_entry, t_readfds, inNsSelect): Remove.
5571 (select_writefds, select_valid, select_timeout, selfds)
5572 (select_mutex, apploopnr): Add.
5573 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5574 Otherwise call kbd_buffer_store_event.
5575 (ns_send_appdefined): Remove release of fd_entry.
5576 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5577 Increment and decrement apploopnr.
5578 (ns_select): If no file descriptors, just do a NSTimer.
5579 Otherwise copy read/write masks and start select thread (fd_handler).
5580 Start main loop and wait for application defined event.
5581 Inform select thread to stop selecting after main loop is exited.
5582 (ns_term_init): Create selfds pipe and set non-blocking.
5583 Initialize select_mutex. Start the select thread (fd_handler).
5584 (fd_handler:): Loop forever, wait for info from the main thread
5585 to either start or stop selecting. When select returns, send
5586 and appdefined event.
5587 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5588 If not call kbd_buffer_store_event.
5589
5590 * nsterm.h (EmacsApp): fd_handler takes id argument.
5591 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5592
5593 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5594
5595 2012-08-15 Eli Zaretskii <eliz@gnu.org>
5596
5597 * region-cache.c (move_cache_gap): Update gap_len using the actual
5598 growth of the boundaries array. Do not change cache_len.
5599 (Bug#12196)
5600
5601 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5602
5603 Generalize and cleanup font subsystem checks.
5604 * font.h (FONT_DEBUG, font_assert): Remove.
5605 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5606 Change font_assert to eassert. Use eassert where appropriate.
5607
5608 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5609
5610 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5611
5612 2012-08-15 Chong Yidong <cyd@gnu.org>
5613
5614 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5615 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5616 extract the font descriptor instead of just the font name.
5617 In that case, return a font spec instead of a string.
5618 (x_last_font_name): Move to this file from xfns.c.
5619
5620 * xfns.c (Fx_select_font): The return value can also be a font
5621 spec. Move x_last_font_name management to gtkutil.c.
5622
5623 * xfaces.c: Make font weight and style symbols non-static.
5624
5625 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5626
5627 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5628 (bug#12117).
5629
5630 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5631
5632 * alloc.c (Fgarbage_collect): Use plural form consistently.
5633
5634 2012-08-14 Eli Zaretskii <eliz@gnu.org>
5635
5636 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5637 iteration through the command loop. Fixes a problem whereby mouse
5638 movements are ignored until the first mouse click.
5639
5640 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5641
5642 Use bool, not int, for Lisp booleans.
5643 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5644 makes Emacs a bit smaller and presumably a bit faster.
5645 * lisp.h: Include <stdbool.h>.
5646 (struct Lisp_Boolfwd, defvar_bool):
5647 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5648 * regex.c [!emacs]: Include <stdbool.h>.
5649 (false, true): Remove; <stdbool.h> does this for us now.
5650
5651 2012-08-14 Chong Yidong <cyd@gnu.org>
5652
5653 * character.c (Fcharacterp): Doc fix (Bug#12076).
5654
5655 * data.c (Findirect_variable): Doc fix (Bug#11040).
5656
5657 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5658
5659 * editfns.c (Fformat): Doc fix (Bug#12059).
5660 (Fsave_current_buffer): Doc fix (Bug#11542).
5661
5662 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5663
5664 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5665 (bug#12022).
5666
5667 2012-08-14 Martin Rudalics <rudalics@gmx.at>
5668
5669 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5670 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5671 * minibuf.c (choose_minibuf_frame, read_minibuf):
5672 * w32fns.c (x_create_tip_frame):
5673 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5674 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5675
5676 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5677
5678 * intervals.c (offset_intervals): Remove obsolete comment.
5679
5680 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5681
5682 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5683
5684 2012-08-14 Gergely Risko <gergely@risko.hu>
5685
5686 * coding.c (decode_coding): Record buffer modification before
5687 disabling undo_list (Bug#11773).
5688
5689 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5690
5691 Revert and cleanup some recent overlay changes.
5692 * buffer.h (enum overlay_type): Remove.
5693 (buffer_get_overlays, buffer_set_overlays): Likewise.
5694 (buffer_set_overlays_before, buffer_set_overlays_after):
5695 New function. Adjust users.
5696 (unchain_both): Add eassert.
5697
5698 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5699
5700 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5701
5702 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5703
5704 * gtkutil.c (xg_mark_data): Don't assume C99.
5705
5706 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5707
5708 * gtkutil.c (xg_frame_tb_info): New struct.
5709 (TB_INFO_KEY): New define.
5710 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5711 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5712 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5713 if not present.
5714 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5715 is up to date. Otherwise store new data.
5716 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5717
5718 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5719
5720 Use KSET for write access to Lisp_Object members of struct kboard.
5721 * keyboard.h (KSET): New macro.
5722 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5723 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5724 * xterm.c: Adjust users.
5725
5726 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5727
5728 Use BSET for write access to Lisp_Object members of struct buffer.
5729 * buffer.h (BSET): New macro.
5730 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5731 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5732 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5733 * window.c, xdisp.c, xfns.c: Adjust users.
5734
5735 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5736
5737 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5738
5739 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5740
5741 * nsterm.m (not_in_argv): New function.
5742 (application:openFile, application:openTempFile:):
5743 (application:openFileWithoutUI:, application:openFiles:): Open file
5744 if not_in_argv returns non-zero (bug#12171).
5745
5746 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5747 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5748 Define for Gtk+ versions less than 3.2.
5749 (xg_get_font_name): Use those functions/macros here.
5750 Reported by Frans Oilinki <moilinki@gmail.com>.
5751
5752 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5753
5754 * unexmacosx.c (copy_data_segment): Copy initialized data in
5755 statically linked libraries from input file rather than memory.
5756
5757 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5758 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5759 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5760
5761 2012-08-10 Glenn Morris <rgm@gnu.org>
5762
5763 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5764 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5765
5766 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5767
5768 Fix last change to allow compilation with low optimization levels.
5769 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5770 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5771
5772 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5773
5774 Use common inline syntax in intervals.h.
5775 * intervals.h (INTERVALS_INLINE): New macro.
5776 Change all users from LISP_INLINE.
5777
5778 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5779
5780 Define Qnone once for all platforms.
5781 * frame.c (Qnone): Define here.
5782 (syms_of_frame): DEFSYM it.
5783 * lisp.h (Qnone): New declaration.
5784 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5785 * xfns.c: Remove duplication. Adjust users.
5786
5787 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5788
5789 Remove unused macros from intervals.h.
5790 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5791 * intervals.c: Adjust comment.
5792
5793 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5794
5795 * w32fns.c <w32_unicode_gui>: New static variable.
5796 (globals_of_w32fns): Initialize it according to os_subtype.
5797 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5798 testing os_subtype.
5799
5800 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5801 Eli Zaretskii <eliz@gnu.org>
5802
5803 Fix bug #10299 with Unicode characters sent by customized
5804 keyboards created by MSKLC.
5805 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5806 (w32_init_class): Use it to initialize the Emacs class with either
5807 ANSI or Unicode API calls.
5808 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5809 later.
5810 (w32_wnd_proc): If the character code sent by WM_CHAR or
5811 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5812 original message. Call DefWindowProcW on NT and later.
5813
5814 2012-08-10 Glenn Morris <rgm@gnu.org>
5815
5816 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5817
5818 * lisp.h (DIRECTORY_SEP): Let configure set it.
5819
5820 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5821
5822 Use TSET for write access to Lisp_Object slots of struct terminal.
5823 * termhooks.h (TSET): New macro.
5824 * coding.c, terminal.c, xselect.c: Adjust users.
5825
5826 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5827
5828 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5829 the failing expression, include them in the error message.
5830 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5831 * lisp.h (internal_condition_case_n): Update declaration.
5832
5833 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5834
5835 Inline functions to examine and change buffer overlays.
5836 * buffer.c (unchain_both): New function.
5837 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5838 (buffer_has_overlays): New function.
5839 (enum overlay_type): New enum.
5840 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5841 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5842
5843 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5844
5845 Inline functions to examine and change buffer intervals.
5846 * alloc.c (mark_interval_tree): Remove.
5847 (MARK_INTERVAL_TREE): Simplify.
5848 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5849 * intervals.c (buffer_balance_intervals): New function.
5850 (graft_intervals_into_buffer): Adjust indentation.
5851 (set_intervals_multibyte): Simplify.
5852 * buffer.h (BUF_INTERVALS): Remove.
5853 (buffer_get_intervals, buffer_set_intervals): New function.
5854 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5855 * intervals.c, textprop.c: Adjust users.
5856
5857 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5858
5859 Inline functions to examine and change string intervals.
5860 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5861 (string_get_intervals, string_set_intervals): New function.
5862 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5863 * lread.c, print.c, textprop.c: Adjust users.
5864
5865 2012-08-08 Glenn Morris <rgm@gnu.org>
5866
5867 * lisp.mk (lisp): Remove language/persian.elc.
5868
5869 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5870
5871 Cleanup intervals.
5872 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5873 (NULL_INTERVAL_P): Likewise. Adjust users.
5874 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5875 Adjust comment. Move under #if 0.
5876 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5877 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5878
5879 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5880
5881 Check total length of intervals with eassert.
5882 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5883 * intervals.c: Change all users to eassert.
5884
5885 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5886
5887 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5888 Rename fields to match removal of FGET and WGET and disuse of
5889 INTERNAL_FIELD in Lisp_Cons.
5890
5891 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5892
5893 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5894 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5895 name since all xname users are fixed long time ago. Do not
5896 use INTERNAL_FIELD.
5897 (set_symbol_name, set_symbol_function, set_symbol_plist):
5898 (set_symbol_next, set_overlay_plist): New function.
5899 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5900 (struct Lisp_Overlay): Likewise.
5901 (CVAR, MVAR, SVAR): Remove.
5902 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5903 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5904 * xterm.c: Adjust users.
5905 * .gdbinit: Change to use name field of struct Lisp_Symbol
5906 where appropriate.
5907
5908 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5909
5910 Basic functions to set Lisp_Object and pointer slots of intervals.
5911 * intervals.h (interval_set_parent, interval_set_object):
5912 (interval_set_left, interval_set_right, interval_set_plist):
5913 (interval_copy_parent): New function.
5914 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5915 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5916 Adjust indentation.
5917 (INTERVAL_SIZE): Remove. Adjust users.
5918 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5919
5920 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5921
5922 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5923 * process.h (PGET): Remove.
5924 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5925 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5926
5927 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5928
5929 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5930 * window.h (WGET): Remove.
5931 (struct window): Do not use INTERNAL_FIELD.
5932 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5933 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5934 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5935 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5936 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5937 Adjust users.
5938
5939 2012-08-07 Chong Yidong <cyd@gnu.org>
5940
5941 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5942 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5943 (Fdelete_window_internal): Signal an error if the window is not on
5944 a live frame (Bug#12025).
5945
5946 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5947
5948 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5949 * frame.h (FGET): Remove.
5950 (struct frame): Do not use INTERNAL_FIELD.
5951 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5952 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5953 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5954 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5955
5956 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5957
5958 * w32.c: Silence compiler warnings.
5959 (map_w32_filename): Remove unused variable `is_fat'.
5960 (chase_symlinks): Add parentheses around expression.
5961
5962 2012-08-06 Glenn Morris <rgm@gnu.org>
5963
5964 * sysdep.c: Respect BROKEN_GETWD.
5965
5966 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5967 Let configure handle it.
5968 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5969
5970 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5971
5972 Use GCALIGNMENT where appropriate.
5973 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5974 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5975 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5976
5977 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5978
5979 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5980 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5981
5982 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5983
5984 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5985 that should be sufficient for everyone.
5986
5987 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5988
5989 * keyboard.c (timer_check_2): Add break so timer_check returns next
5990 timeout.
5991
5992 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5993
5994 Fix Windows build errors introduced after converting to WGET and WSET.
5995 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5996 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5997
5998 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5999
6000 * nsterm.m (ns_frame_rehighlight): Use FSET.
6001
6002 * nsmenu.m (ns_update_menubar): Use FSET.
6003
6004 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6005
6006 Separate read and write access to Lisp_Object slots of Lisp_Process.
6007 * process.h (PGET, PSET): New macros similar to AREF and ASET.
6008 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6009
6010 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6011
6012 Separate read and write access to Lisp_Object slots of struct window.
6013 * window.h (WGET, WSET): New macros similar to AREF and ASET.
6014 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6015 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6016 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6017 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6018 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6019 Adjust users.
6020
6021 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6022
6023 Fix Windows build errors introduced after converting to FGET and FSET.
6024 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
6025 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
6026 (w32_judge_scroll_bars): Change to use FSET.
6027 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6028
6029 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6030
6031 Fix replacement typo.
6032 * window.c (replace_window): Set root_window instead of
6033 selected_window. This fixes a total window subsystem
6034 malfunction reported by Bastien Guerry <bzg@gnu.org>.
6035
6036 2012-08-06 Glenn Morris <rgm@gnu.org>
6037
6038 * lisp.mk (lisp): Add language/persian.elc.
6039
6040 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6041
6042 Separate read and write access to Lisp_Object slots of struct frame.
6043 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
6044 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6045 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6046 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6047 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6048
6049 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
6050
6051 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
6052
6053 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
6054
6055 Generalize common compile-time constants.
6056 * lisp.h (header_size, bool_header_size, word_size): Now here.
6057 (struct Lisp_Vector): Add comment.
6058 (struct Lisp_Bool_Vector): Move up to define handy constants.
6059 (VECSIZE, PSEUDOVECSIZE): Simplify.
6060 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
6061 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
6062 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
6063 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
6064 * xfont.c, xmenu.c: Use word_size where appropriate.
6065
6066 2012-08-05 Lawrence Mitchell <wence@gmx.li>
6067
6068 * search.c (Freplace_match): Treat \? in the replacement text
6069 literally (Bug#8161).
6070
6071 2012-08-05 Chong Yidong <cyd@gnu.org>
6072
6073 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
6074 * frame.c (Vdelete_frame_functions):
6075 * emacs.c (Vkill_emacs_hook): Doc fix.
6076
6077 2012-08-04 Eli Zaretskii <eliz@gnu.org>
6078
6079 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
6080 --with-x-toolkit=no builds.
6081 Reported by Carsten Mattner <carstenmattner@gmail.com>.
6082
6083 2012-08-04 Chong Yidong <cyd@gnu.org>
6084
6085 * syntax.c (Fmodify_syntax_entry): Doc fix.
6086
6087 2012-08-04 Eli Zaretskii <eliz@gnu.org>
6088
6089 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
6090 * w32.c (init_environment): Change the default values of many
6091 environment variables in dflt_envvars[] to NULL, to avoid pushing
6092 them into environment when they were not already defined.
6093 Remove the code that deletes site-lisp subdirectories from the default
6094 value of EMACSLOADPATH, as it is no longer needed.
6095 (check_windows_init_file): Now external, not static.
6096 Use Vload_path as is, without adding anything, as this function is now
6097 called when Vload_path is already set up.
6098
6099 * w32.h (check_windows_init_file): Add prototype.
6100
6101 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
6102 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
6103 compatibility with Posix platforms.
6104 (main): Move the call to check_windows_init_file to here from
6105 w32.c.
6106 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
6107 any, in the DEFALT argument into the root of the Emacs build or
6108 installation tree, as appropriate.
6109
6110 * callproc.c (init_callproc_1): Call decode_env_path instead of
6111 doing its equivalent by hand.
6112 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
6113 the code that sets Vexec_path run on MS-Windows.
6114
6115 * lread.c (init_lread): Add comments to #ifdef's.
6116
6117 * msdos.c (dos_set_window_size, IT_update_begin)
6118 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
6119 instead of direct references.
6120
6121 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
6122
6123 Export DEFAULT_REHASH_* to GDB.
6124 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
6125 Now constants, not macros.
6126
6127 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
6128
6129 Remove unnecessary casts involving pointers.
6130 These casts are no longer needed now that we assume C89 or later,
6131 since they involve casting to or from void *.
6132 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
6133 (make_pure_float, make_pure_vector):
6134 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
6135 * macros.c (Fstart_kbd_macro):
6136 * menu.c (find_and_return_menu_selection):
6137 * minibuf.c (read_minibuf_noninteractive):
6138 * sysdep.c (closedir):
6139 * xdisp.c (x_produce_glyphs):
6140 * xfaces.c (compare_fonts_by_sort_order):
6141 * xfns.c (x_real_positions, select_visual):
6142 * xselect.c (x_stop_queuing_selection_requests)
6143 (x_get_window_property, x_get_window_property_as_lisp_data):
6144 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
6145 Remove unnecessary pointer casts.
6146 * alloc.c (record_xmalloc): New function.
6147 * lisp.h (record_xmalloc): New decl.
6148 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
6149 more like a function. This is because the pointer cast is not
6150 needed. All uses changed.
6151 * print.c (print_string, print_error_message): Avoid length recalc.
6152
6153 Improve fix for macroexp crash with debugging (Bug#12118).
6154 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
6155 ARRAY_MARK_FLAG when checking subscripts, because ASET is
6156 not supposed to be invoked from the garbage collector.
6157 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
6158 (gc_aset): New function, which is like ASET but can be
6159 used in the garbage collector.
6160 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6161 (set_hash_index): Use it instead of ASET.
6162
6163 2012-08-03 Eli Zaretskii <eliz@gnu.org>
6164
6165 Support symlinks on latest versions of MS-Windows.
6166 * w32.c: Include winioctl.h and aclapi.h.
6167 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
6168 (revert_to_self): Forward declarations of static functions.
6169 <static BOOL g_b_init_get_security_info>:
6170 <g_b_init_create_symbolic_link>: New static flags.
6171 (globals_of_w32): Initialize them to zero.
6172 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
6173 (map_w32_filename): Improve commentary. Simplify switch.
6174 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
6175 headers (most versions of MinGW w32api don't).
6176 (get_security_info, create_symbolic_link)
6177 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
6178 New functions.
6179 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
6180 in the argument file name.
6181 (sys_access): Call unc_volume_file_attributes only if
6182 GetFileAttributes fails with network-related error codes.
6183 (sys_rename): Diagnose renaming of a symlink when the user doesn't
6184 have the required privileges.
6185 (get_file_security_desc_by_name): Rename from
6186 get_file_security_desc.
6187 (stat_worker): New function, with most of the guts of 'stat', and
6188 with addition of handling of symlinks and support for 'lstat'.
6189 If possible, get file's attributes and security information by
6190 handle, not by name. Produce S_IFLNK bit for symlinks, when
6191 called from 'lstat'.
6192 (stat, lstat): New functions, call 'stat_worker'.
6193 (symlink, readlink, careadlinkat): Rewritten to create and resolve
6194 symlinks when the underlying filesystem supports them.
6195
6196 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6197
6198 Fix macroexp crash on Windows with debugging (Bug#12118).
6199 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
6200 checking subscripts; problem introduced with the recent
6201 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
6202 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
6203 since it's used in non-static inline functions now.
6204
6205 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
6206 Don't assume buffer size fits in 'int'. Remove unused local.
6207
6208 Use C99-style 'extern inline' if available.
6209 * buffer.h (BUFFER_INLINE):
6210 * category.h (CATEGORY_INLINE):
6211 * character.h (CHARACTER_INLINE):
6212 * charset.h (CHARSET_INLINE):
6213 * composite.h (COMPOSITE_INLINE):
6214 * dispextern.h (DISPEXTERN_INLINE):
6215 * lisp.h (LISP_INLINE):
6216 * systime.h (SYSTIME_INLINE):
6217 New macro, replacing 'static inline' in this header.
6218 * buffer.h, category.h, character.h, charset.h, composite.h:
6219 * dispextern.h, lisp.h, systime.h:
6220 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6221 * alloc.c (LISP_INLINE):
6222 * buffer.c (BUFFER_INLINE):
6223 * category.c (CATEGORY_INLINE):
6224 * character.c (CHARACTER_INLINE):
6225 * charset.c (CHARSET_INLINE):
6226 * composite.c (COMPOSITE_INLINE):
6227 * dispnew.c (DISPEXTERN_INLINE):
6228 * sysdep.c (SYSTIME_INLINE):
6229 Define to EXTERN_INLINE, so that the corresponding functions
6230 are compiled into code.
6231 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
6232 (INLINE_HEADER_END): New macros.
6233 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
6234 since it's used in non-static inline functions now.
6235 (VALMASK) [!USE_LSB_TAG]: Likewise.
6236
6237 2012-08-02 Glenn Morris <rgm@gnu.org>
6238
6239 * s/: Remove empty directory.
6240
6241 * s/ms-w32.h: Move to ../nt/inc.
6242 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
6243 Update for new ms-w32.h location.
6244
6245 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6246
6247 Port to Solaris 8.
6248 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
6249
6250 2012-08-02 Glenn Morris <rgm@gnu.org>
6251
6252 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
6253 hard-coding the path separator.
6254
6255 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6256
6257 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
6258 This how ASET and AREF are supposed to work, and makes
6259 it easier to think about future improvements. See
6260 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
6261 * charset.h (set_charset_attr): New function.
6262 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
6263 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
6264 (aref_addr): New function. All uses of &AREF(...) changed.
6265 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6266 (set_hash_index): New functions. All lvalue-style uses of
6267 HASH_KEY etc. changed.
6268 * keyboard.c (set_prop): New function. All lvalue-style uses
6269 of PROP changed.
6270
6271 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
6272
6273 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
6274 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
6275 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
6276 * nsfns.m (ns_set_name_as_filename): Likewise.
6277 * nsmenu.m (ns_update_menubar): Likewise.
6278 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
6279
6280 2012-08-01 Eli Zaretskii <eliz@gnu.org>
6281
6282 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
6283 Adapt to latest changes in field names of the corresponding Lisp
6284 objects.
6285
6286 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
6287
6288 2012-08-01 Glenn Morris <rgm@gnu.org>
6289
6290 * s/msdos.h: Remove file.
6291 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
6292 * Makefile.in (S_FILE): Remove.
6293 (config_h): Remove S_FILE.
6294
6295 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
6296
6297 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
6298 Remove; moved to nt/config.nt.
6299
6300 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6301
6302 Use INTERNAL_FIELD for conses and overlays.
6303 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
6304 Remove obsolete comment.
6305 (MVAR): New macro.
6306 (struct Lisp_Overlay): Use INTERNAL_FIELD.
6307 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
6308
6309 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6310
6311 Use INTERNAL_FIELD for symbols.
6312 * lisp.h (SVAR): New macro. Adjust users.
6313 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
6314 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
6315
6316 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6317
6318 Use INTERNAL_FIELD for processes.
6319 * process.h (PVAR): New macro. Adjust style.
6320 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
6321 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
6322
6323 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6324
6325 Use INTERNAL_FIELD for windows.
6326 * window.h (WVAR): New macro.
6327 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
6328 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6329 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6330 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
6331 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
6332 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6333
6334 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6335
6336 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
6337
6338 2012-08-01 Glenn Morris <rgm@gnu.org>
6339
6340 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
6341 Move to configure.ac.
6342
6343 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
6344
6345 * makefile.w32-in (CONFIG_H): Update dependencies.
6346 (CONF_POST_H): New macro.
6347
6348 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
6349
6350 2012-07-31 Glenn Morris <rgm@gnu.org>
6351
6352 * Makefile.in (S_FILE): No longer set by configure.
6353
6354 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
6355 is available.
6356 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
6357
6358 * process.h (NULL_DEVICE):
6359 * emacs.c (SEPCHAR):
6360 * editfns.c (USER_FULL_NAME): Let configure set them.
6361
6362 * s/README, s/template.h: Remove files.
6363
6364 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
6365
6366 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
6367 Move to configure.ac.
6368
6369 2012-07-31 Eli Zaretskii <eliz@gnu.org>
6370
6371 * .gdbinit (xframe): Adapt to introduction of FVAR and the
6372 resulting renaming of 'struct frame' members.
6373
6374 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
6375
6376 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
6377 after introduction of FVAR.
6378
6379 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6380
6381 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
6382
6383 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
6384 instead of compositeToPoint.
6385 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
6386
6387 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
6388
6389 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6390
6391 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6392 * lisp.h (INTERNAL_FIELD): New macro.
6393 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
6394 (BVAR): Change to use INTERNAL_FIELD.
6395 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6396 (KVAR): Change to use INTERNAL_FIELD.
6397 * frame.h (FVAR): New macro.
6398 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
6399 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6400 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6401 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6402 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6403
6404 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6405
6406 Miscellaneous fixes for non-default X toolkits.
6407 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6408 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6409 Move under #ifdef USE_LUCID.
6410 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6411 definition and usage to avoid warnings.
6412
6413 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6414
6415 * nsterm.m (openFiles): Fix previous checkin.
6416
6417 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6418
6419 * indent.c (compute_motion): Remove unused local.
6420
6421 2012-07-31 Glenn Morris <rgm@gnu.org>
6422
6423 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6424
6425 * conf_post.h [USG5_4]:
6426 Move remaining contents of s/usg5-4-common.h here.
6427 * s/usg5-4-common.h: Remove file.
6428
6429 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6430 * s/irix6-5.h: Remove file.
6431
6432 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6433 * s/darwin.h: Remove file.
6434
6435 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6436 * s/hpux10-20.h: Remove file, which is now empty.
6437
6438 2012-07-30 Glenn Morris <rgm@gnu.org>
6439
6440 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6441 * Makefile.in (config_h): Add conf_post.h.
6442 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6443
6444 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6445
6446 * nsterm.m (ns_do_open_file): New variable.
6447 (ns_term_init): Set ns_do_open_file to YES after run returns.
6448 (openFile, openTempFile, openFileWithoutUI, openFiles):
6449 Open files only if ns_do_open_file.
6450
6451 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6452
6453 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6454 This no-op macro hasn't been needed for many years.
6455 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6456
6457 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6458 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6459 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6460 gdb_make_enums_visible.
6461 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6462 (DIRECTORY_SEP): Now a constant, not a macro.
6463
6464 2012-07-30 Eli Zaretskii <eliz@gnu.org>
6465
6466 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6467 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6468
6469 * w32term.c <w32_keyboard_codepage>: Renamed from
6470 keyboard_codepage and now external. All users changed.
6471
6472 * w32term.h: Add declaration of w32_keyboard_codepage.
6473
6474 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6475 the codepage to translate keys to Unicode. If this argument is
6476 -1, use the value returned by GetConsoleCP. All callers changed.
6477
6478 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6479
6480 Update .PHONY listings in makefiles.
6481 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6482 bootstrap-clean, distclean, maintainer-clean, versioclean,
6483 extraclean, frc.
6484
6485 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6486 This is a bit clearer. Fix some commentary typos.
6487
6488 2012-07-30 Glenn Morris <rgm@gnu.org>
6489
6490 * s/netbsd.h: Let configure include signal.h if needed.
6491 Remove file, which is now empty.
6492
6493 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6494 Let configure set them.
6495 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6496 No more need to undefine.
6497
6498 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6499
6500 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6501 non-single-byte char when adding meta modifier. (Bug#12090)
6502
6503 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6504
6505 Convert safe_call to use variable number of arguments.
6506 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6507 (safe_call2): Fix comment.
6508 * lisp.h (safe_call): Adjust prototype.
6509 * coding.c (encode_coding_object): Change to use safe_call2.
6510 * xfaces.c (merge_face_heights): Change to use safe_call1.
6511
6512 2012-07-30 Glenn Morris <rgm@gnu.org>
6513
6514 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
6515 does that unconditionally. Remove file, which is now empty.
6516
6517 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6518 Remove empty files.
6519
6520 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6521
6522 Export to GDB most of lisp.h's remaining object-like macros.
6523 * lisp.h (min, max): Move earlier, because they're used earlier now.
6524 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6525 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6526 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6527 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6528 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6529 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6530 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6531 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6532 Now constants, for GDB. They need not be macros.
6533 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6534 Now constants, for GDB, as well as macros, for static initializers.
6535 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6536 Move to after the definition of struct Lisp_Char_Table,
6537 since the former now needs that type defined.
6538 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6539 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6540 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6541 New enums, for gdb_make_enums_visible.
6542 (GLYPH_MODE_LINE_FACE): Remove; unused.
6543 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
6544 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6545 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6546 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6547 enum maxargs, enum MAX_ALLOCA.
6548 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6549 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6550 no longer needed, now that they are done in lisp.h.
6551
6552 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6553
6554 Cleanup string bytes checking.
6555 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6556 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6557 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6558 (check_sblock, compact_small_strings): Simplify.
6559
6560 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6561
6562 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6563 These macros are confusing and no longer need to be defined, as
6564 the enum values now suffice. All uses replaced with definiens.
6565 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6566
6567 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
6568
6569 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6570 ($(BLD)/w32console.$(O)): Update dependencies.
6571
6572 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6573
6574 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6575 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6576 time. Adjust users.
6577 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6578
6579 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6580
6581 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6582 setting sitelisp (Bug#12010).
6583
6584 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6585
6586 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
6587
6588 * w32heap.c (cache_system_info):
6589 * w32.c (sys_rename):
6590 * w32proc.c (find_child_console, sys_kill): All users changed.
6591
6592 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6593
6594 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6595
6596 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6597
6598 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6599
6600 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6601
6602 Cleanup statistics calculation in Fgarbage_collect.
6603 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6604 Fix zombies percentage calculation. Simplify elapsed time calculation.
6605
6606 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6607
6608 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6609 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6610 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6611 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6612 (replace_range, replace_range_2, del_range_2): Change to eassert.
6613 * marker.c (byte_char_debug_check): Adjust style.
6614
6615 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6616
6617 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6618 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6619 long-ago-commented-out code that talks about "WIN32".
6620 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6621 All uses changed.
6622
6623 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6624
6625 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6626 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6627 Simplify by using alignof.
6628 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6629 * lisp.h: Include <stdalign.h>.
6630 (GCALIGNMENT): New macro and constant.
6631 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6632 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6633 (stdalign): New macro, if not already defined.
6634
6635 2012-07-28 Eli Zaretskii <eliz@gnu.org>
6636
6637 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6638 * w32inevt.c: Include w32inevt.h.
6639 (w32_read_console_input): New inline function, calls either
6640 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6641 w32_console_unicode_input.
6642 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6643 (w32_kbd_patch_key, key_event): Use the codepage returned by
6644 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6645 (key_event): use uChar.UnicodeChar only if
6646 w32_console_unicode_input is non-zero.
6647
6648 * w32console.c: Include w32heap.h.
6649 <w32_console_unicode_input>: New global variable.
6650 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6651 family of Windows, zero otherwise.
6652
6653 * w32inevt.h: Declare w32_console_unicode_input.
6654
6655 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6656 --without-x. (Bug#11742)
6657
6658 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6659
6660 Adjust GDB to reflect pvec_type changes (Bug#12036).
6661 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6662 2012-07-04 changes to pseudovector representation.
6663 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6664
6665 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
6666
6667 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6668 bus address.
6669 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6670
6671 2012-07-27 Eli Zaretskii <eliz@gnu.org>
6672
6673 * alloc.c (listn): Fix the order the arguments are consed onto the
6674 list.
6675
6676 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6677 enumeration constants, as PURE and HEAP are too general, and clash
6678 with other headers and sources, such as gmalloc.c and the
6679 MS-Windows system headers. All users changed.
6680
6681 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6682
6683 Revert last save_excursion_save and save_excursion_restore changes.
6684 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6685 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6686
6687 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6688
6689 Fix recently-introduced typos in Windows port.
6690 Reported by Martin Rudalics <rudalics@gmx.at>.
6691 * w32.c (init_environment): Replace comma with semicolon.
6692 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6693
6694 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6695
6696 Improve GDB symbol export (Bug#12036).
6697 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6698 arms of an 'if', not using conditional expressions; otherwise GDB
6699 complains about the types in the unevaluated arm when the argument
6700 is an integer literal.
6701 (xgetint): Simplify expression.
6702 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6703 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6704 Zaretskii in <http://bugs.gnu.org/12036#13>.
6705 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6706 needed now that we have gdb_make_enums_visible.
6707 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6708 (enum enum_USE_LSB_TAG):
6709 New enum types, packaging up enums that need to be exported to GDB.
6710
6711 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6712
6713 Utility function to make a list from specified amount of objects.
6714 * lisp.h (enum constype): New datatype.
6715 (listn): New prototype.
6716 * alloc.c (listn): New function.
6717 (Fmemory_use_count, syms_of_alloc): Use it.
6718 * buffer.c (syms_of_buffer): Likewise.
6719 * callint.c (syms_of_callint): Likewise.
6720 * charset.c (define_charset_internal): Likewise.
6721 * coding.c (syms_of_coding): Likewise.
6722 * keymap.c (syms_of_keymap): Likewise.
6723 * search.c (syms_of_search): Likewise.
6724 * syntax.c (syms_of_syntax): Likewise.
6725 * w32.c (init_environment): Likewise.
6726 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6727 * xdisp.c (syms_of_xdisp): Likewise.
6728 * xfns.c (syms_of_xfns): Likewise.
6729
6730 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6731
6732 Fast save_excursion_save and save_excursion_restore.
6733 * lisp.h (struct Lisp_Excursion): New data type.
6734 (PVEC_EXCURSION): New pseudovector type.
6735 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6736 to deal with it. Adjust comments.
6737 (init_marker, attach_marker): New prototype.
6738 (unchain_marker): Adjust prototype.
6739 * marker.c (attach_marker): Change to global.
6740 (init_marker): New function.
6741 * alloc.c (Fmake_marker, build_marker): Use it.
6742 (build_marker): More easserts.
6743 (mark_object): Handle struct Lisp_Excursion.
6744 * editfns.c (save_excursion_save, save_excursion_restore):
6745 Reimplement to use struct Lisp_Excursion. Add comments.
6746
6747 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6748
6749 Fix export of symbols to GDB (Bug#12036).
6750 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6751 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6752 emacs.c, as this is a more-suitable home. Had this been done earlier
6753 the fix for 12036 would have avoided some of the problems noted in
6754 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6755 would have been more obvious.
6756 * emacs.c: Do not include <verify.h>; no longer needed.
6757 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6758 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6759 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6760 Remove; now done in lisp.h.
6761 * lisp.h (PUBLISH_TO_GDB): New macro.
6762 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6763 (DATA_SEG_BITS): Use it.
6764 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6765 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6766 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6767 not be usable in #if. This simplifies things.
6768
6769 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6770
6771 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6772
6773 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6774
6775 Simplify export of symbols to GDB (Bug#12036).
6776 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6777 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6778 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6779 Adjust to changes in lisp.h and emacs.c, by using
6780 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6781 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6782 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6783 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6784 instead of gdb_valbits.
6785 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6786 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6787 instead of gdb_array_mark_flag.
6788 (xboolvector): Get size from $->size, not $->header.size.
6789 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6790 (xreload, hook-run, hookpost-run): Remove.
6791 * emacs.c: Include <verify.h>.
6792 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6793 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6794 Remove.
6795 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6796 (gdb_USE_LSB_TAG): New enum constants.
6797 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6798 Also define these as enum constants, so they're visible to GDB.
6799 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6800 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6801 as constants, so they're visible to GDB.
6802 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6803 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6804 Now enum constants, not macros, so they're visible to GDB.
6805 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6806 more convenient now. All uses changed.
6807 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6808 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6809
6810 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6811
6812 Explicitly free restriction data that are not needed anymore.
6813 * editfns.c (save_restriction_restore): Free restriction data.
6814
6815 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6816
6817 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6818 add argument, tune behavior, and adjust all callers.
6819
6820 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6821
6822 Use typedef for EMACS_INT, EMACS_UINT.
6823 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6824 than macros. This simplifies debugging in the usual case, since
6825 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6826 and it allows expressions involving EMACS_INT casts.
6827 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6828
6829 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6830
6831 * nsterm.m (ns_read_socket): Return early if there is a modal
6832 window (Bug#12043).
6833
6834 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6835
6836 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6837 that FOCUS-FRAME can be omitted.
6838
6839 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6840
6841 Adjust buffer text indirection counters at the end of Fkill_buffer.
6842 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6843 buffer is definitely dead. This should really fix an issue reported
6844 by Christoph Scholtes again. (Bug#12007).
6845 (init_buffer_once): Initialize indirection counters of
6846 buffer_defaults and buffer_local_symbols (for sanity and safety).
6847
6848 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6849
6850 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6851 and continuation glyphs on tooltip frames, leave them at zero.
6852 Avoids continued lines in tooltips. (Bug#11832)
6853
6854 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6855
6856 Simplify copy_overlay.
6857 * buffer.c (copy_overlay): Simplify. Use build_marker.
6858 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6859
6860 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6861
6862 * print.c (print_object): Don't crash when a frame's name is nil
6863 or invalid. (Bug#12025)
6864
6865 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6866 it signals an error when a tooltip frame is being created.
6867
6868 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6869
6870 Cleanup miscellaneous objects allocation and initialization.
6871 * alloc.c (allocate_misc): Change to static. Add argument to
6872 specify the subtype. Adjust comment and users.
6873 (build_overlay): New function.
6874 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6875 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6876 (allocate_misc): Remove prototype.
6877 (build_overlay): Add prototype.
6878
6879 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6880
6881 Swap buffer text indirection counters in Fbuffer_swap_text.
6882 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6883 This avoids crash reported by Christoph Scholtes at
6884 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6885
6886 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6887
6888 * nsmenu.m (Popdown_data): New struct.
6889 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6890 free Popdown_data.
6891 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6892 (initWithContentRect): Make imgView and contentView non-static
6893 and autorelease them. Also autorelease img and matrix (Bug#12005).
6894 (dealloc): Remove (Bug#12005).
6895
6896 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6897
6898 Adjust consing_since_gc when objects are explicitly freed.
6899 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6900 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6901 (free_cons, free_misc): Subtract object size from consing_since_gc.
6902
6903 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6904
6905 Simplify and cleanup markers positioning code.
6906 * marker.c (attach_marker): More useful eassert.
6907 (live_buffer, set_marker_internal): New function.
6908 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6909 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6910
6911 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6912
6913 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6914 as it's limited by the amount of memory, not by INT_MAX.
6915
6916 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6917
6918 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6919 in special-event-map. See the discussion at
6920 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6921 for the reasons.
6922
6923 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6924 info.dwItemData. Fixes crashes on 64-bit Windows.
6925 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6926
6927 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6928
6929 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6930 (conversationIdentifier): Return value is NSInteger.
6931 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6932
6933 2012-07-21 Chong Yidong <cyd@gnu.org>
6934
6935 * window.c (decode_any_window): Signal an error if the window is
6936 on a dead frame (Bug#11984).
6937
6938 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6939
6940 Add indirection counting to speed up Fkill_buffer.
6941 * buffer.h (struct buffer): New member.
6942 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6943 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6944 base buffer indirection counter.
6945 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6946 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6947 through buffer list if indirection counter is 0.
6948
6949 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6950
6951 Extend the value returned by Fgarbage_collect with heap statistics.
6952 * alloc.c (Qheap): New symbol.
6953 (syms_of_alloc): DEFSYM it.
6954 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6955 (Fmemory_free): Remove.
6956 (syms_of_alloc): Don't defsubr it.
6957 * buffer.c (Fcompact_buffer): Remove.
6958 (syms_of_buffer): Don't defsubr it.
6959
6960 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6961
6962 Make maybe_gc inline.
6963 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6964 * lisp.h (consing_since_gc, gc_relative_threshold)
6965 (memory_full_cons_threshold): Revert declaration.
6966 (maybe_gc): Remove prototype, define as inline.
6967 * alloc.c: Remove old commented-out code.
6968 (consing_since_gc, gc_relative_threshold)
6969 (memory_full_cons_threshold): Revert to global.
6970 (maybe_gc): Remove.
6971
6972 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6973
6974 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6975 * lisp.h (build_unibyte_string): New function.
6976 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6977 * sysdep.c, w32fns.c, xfns.c: Use it.
6978 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6979 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6980 Adjust users accordingly.
6981 * font.h (font_open_by_name): Adjust prototype.
6982
6983 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6984
6985 Cleanup calls to Fgarbage_collect.
6986 * lisp.h (maybe_gc): New prototype.
6987 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6988 Remove declarations.
6989 * alloc.c (maybe_gc): New function.
6990 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6991 Make them static.
6992 * bytecode.c (MAYBE_GC): Use maybe_gc.
6993 * eval.c (eval_sub, Ffuncall): Likewise.
6994 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6995 to avoid dependency from auto-save feature.
6996
6997 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6998
6999 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
7000 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
7001 'for_each_per_buffer_object_at'.
7002 All uses changed. It's better to use upper-case for macros that
7003 cannot be implemented as functions, to give the reader a clue
7004 that they're special.
7005
7006 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
7007
7008 * alloc.c (Fgarbage_collect): Tweak docstring.
7009
7010 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7011
7012 Tweak the value returned from Fgarbage_collect again.
7013 * alloc.c (Fgarbage_collect): New return value, as confirmed in
7014 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
7015 Adjust documentation.
7016 (total_vector_bytes): Rename to total_vector_slots, adjust
7017 accounting.
7018 (total_free_vector_bytes): Rename to total_free_vector_slots,
7019 adjust accounting.
7020 (Qstring_bytes, Qvector_slots): New symbols.
7021 (syms_of_alloc): DEFSYM them.
7022
7023 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7024
7025 Buffer compaction primitive which may be used from Lisp.
7026 * buffer.c (compact_buffer, Fcompact_buffer): New function.
7027 (syms_of_buffer): Register Fcompact_buffer.
7028 * alloc.c (Fgarbage_collect): Use compact_buffer.
7029 * buffer.h (compact_buffer): New prototype.
7030 (struct buffer_text): New member.
7031
7032 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7033
7034 New macro to iterate over all buffers, miscellaneous cleanups.
7035 * lisp.h (all_buffers): Remove declaration.
7036 * buffer.h (all_buffers): Add declaration, with comment.
7037 (for_each_buffer): New macro.
7038 * alloc.c (Fgarbage_collect, mark_object): Use it.
7039 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
7040 (init_buffer): Likewise.
7041 * data.c (Fset_default): Likewise.
7042 * coding.c (code_conversion_restore): Remove redundant check
7043 for dead buffer.
7044 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
7045
7046 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7047
7048 Fix bug that created negative-length intervals.
7049 * intervals.c (merge_interval_right, merge_interval_left):
7050 Do not zero out this interval if it is absorbed by its children,
7051 as this interval's total length doesn't change in that case. See
7052 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
7053
7054 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
7055
7056 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
7057 when invoking (make-bool-vector N t) and N is a positive
7058 multiple of 8 -- the last 8 bits were mistakenly cleared.
7059
7060 Remove some struct layout assumptions in bool vectors.
7061 * alloc.c (bool_header_size): New constant.
7062 (header_size, word_size): Move earlier, as they're now used earlier.
7063 Use 'word_size' in a few more places, where it's appropriate.
7064 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
7065 padding before the data member of a bool vector.
7066 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
7067 than doing the check by hand with an abort ().
7068
7069 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7070
7071 * eval.c (Fdefvar): Don't check constants since we only set the var if
7072 it's not yet defined anyway (bug#11904).
7073
7074 * lisp.h (last_undo_boundary): Declare new var.
7075 * keyboard.c (command_loop_1): Set it.
7076 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
7077 were auto-added by the command loop (bug#11774).
7078
7079 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7080
7081 * w32font.c (Qsymbol): Remove local definition.
7082 (syms_of_w32font): Don't DEFSYM it.
7083
7084 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7085
7086 Fix sweep_vectors to handle large bool vectors correctly.
7087 * alloc.c (sweep_vectors): Account total_vector_bytes for
7088 bool vectors larger than VBLOCK_BYTES_MAX.
7089
7090 2012-07-18 Chong Yidong <cyd@gnu.org>
7091
7092 * frame.c (x_set_frame_parameters): Revert bogus change introduced
7093 in 2012-05-25 commit by Paul Eggert (Bug#11738).
7094
7095 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7096
7097 Return more descriptive data from Fgarbage_collect.
7098 Suggested by Stefan Monnier in
7099 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
7100 * alloc.c (bounded_number): New function.
7101 (total_buffers, total_vectors): New variable.
7102 (total_string_size): Rename to total_string_bytes, adjust users.
7103 (total_vector_size): Rename to total_vector_bytes, adjust users.
7104 (sweep_vectors): Account total_vectors and total_vector_bytes.
7105 (Fgarbage_collect): New return value. Adjust documentation.
7106 (gc_sweep): Account total_buffers.
7107 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
7108 (VECTOR_SIZE): Remove.
7109 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
7110 (Qinterval, Qmisc): New symbols.
7111 (syms_of_data): Initialize them.
7112 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
7113 (Qcons, Qbuffer): New declarations.
7114
7115 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7116
7117 * alloc.c (Fmemory_free): Account for memory-free's own storage.
7118 Round up, not down. Improve doc.
7119
7120 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7121
7122 Restore old code in allocate_string_data to avoid Faset breakage.
7123 Reported by Julien Danjou <julien@danjou.info> in
7124 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
7125 * alloc.c (allocate_string_data): Restore old code with minor
7126 adjustments, fix comment to explain this subtle issue.
7127
7128 2012-07-17 Eli Zaretskii <eliz@gnu.org>
7129
7130 Remove FILE_SYSTEM_CASE.
7131 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
7132
7133 * fileio.c (FILE_SYSTEM_CASE): Don't define.
7134 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
7135 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
7136 call-process-region passes it through expand-file-name.
7137
7138 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
7139
7140 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7141
7142 Fix crash when creating indirect buffer (Bug#11917)
7143 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
7144 Don't handle unbound variables specially if non-zero.
7145 (Fbuffer_local_variables): Pass zero.
7146 (clone_per_buffer_values): Pass non-zero.
7147
7148 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7149
7150 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
7151 to make the loop interruptible.
7152
7153 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7154
7155 * gnutls.c (emacs_gnutls_handshake): Only retry if
7156 GNUTLS_E_INTERRUPTED.
7157
7158 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7159
7160 Cleanup and convert miscellaneous checks to eassert.
7161 * alloc.c (mark_interval): Fix comment, partially rephrase
7162 old comment from intervals.h (see below).
7163 * intervals.c (find_interval, adjust_intervals_for_insertion)
7164 (delete_interval, adjust_intervals_for_deletion)
7165 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
7166 Convert to eassert.
7167 (adjust_intervals_for_insertion, make_new_interval):
7168 Remove obsolete and unused code.
7169 * intervals.h (struct interval): Remove obsolete comment.
7170 * textprotp.c (erase_properties): Remove unused code.
7171 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
7172 (Fremove_list_of_text_properties): Convert to eassert.
7173
7174 2012-07-17 Chong Yidong <cyd@gnu.org>
7175
7176 * editfns.c (Finsert_char): Doc fix.
7177
7178 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7179
7180 Fix previous change to make Fmemory_free always accurate.
7181 * alloc.c (make_interval): Update total_free_intervals.
7182 (make_float): Likewise for total_free_floats.
7183 (free_cons, Fcons): Likewise for total_free_conses.
7184 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
7185 Likewise for total_free_vector_bytes.
7186 (Fmake_symbol): Likewise for total_free_symbols.
7187 (bytes_free): Remove.
7188
7189 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7190
7191 Simple free memory accounting feature.
7192 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
7193 (sweep_vectors): Accumulate size of free vectors.
7194 (Fgarbage_collect): Setup bytes_free.
7195 (Fmemory_free): New function.
7196 (syms_of_alloc): Register it.
7197
7198 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7199
7200 Cleanup overlays checking.
7201 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
7202 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
7203 eassert and OVERLAYP.
7204 (sort_overlays): Change to use OVERLAYP.
7205
7206 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
7207
7208 * editfns.c (Finsert_char): Make it interactive, and make the
7209 second arg optional. Copy interactive spec and docstring from
7210 ucs-insert.
7211
7212 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7213
7214 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
7215 Unlike the other wrapped functions, fabs has an unspecified
7216 effect on errno.
7217
7218 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
7219
7220 * nsterm.m (keyDown): Interpret flags without left/right bits
7221 as the left key (Bug#11670).
7222
7223 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7224
7225 Remove empty and useless init functions.
7226 * lisp.h (init_character_once, init_fns, init_image)
7227 (init_filelock, init_sound): Remove prototype.
7228 * character.c (init_character_once): Remove.
7229 * filelock.c (init_filelock): Likewise.
7230 * fns.c (init_fns): Likewise.
7231 * image.c (init_image): Likewise.
7232 * sound.c (init_sound): Likewise.
7233 * emacs.c (main): Adjust accordingly.
7234
7235 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7236
7237 * gtkutil.h: Tiny cleanups.
7238 (use_old_gtk_file_dialog): Remove useless declaration.
7239 (xg_uses_old_file_dialog): Add suggested const attribute.
7240
7241 2012-07-15 Eli Zaretskii <eliz@gnu.org>
7242
7243 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
7244 (bidi_paragraph_init): Use it to limit search forward for a strong
7245 directional character in abnormally large paragraphs full of
7246 neutral or weak characters. (Bug#11943)
7247
7248 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
7249
7250 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
7251 the toolbar (Bug#9451).
7252 (xg_make_tool_item): Give the widget event box a transparent
7253 background.
7254
7255 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7256
7257 Cleanup basic allocation variables and functions.
7258 * alloc.c (ignore_warnings, init_intervals, init_float)
7259 (init_cons, init_symbol, init_marker): Remove.
7260 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
7261 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
7262 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
7263 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
7264 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
7265 (staticidx, init_alloc_once, init_strings, free_ablock):
7266 Remove redundant initialization.
7267 * fns.c (init_weak_hash_tables): Remove.
7268 * lisp.h (init_weak_hash_tables): Remove prototype.
7269
7270 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7271
7272 Use zero_vector where appropriate.
7273 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
7274 accordingly.
7275 * lisp.h (zero_vector): New declaration.
7276 * font.c (null_vector): Remove.
7277 (syms_of_font): Remove initialization and staticpro.
7278 (font_list_entities, font_find_for_lface): Change to use zero_vector.
7279 * keymap.c (Faccessible_keymaps): Likewise.
7280
7281 2012-07-15 Leo Liu <sdl.web@gmail.com>
7282
7283 * fringe.c: Fix typo in comments.
7284
7285 2012-07-14 Leo Liu <sdl.web@gmail.com>
7286
7287 * fringe.c: Add a new bitmap exclamation-mark.
7288
7289 2012-07-14 Eli Zaretskii <eliz@gnu.org>
7290
7291 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
7292
7293 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
7294 (HAVE_MENUS): Don't define, defined by editing config.in with
7295 msdos/sed2v2.inp.
7296 (GMALLOC_INHIBIT_VALLOC): Don't define.
7297 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
7298
7299 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
7300
7301 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
7302
7303 2012-07-14 Glenn Morris <rgm@gnu.org>
7304
7305 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
7306 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
7307 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
7308
7309 2012-07-13 Glenn Morris <rgm@gnu.org>
7310
7311 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
7312
7313 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
7314 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
7315
7316 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
7317
7318 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
7319 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
7320 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
7321 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
7322 where appropriate.
7323 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
7324 as boolean expression.
7325 (x_set_window_size): Remove unused variable toolbar.
7326 (ns_get_color_default, ns_mod_to_lisp): Remove.
7327 (ns_mouse_position): Remove unused variables xchar and ychar.
7328 (ns_compute_glyph_string_overhangs): Remove unused variable face.
7329 (ns_set_vertical_scroll_bar): Remove unused variable count.
7330 (ns_delete_terminal): Remove unused variable i.
7331 (ns_term_init): Remove unused variables r, g and b.
7332 (mouseDown): Remove unused variable window.
7333 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
7334 (initFrameFromEmacs): Remove unused variable vbextra.
7335 (mouseEntered): Remove unused variables p and dpyinfo.
7336 (mouseExited): Remove unused variables p and r.
7337 (ns_define_frame_cursor, ns_clear_frame_area)
7338 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
7339 (menuDown): Assign [sender tag] to variable and cast the variable.
7340
7341 * nsterm.h (menuDown): Add id as type to argument sender.
7342 (ns_display_info_for_name): Add Lisp_Object argument.
7343 (ns_term_init): Add Lisp_Object argument.
7344 (ns_map_event_to_object): Add void argument.
7345 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
7346 prototype with arguments and only declare if __OBJC__.
7347 (nxatoms_of_nsselect): Add void argument.
7348 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
7349 (ns_alloc_autorelease_pool): Add void argument.
7350 (ns_release_autorelease_pool): Add void* argument.
7351 (ns_get_defaults_value): Add const char* argument.
7352
7353 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
7354 (initFromContents): Use SSDATA where appropriate.
7355 (ns_update_menubar): Add braces to ambigous if-else.
7356 (initWithTitle): Put () around assignment in if statement.
7357 (ns_menu_show): Remove unused variables window and keymap.
7358 (update_frame_tool_bar): Remove unused variable selected_p.
7359 (initWithContentRect): Remove unused variable this_cmd_name.
7360
7361 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
7362 appropriate.
7363 (setXBMColor): Remove unused variable len.
7364 (setPixmapData): Put () around assignment in loop statement.
7365
7366 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
7367 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
7368 where appropriate.
7369 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
7370 around assignment in loop statement.
7371 (nsfont_open): Remove unused variable i.
7372 (nsfont_open): Remove unused variable len.
7373 (nsfont_draw): Remove unused variable cs.
7374
7375 * nsfns.m (x_set_icon_name, ns_set_name_internal)
7376 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
7377 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
7378 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
7379 (Fns_font_name, Fns_perform_service)
7380 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
7381 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
7382 (ns_set_name): Remove unused variable view.
7383 (x_set_menu_bar_lines): Remove unused variable olines.
7384 (x_set_tool_bar_lines): Remove unused variable root_window.
7385 (Fns_list_colors): Put () around assignment in while statement.
7386 (Fns_perform_service): Remove unused variable len.
7387 (Fns_display_usable_bounds): Remove unused variable top.
7388 (syms_of_nsfns): Remove unused variable i.
7389
7390 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7391 memcpy (Bug#11907).
7392
7393 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
7394
7395 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7396 and free it with DestroyExceptionInfo (Bug#11558).
7397
7398 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
7399
7400 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7401 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7402 Set here, not in nt/config.nt.
7403
7404 2012-07-13 Eli Zaretskii <eliz@gnu.org>
7405
7406 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7407 cursor overflow into the last glyph on display line when the right
7408 fringe is off. (Bug#11832)
7409
7410 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7411
7412 * xdisp.c (produce_special_glyphs): Now static.
7413 * dispextern.h (produce_special_glyphs): Remove decl.
7414
7415 2012-07-13 Glenn Morris <rgm@gnu.org>
7416
7417 * s/bsd-common.h, s/cygwin.h: Remove empty files.
7418 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7419
7420 * s/usg5-4-common.h (USG, USG5):
7421 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7422 * s/sol2-6.h (SOLARIS2):
7423 * s/irix6-5.h (IRIX6_5):
7424 * s/hpux10-20.h (USG, USG5, HPUX):
7425 * s/gnu-linux.h (USG, GNU_LINUX):
7426 * s/freebsd.h (BSD_SYSTEM):
7427 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7428 * s/cygwin.h (CYGWIN):
7429 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7430 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7431
7432 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
7433
7434 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
7435
7436 2012-07-13 Glenn Morris <rgm@gnu.org>
7437
7438 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7439
7440 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7441
7442 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7443 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7444
7445 2012-07-12 Glenn Morris <rgm@gnu.org>
7446
7447 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
7448
7449 * process.c (init_process_emacs): Rename from init_process.
7450 The old name is also the name of a Mach system call.
7451 * lisp.h, emacs.c: Update for this name change.
7452 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7453 longer needed.
7454
7455 2012-07-12 Eli Zaretskii <eliz@gnu.org>
7456
7457 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7458 memmove call that removes glyphs covered by the left truncation
7459 glyph. Improve commentary.
7460 (display_line): Fix display of continuation glyphs on GUI frames
7461 when the right fringe is turned off and variable-size fonts are
7462 used in the window. Move the code that appends a stretch glyph to
7463 produce_special_glyphs, so that it could be used for truncation
7464 and continuation glyphs alike.
7465 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7466 glyph of a suitably computed width, to align the special glyphs at
7467 the window margin. Code moved from display_line. (Bug#11832)
7468
7469 2012-07-12 Glenn Morris <rgm@gnu.org>
7470
7471 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7472
7473 * s/gnu-linux.h, s/hpux10-20.h:
7474 Do not unconditionally define HAVE_XRMSETDATABASE.
7475
7476 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7477
7478 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7479
7480 Fix typos that broke OS X build.
7481 Reported by Randal L. Schwartz in
7482 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7483 * nsterm.m (ns_timeout): Add missing local decl.
7484 (ns_get_color): snprintf -> sprintf, to fix typo.
7485
7486 2012-07-12 Glenn Morris <rgm@gnu.org>
7487
7488 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7489 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7490 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7491 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7492
7493 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7494 Move PTY_OPEN to configure.
7495
7496 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7497 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7498 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7499
7500 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7501
7502 Use empty_unibyte_string where applicable.
7503 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7504 * lread.c (read1): Likewise.
7505 * xsettings.c (syms_of_xsettings): Likewise.
7506
7507 2012-07-12 Glenn Morris <rgm@gnu.org>
7508
7509 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7510 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7511 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7512 * s/hpux10-20.h (RUN_TIME_REMAP):
7513 * s/bsd-common.h (TABDLY): Move to configure.
7514
7515 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7516
7517 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7518
7519 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7520 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
7521
7522 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
7523
7524 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7525 * s/template.h: Move NARROWPROTO to configure.
7526
7527 2012-07-11 Glenn Morris <rgm@gnu.org>
7528
7529 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7530 unused since 2011-01-17 change to systty.h.
7531
7532 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7533 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7534 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7535
7536 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7537
7538 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7539
7540 2012-07-11 Glenn Morris <rgm@gnu.org>
7541
7542 * s/darwin.h, s/gnu-linux.h, s/template.h:
7543 Move INTERRUPT_INPUT to configure.
7544
7545 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7546
7547 Minor adjustments to interning code.
7548 * lisp.h (intern, intern_c_string): Redefine as static inline
7549 wrappers for intern_1 and intern_c_string_1, respectively.
7550 (intern_1, intern_c_string_1): Rename prototypes.
7551 * lread.c (intern_1, intern_c_string_1, oblookup):
7552 Simplify Vobarray checking.
7553 * font.c (font_intern_prop): Likewise. Adjust comment.
7554 * w32font.c (intern_font_name): Likewise.
7555
7556 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7557
7558 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7559
7560 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7561 of Fcar/Fcdr if possible.
7562 * font.c (check_otf_features): Likewise.
7563 * fontset.c (Fnew_fontset): Likewise.
7564 * gnutls.c (Fgnutls_boot): Likewise.
7565 * minibuf.c (read_minibuf): Likewise.
7566 * msdos.c (IT_set_frame_parameters): Likewise.
7567 * xmenu.c (Fx_popup_dialog): Likewise.
7568 * w32menu.c (Fx_popup_dialog): Likewise.
7569
7570 2012-07-11 Glenn Morris <rgm@gnu.org>
7571
7572 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7573 since nothing has defined it on these platforms.
7574
7575 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7576 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7577
7578 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7579 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7580 Move CLASH_DETECTION to configure.
7581
7582 * s/gnu.h: Remove file, which is now empty.
7583
7584 * s/gnu.h, s/gnu-linux.h:
7585 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7586
7587 2012-07-11 John Wiegley <johnw@newartisans.com>
7588
7589 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7590 function attribute, so we only use it if it exists in the
7591 compiler.
7592
7593 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7594
7595 Avoid call to strlen in fast_c_string_match_ignore_case.
7596 * search.c (fast_c_string_match_ignore_case): Change to use
7597 length argument. Adjust users accordingly.
7598 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7599
7600 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7601
7602 Assume mkdir, rmdir.
7603 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7604 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7605
7606 Assume rename.
7607 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7608
7609 Assume perror.
7610 * s/hpux10-20.h (HAVE_PERROR): Remove.
7611 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7612 Remove dummy definition, as this problem was obsolete long ago.
7613
7614 Assume strerror.
7615 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7616
7617 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7618
7619 Avoid calls to strlen in font processing functions.
7620 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
7621 (font_open_by_name): Change to use length argument.
7622 Adjust users accordingly.
7623 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7624 Adjust prototypes.
7625 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7626 Change to return ptrdiff_t.
7627 (xfont_list_pattern, xfont_match): Use length returned by
7628 xfont_decode_coding_xlfd.
7629 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7630
7631 2012-07-11 Glenn Morris <rgm@gnu.org>
7632
7633 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7634 Move DONT_REOPEN_PTY to configure.
7635
7636 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7637 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7638
7639 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7640
7641 Remove "#define unix" that is no longer needed (Bug#11905).
7642 * s/aix4-2.h (unix): Remove; no longer needed.
7643
7644 EMACS_TIME simplification (Bug#11875).
7645 This replaces macros (which typically do not work in GDB)
7646 with functions, typedefs and enums, making the code easier to debug.
7647 The functional style also makes code easier to read and maintain.
7648 * systime.h: Include <sys/time.h> on all hosts, not just if
7649 WINDOWSNT, since 'struct timeval' is needed in general.
7650 (EMACS_TIME): Now a typedef, not a macro.
7651 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7652 not macros.
7653 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7654 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7655 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7656 (EMACS_TIME_LE): Now functions, not macros.
7657 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7658 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7659 which are not functions. All uses rewritten to use:
7660 (make_emacs_time): New function.
7661 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7662 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7663 not functions. All uses rewritten to use the following, respectively:
7664 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7665 (add_emacs_time, sub_emacs_time): New functions.
7666 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7667 * fileio.c (Fcopy_file):
7668 * xterm.c (XTflash): Get the current time closer to when it's used.
7669 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7670
7671 * bytecode.c (targets): Suppress -Woverride-init warnings.
7672
7673 Simplify by avoiding confusing use of strncpy etc.
7674 * doc.c (Fsnarf_documentation):
7675 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7676 * frame.c (Fmake_terminal_frame):
7677 * gtkutil.c (get_utf8_string):
7678 * lread.c (openp):
7679 * nsmenu.m (ns_update_menubar):
7680 * regex.c (regerror):
7681 Prefer memcpy to strncpy and strncat when either will do.
7682 * fileio.c (Fsubstitute_in_file_name):
7683 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7684 (menu_separator_name_p):
7685 * nsmenu.m (ns_update_menubar):
7686 Prefer memcmp to strncmp when either will do.
7687 * nsterm.m: Include <ftoastr.h>.
7688 (ns_get_color):
7689 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7690 Prefer snprintf to strncpy.
7691 * nsterm.m (ns_term_init):
7692 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7693 * nsterm.m (ns_term_init):
7694 Avoid the need for strncpy, by using build_string or
7695 make_unibyte_string directly. Use dtoastr, not snprintf.
7696 * process.c (Fmake_network_process): Diagnose service names that
7697 are too long, rather than silently truncating them or creating
7698 non-null-terminated names.
7699 (Fnetwork_interface_info): Likewise, for interface names.
7700 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7701 Prefer sprintf to strncat.
7702 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7703 Prefer vsnprintf to vsprintf + strncpy.
7704
7705 2012-07-10 Glenn Morris <rgm@gnu.org>
7706
7707 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7708 Clarify fallback case.
7709
7710 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7711
7712 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7713 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7714 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7715 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7716 where argument type is known to be a Lisp_Cons.
7717
7718 2012-07-10 Tom Tromey <tromey@redhat.com>
7719
7720 * bytecode.c (BYTE_CODE_THREADED): New macro.
7721 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7722 (enum byte_code_op): New type.
7723 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7724 (exec_byte_code): Use them. Use token threading when applicable.
7725
7726 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7727
7728 Optimize pure C strings initialization.
7729 * lisp.h (make_pure_string): Fix prototype.
7730 (build_pure_c_string): New function, defined as static inline. This
7731 provides a better opportunity to optimize away calls to strlen when
7732 the function is called with compile-time constant argument.
7733 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7734 argument, adjust users accordingly. Use build_pure_c_string where
7735 appropriate.
7736 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7737 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7738 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7739
7740 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7741
7742 Avoid calls to strlen in miscellaneous functions.
7743 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7744 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7745 * lread.c (openp): Likewise.
7746
7747 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7748
7749 Avoid calls to strlen in path processing functions.
7750 * fileio.c (file_name_as_directory): Add comment. Change to add
7751 srclen argument and return the length of result. Adjust users
7752 accordingly.
7753 (directory_file_name): Fix comment. Change to add srclen argument,
7754 swap 1st and 2nd arguments to obey the common convention.
7755 Adjust users accordingly.
7756 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7757
7758 2012-07-10 Glenn Morris <rgm@gnu.org>
7759
7760 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7761 Move PENDING_OUTPUT_COUNT definition to configure.
7762
7763 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7764 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7765 * s/gnu.h (DATA_START): Move definitions to configure.
7766
7767 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7768 We include usg5-4-common.h, which defines them both.
7769
7770 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7771 O_RDONLY already includes it).
7772
7773 Stop ns builds setting the EMACSLOADPATH environment variable.
7774 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7775 Now it does not set EMACSLOADPATH, just returns the load-path string.
7776 * nsterm.h: Update accordingly.
7777 * lread.c [HAVE_NS]: Include nsterm.h.
7778 (init_lread) [HAVE_NS]: Use ns_load_path.
7779 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7780
7781 2012-07-09 Glenn Morris <rgm@gnu.org>
7782
7783 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7784 since the included bsd-common.h does so.
7785
7786 Stop ns builds setting the EMACSPATH environment variable.
7787 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7788 (ns_init_paths): Do not set EMACSPATH.
7789 * nsterm.h (ns_exec_path): Add it.
7790 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7791 Use ns_exec_path.
7792
7793 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7794
7795 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7796
7797 * process.c (wait_reading_process_output): 'waitchannels' was unset
7798 when read_kbd || !NILP (wait_for_cell); fix this.
7799
7800 Add GCC-style 'const' attribute to functions that can use it.
7801 * character.h (char_resolve_modifier_mask):
7802 * keyboard.h (make_ctrl_char):
7803 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7804 (init_character_once, next_almost_prime, init_fns, init_image)
7805 (flush_pending_output, init_sound):
7806 * mem-limits.h (start_of_data):
7807 * menu.h (finish_menu_items):
7808 Add ATTRIBUTE_CONST.
7809 * emacs.c (DEFINE_DUMMY_FUNCTION):
7810 Declare the dummy function with ATTRIBUTE_CONST.
7811 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7812 Add decls with ATTRIBUTE_CONST.
7813
7814 Minor improvements to make_formatted_string.
7815 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7816 where int is good enough, as vsprintf returns an int.
7817 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7818
7819 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7820
7821 Use make_formatted_string to avoid double length calculation.
7822 * lisp.h (make_formatted_string): New prototype.
7823 * alloc.c (make_formatted_string): New function.
7824 * buffer.c (Fgenerate_new_buffer_name): Use it.
7825 * dbusbind.c (syms_of_dbusbind): Likewise.
7826 * editfns.c (Fcurrent_time_zone): Likewise.
7827 * filelock.c (get_boot_time): Likewise.
7828 * frame.c (make_terminal_frame, set_term_frame_name)
7829 (x_report_frame_params): Likewise.
7830 * image.c (gs_load): Likewise.
7831 * minibuf.c (get_minibuffer): Likewise.
7832 * msdos.c (dos_set_window_size): Likewise.
7833 * process.c (make_process): Likewise.
7834 * xdisp.c (ensure_echo_area_buffers): Likewise.
7835 * xsettings.c (apply_xft_settings): Likewise.
7836
7837 2012-07-09 Glenn Morris <rgm@gnu.org>
7838
7839 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7840 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7841 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7842 * nsterm.h (ns_etc_directory): Add it.
7843 * callproc.c [HAVE_NS]: Include nsterm.h.
7844 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7845
7846 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7847
7848 Move marker debugging code under MARKER_DEBUG.
7849 * marker.c (MARKER_DEBUG): Move marker debugging code under
7850 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7851 for bootstrap with --enable-checking (~3x slowdown reported
7852 by Juanma Barranquero <lekktu@gmail.com>).
7853 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7854
7855 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7856
7857 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7858 See <http://bugs.gnu.org/11825#29>.
7859
7860 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7861
7862 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7863 has no font, use the frame's font. (Bug#11813)
7864 (display_line): Add commentary about displaying truncation glyphs
7865 on GUI frames.
7866 (produce_special_glyphs): Move here from term.c.
7867
7868 * term.c (produce_special_glyphs): Move to xdisp.c.
7869
7870 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7871 section.
7872
7873 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7874
7875 * xdisp.c (display_line): Avoid warning about implicit declaration
7876 of FRAME_FONT.
7877
7878 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7879
7880 * lisp.h: Remove empty conditional.
7881
7882 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7883
7884 * lread.c (load_path_check): Now static.
7885
7886 Fix some minor --with-ns problems found by static checking.
7887 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7888 (x_set_font) [!HAVE_X_WINDOWS]:
7889 * image.c (xpm_load_image) [HAVE_NS]:
7890 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7891 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7892 Remove unused local.
7893 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7894 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7895 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7896 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7897 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7898 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7899 Fix pointer signedness problem.
7900 * xfaces.c (FRAME_X_FONT_TABLE):
7901 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7902
7903 2012-07-07 Glenn Morris <rgm@gnu.org>
7904
7905 * lread.c (load_path_check): New function, split from init_lread.
7906 (init_lread): Reorganize. Motivation:
7907 If EMACSLOADPATH is set, check/warn about that rather than the
7908 defaults, which we are not going to use. Hence we can remove
7909 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7910 Don't warn if site-lisp directories are missing.
7911 If not installed, start from a blank load-path, since
7912 PATH_LOADSEARCH refers to the eventual installation directories.
7913
7914 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7915
7916 Support truncation and continuation glyphs on GUI frames, when
7917 fringes are disabled. (Bug#11832)
7918 * xdisp.c (init_iterator): Get dimensions of truncation and
7919 continuation glyphs even if on GUI frames.
7920 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7921 or both, are absent.
7922 (start_display, move_it_in_display_line_to): Handle the case of a
7923 GUI frame without a fringe to display continuation or truncation
7924 glyphs.
7925 (insert_left_trunc_glyphs): Support GUI frames: make sure
7926 truncation glyphs overwrite enough glyphs from the current line to
7927 have sufficient space in pixels.
7928 (display_line): Support truncation and continuation glyphs on GUI
7929 frames. If some spare pixels are left on the line after inserting
7930 the truncation glyphs, fill that space with a stretch glyph of a
7931 suitably computed width.
7932
7933 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7934 produce_glyphs, to support GUI sessions.
7935
7936 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7937
7938 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7939
7940 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7941
7942 Do not require float-time's arg to fit in time_t (Bug#11825).
7943 This works better on hosts where time_t is unsigned, and where
7944 float-time is applied to the (negative) difference between two times.
7945 * editfns.c (decode_time_components): Last arg is now double *,
7946 not int *, and means to store all the result as a double, without
7947 worrying about whether the seconds part fits in time_t.
7948 All callers changed.
7949 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7950 All callers changed.
7951 (Ffloat_time): Do not fail merely because the specified time falls
7952 outside of time_t range.
7953
7954 2012-07-07 Glenn Morris <rgm@gnu.org>
7955
7956 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7957 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7958 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7959
7960 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7961
7962 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7963 Update dependencies.
7964
7965 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7966
7967 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7968
7969 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7970 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7971 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7972 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7973 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7974 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7975
7976 * xfont.c (compare_font_names): Redo to omit the need for casts.
7977
7978 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7979
7980 * xfns.c (Fx_change_window_property): Doc fix.
7981 * w32fns.c (Fx_change_window_property): Doc fix.
7982
7983 * w32fns.c (Fx_window_property): Accept the same arguments as the
7984 X Windows version. Doc fix.
7985 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7986
7987 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7988 Eli Zaretskii <eliz@gnu.org>
7989
7990 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7991 Windows-specific code from nt/config.nt moved here.
7992 Obsolete settings removed.
7993
7994 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7995
7996 * process.c: Avoid unnecessary calls to gettime.
7997 (wait_reading_process_output): Don't get the time of day
7998 when gobbling data immediately and not waiting, as there's no need
7999 for it in that case. This removes a FIXME.
8000
8001 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
8002
8003 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
8004 is defined (Bug#11768).
8005
8006 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8007
8008 Fix marker debugging code.
8009 * marker.c (byte_char_debug_check): Do not perform the check
8010 if buffer is not multibyte.
8011 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8012 Call byte_char_debug_check with correct arguments.
8013
8014 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8015
8016 Compile marker debugging code only if ENABLE_CHECKING is defined.
8017 * marker.c (byte_char_debug_check, count_markers):
8018 Use only if ENABLE_CHECKING is defined.
8019 (byte_debug_flag): Remove.
8020 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8021 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
8022
8023 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8024
8025 Avoid code repetition in marker-related functions.
8026 * marker.c (attach_marker): New function.
8027 (Fset_marker, set_marker_restricted, set_marker_both)
8028 (set_marker_restricted_both): Use it.
8029 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
8030 Consistently rename charno to charpos.
8031 (marker_position): Add eassert.
8032 (marker_byte_position): Convert to eassert.
8033
8034 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8035
8036 Simplify list operations in unchain_overlay and unchain_marker.
8037 * buffer.c (unchain_overlay): Simplify. Add comment.
8038 * marker.c (unchain_marker): Simplify. Fix comments.
8039
8040 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8041
8042 Introduce fast path for the widely used marker operation.
8043 * alloc.c (build_marker): New function.
8044 * lisp.h (build_marker): New prototype.
8045 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
8046 * composite.c (autocmp_chars): Likewise.
8047 * editfns.c (buildmark): Remove.
8048 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
8049 (save_restriction_save): Use build_marker.
8050 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
8051 * window.c (save_window_save): Likewise.
8052
8053 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8054
8055 Do not use Fdelete_overlay in delete_all_overlays
8056 to avoid redundant calls to unchain_overlay.
8057 * buffer.c (drop_overlay): New function.
8058 (delete_all_overlays, Fdelete_overlay): Use it.
8059 * minibuf.c (get_minibuffer): Fix comment.
8060
8061 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8062
8063 Port to OpenBSD 5.1 amd64.
8064 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
8065 This is needed for OpenBSD, and should be harmless on all BSD systems.
8066 Also, include <sys/sysctl.h>, as it should be available on all
8067 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
8068 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
8069 use p_pid member, not kp_proc.pid.
8070
8071 2012-07-06 Glenn Morris <rgm@gnu.org>
8072
8073 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
8074
8075 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8076
8077 More xmalloc and related cleanup.
8078 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
8079 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
8080 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
8081 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
8082 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
8083 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
8084 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
8085 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
8086 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
8087 * xterm.c:
8088 Omit needless casts involving void * pointers and allocation.
8089 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
8090 as the former is more robust if P's type is changed.
8091 Prefer xzalloc to xmalloc + memset 0.
8092 Simplify malloc-or-realloc to realloc.
8093 Don't worry about xmalloc returning a null pointer.
8094 Prefer xstrdup to xmalloc + strcpy.
8095 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
8096 growing it.
8097 * keyboard.c (apply_modifiers_uncached): Prefer local array to
8098 alloca of a constant.
8099
8100 2012-07-05 Eli Zaretskii <eliz@gnu.org>
8101
8102 * xdisp.c (display_line): Fix horizontal pixel coordinates when
8103 hscroll is larger than the line width. Fixes long and futile
8104 looping inside extend_face_to_end_of_line (on a TTY) producing
8105 glyphs that are not needed and thrown away.
8106
8107 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8108
8109 * marker.c (set_marker_restricted_both): Simplify by using
8110 clip_to_bounds.
8111
8112 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8113
8114 * editfns.c (region_limit): Simplify by using clip_to_bounds.
8115
8116 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
8117
8118 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
8119 not defined (Bug#11768).
8120 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
8121 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
8122 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
8123 followed by gtk_box_set_homogeneous (Bug#11768).
8124 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
8125 (update_theme_scrollbar_width, xg_create_scroll_bar):
8126 Use gtk_scrollbar_new (Bug#11768).
8127 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
8128 (is_box_type): New function (Bug#11768).
8129 (xg_tool_item_stale_p): Call is_box_type.
8130 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
8131 with default display (Bug#11768).
8132
8133 2012-07-05 Eli Zaretskii <eliz@gnu.org>
8134
8135 * xdisp.c (window_hscroll_limited): New function.
8136 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
8137 coordinates when window's hscroll is set to insanely large
8138 values. (Bug#11857)
8139
8140 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
8141
8142 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
8143 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
8144
8145 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8146
8147 Cleanup xmalloc.
8148 * lisp.h (xzalloc): New prototype. Omit needless casts.
8149 * alloc.c (xzalloc): New function. Omit needless casts.
8150 * charset.c: Omit needless casts. Convert all calls to
8151 xmalloc with following memset to xzalloc.
8152 * dispnew.c: Likewise.
8153 * fringe.c: Likewise.
8154 * image.c: Likewise.
8155 * sound.c: Likewise.
8156 * term.c: Likewise.
8157 * w32fns.c: Likewise.
8158 * w32font.c: Likewise.
8159 * w32term.c: Likewise.
8160 * xfaces.c: Likewise.
8161 * xfns.c: Likewise.
8162 * xterm.c: Likewise.
8163 * atimer.c: Omit needless casts.
8164 * buffer.c: Likewise.
8165 * callproc.c: Likewise.
8166 * ccl.c: Likewise.
8167 * coding.c: Likewise.
8168 * composite.c: Likewise.
8169 * doc.c: Likewise.
8170 * doprnt.c: Likewise.
8171 * editfns.c: Likewise.
8172 * emacs.c: Likewise.
8173 * eval.c: Likewise.
8174 * filelock.c: Likewise.
8175 * fns.c: Likewise.
8176 * gtkutil.c: Likewise.
8177 * keyboard.c: Likewise.
8178 * lisp.h: Likewise.
8179 * lread.c: Likewise.
8180 * minibuf.c: Likewise.
8181 * msdos.c: Likewise.
8182 * print.c: Likewise.
8183 * process.c: Likewise.
8184 * region-cache.c: Likewise.
8185 * search.c: Likewise.
8186 * sysdep.c: Likewise.
8187 * termcap.c: Likewise.
8188 * terminal.c: Likewise.
8189 * tparam.c: Likewise.
8190 * w16select.c: Likewise.
8191 * w32.c: Likewise.
8192 * w32reg.c: Likewise.
8193 * w32select.c: Likewise.
8194 * w32uniscribe.c: Likewise.
8195 * widget.c: Likewise.
8196 * xdisp.c: Likewise.
8197 * xmenu.c: Likewise.
8198 * xrdb.c: Likewise.
8199 * xselect.c: Likewise.
8200
8201 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8202
8203 * fileio.c (time_error_value): Check the right error number.
8204 Problem reported by Troels Nielsen in
8205 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
8206
8207 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8208
8209 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
8210 This should be fixed in a better way; see Eli Zaretskii in
8211 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
8212 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
8213
8214 * fileio.c (time_error_value): Rename from special_mtime.
8215 The old name's problems were noted by Eli Zaretskii in
8216 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
8217
8218 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
8219 This variable's comment says Emacs needs at least one GDB-visible
8220 symbol of type enum pvec_type, to work around GDB problems.
8221 The symbol's value doesn't matter.
8222
8223 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
8224 that causes compilation to fail on pre-C99 compilers.
8225
8226 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
8227
8228 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
8229 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
8230
8231 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8232
8233 * buffer.c (init_buffer_once): Fix initialization of
8234 headers for buffer_defaults and buffer_local_symbols.
8235 Reported by Juanma Barranquero <lekktu@gmail.com>.
8236
8237 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8238
8239 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
8240 * lisp.h (enum pvec_type): Use fewer bits.
8241 (PSEUDOVECTOR_SIZE_BITS): New constant.
8242 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
8243 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
8244 change in pvec_type.
8245 (PSEUDOVECTOR_TYPEP): New macro.
8246 (TYPED_PSEUDOVECTORP): Use it.
8247 * fns.c (internal_equal): Adapt code to extract pvectype.
8248 * emacs.c (gdb_pvec_type): Update type.
8249 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
8250 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
8251 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
8252 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
8253 (sweep_vectors): Use it. Use local var `total_bytes' instead of
8254 abusing vector->header.next.nbytes.
8255 (live_vector_p): Use PVEC_TYPE.
8256 (mark_object): Adapt code to extract pvectype. Use switch.
8257
8258 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8259
8260 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
8261 Tighten new eassert a bit.
8262
8263 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8264
8265 Fix compilation with --enable-gcc-warnings and -O1
8266 optimization level.
8267 * doprnt.c (doprnt): Change type of tem to int, initialize
8268 to avoid compiler warning. Add eassert.
8269 * search.c (simple_search): Initialize match_byte to avoid
8270 compiler warning. Add eassert.
8271
8272 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8273
8274 Avoid weird behavior with large horizontal scrolls.
8275 Without this change, for example, large hscroll values would
8276 mess up Emacs's display on Fedora 15 x86, presumably due to
8277 overflows in int calculations in the display code.
8278 Also, if buffers had long lines, Emacs would freeze.
8279 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
8280 (set_window_hscroll): New function, containing the old guts of
8281 Fset_window_hscroll. Return the clipped value.
8282 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
8283 This avoids the need to check against PTRDIFF_MAX.
8284
8285 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
8286
8287 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8288
8289 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
8290
8291 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8292
8293 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
8294 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
8295 since GCC 4.4.6 issues a bogus warning for them.
8296
8297 Fix bugs in file timestamp newness comparisons.
8298 * fileio.c (Ffile_newer_than_file_p):
8299 * lread.c (Fload): Use full timestamp resolution of files,
8300 not just the 1-second resolution, so that files that are only
8301 slightly newer still count as newer.
8302 * fileio.c (Ffile_newer_than_file_p): Don't assume file
8303 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
8304
8305 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 * fileio.c: Improve handling of file time marker. (Bug#11852)
8308 (special_mtime): New function.
8309 (Finsert_file_contents, Fverify_visited_file_modtime):
8310 Use it to set special mtime values consistently.
8311
8312 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
8313
8314 * fileio.c (Finsert_file_contents): Properly handle st_mtime
8315 marker for non-existing file. (Bug#11852)
8316
8317 2012-07-03 Glenn Morris <rgm@gnu.org>
8318
8319 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
8320 and did not make it into globals.h).
8321
8322 2012-07-03 Tom Tromey <tromey@redhat.com>
8323
8324 * window.c (Fset_window_margins, Fset_window_fringes)
8325 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
8326 * textprop.c (Fprevious_property_change): No longer static.
8327 * syntax.c (Fsyntax_table_p): No longer static.
8328 * process.c (Fget_process, Fprocess_datagram_address): No longer
8329 static.
8330 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
8331 * keyboard.c (Fcommand_execute): No longer static.
8332 Remove EXFUN.
8333 * insdel.c (Fcombine_after_change_execute): No longer static.
8334 * image.c (Finit_image_library): No longer static.
8335 * fileio.c (Fmake_symbolic_link): No longer static.
8336 * eval.c (Ffetch_bytecode): No longer static.
8337 * editfns.c (Fuser_full_name): No longer static.
8338 * doc.c (Fdocumentation_property, Fsnarf_documentation):
8339 No longer static.
8340 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
8341 static.
8342 * dired.c (Ffile_attributes): No longer static.
8343 * composite.c (Fcomposition_get_gstring): No longer static.
8344 * callproc.c (Fgetenv_internal): No longer static.
8345
8346 * ccl.h: Remove EXFUNs.
8347 * buffer.h: Remove EXFUNs.
8348 * dispextern.h: Remove EXFUNs.
8349 * intervals.h: Remove EXFUNs.
8350 * fontset.h: Remove EXFUN.
8351 * font.h: Remove EXFUNs.
8352 * dosfns.c (system_process_attributes): Remove EXFUN.
8353 * keymap.h: Remove EXFUNs.
8354 * lisp.h: Remove EXFUNs.
8355 * w32term.h: Remove EXFUNs.
8356 * window.h: Remove EXFUNs.
8357 * xsettings.h: Remove EXFUN.
8358 * xterm.h: Remove EXFUN.
8359
8360 2012-07-03 Glenn Morris <rgm@gnu.org>
8361
8362 * lisp.h (Frandom): Make it visible to C.
8363 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
8364 buffer for invisible buffers. (Bug#1229)
8365
8366 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8367
8368 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
8369 values which aren't power of 2.
8370 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
8371 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
8372 accordingly.
8373
8374 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
8375
8376 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
8377
8378 * alloc.c (mark_object): Revert part of last patch to use `switch'.
8379
8380 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8381
8382 * alloc.c (allocate_vector_block): Remove redundant
8383 calls to mallopt if DOUG_LEA_MALLOC is defined.
8384 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
8385 avoid calls to mallopt if zero_vector is returned.
8386
8387 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8388
8389 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8390 is enabled, avoid dereferencing NULL current_sblock if
8391 running undumped.
8392
8393 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8394
8395 Cleanup basic buffer management.
8396 * buffer.h (struct buffer): Change layout to use generic vector
8397 marking code. Fix some comments. Change type of 'clip_changed'
8398 to bitfield. Remove unused #ifndef old.
8399 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8400 (GET_OVERLAYS_AT): Fix indentation.
8401 (for_each_per_buffer_object_at): New macro.
8402 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8403 (Fbuffer_local_variables): Use it.
8404 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8405 * alloc.c (allocate_buffer): Adjust to match new layout of
8406 struct buffer. Fix comment.
8407 (mark_overlay): New function.
8408 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8409 Lisp area of struct buffer.
8410 (mark_object): Use it. Adjust marking of misc objects
8411 and related comments.
8412
8413 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8414
8415 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8416 wrapper that is not needed because the wrapped code is a no-op (zero
8417 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8418 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8419
8420 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8421
8422 * alloc.c (mark_buffer): Simplify. Remove prototype.
8423 (mark_object): Add comment. Reorganize marking of vector-like
8424 objects. Use CHECK_LIVE for all vector-like objects except buffers
8425 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
8426 Avoid redundant calls to mark_vectorlike for bool vectors.
8427
8428 2012-06-30 Glenn Morris <rgm@gnu.org>
8429
8430 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8431
8432 * epaths.in (PATH_SITELOADSEARCH): New.
8433 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8434 This is rather than relying on --enable-locallisppath elements
8435 having "site-lisp" in their names. (Bug#10208#25, 11658)
8436
8437 2012-06-30 Eli Zaretskii <eliz@gnu.org>
8438
8439 * w32proc.c (sys_select): Accept and ignore one more argument.
8440
8441 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8442
8443 * sysselect.h [DOS_NT]: Don't include sys/select.h.
8444 (pselect) [!MS_DOS]: Redirect to sys_select.
8445
8446 * sysdep.c: Don't include dos.h and dosfns.h.
8447
8448 * process.c (sys_select):
8449 * msdos.c (sys_select): Accept one more argument and ignore it.
8450
8451 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8452 adapt data types and code to that.
8453
8454 * dosfns.c:
8455 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8456 which clashes with the gnulib function of the same name.
8457
8458 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8459
8460 * font.c (font_style_to_value, font_style_symbolic)
8461 (font_prop_validate_style): Add type checks for values in
8462 font_style_table.
8463
8464 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8465 argument.
8466 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8467 uses.
8468
8469 2012-06-29 Eli Zaretskii <eliz@gnu.org>
8470
8471 * xdisp.c (try_window_id): Undo last change.
8472
8473 * w32.c (getwd): Adjust commentary about startup_dir.
8474 (init_environment): Always call sys_access, even in non-MSVC
8475 builds. Don't chdir to the directory of the Emacs executable.
8476 This undoes code from 1997 which was justified by the need to
8477 "avoid conflicts when removing and renaming directories". But its
8478 downside was that every relative file name was being interpreted
8479 relative to the directory of the Emacs executable, which can never
8480 be TRT. In particular, it broke sys_access when called with
8481 relative file names.
8482 (sys_access): Map GetLastError to errno.
8483
8484 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8485
8486 * window.h (struct window): Change type of 'fringes_outside_margins'
8487 to bitfield. Fix comment. Adjust users accordingly.
8488 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
8489 Adjust comment.
8490 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8491 to ptrdiff_t.
8492
8493 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
8494
8495 * gnutls.c (emacs_gnutls_handshake):
8496 Add QUIT to make the loop interruptible.
8497
8498 2012-06-29 Glenn Morris <rgm@gnu.org>
8499
8500 * charset.c (init_charset): Make lack of etc/charsets fatal.
8501
8502 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8503
8504 * editfns.c (region_limit): Fix type mismatch.
8505
8506 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8507
8508 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8509 undefined. Convert from xassert to eassert.
8510 * nsmenu.m: Convert from xassert to eassert.
8511 * nsterm.m: Likewise.
8512
8513 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8514
8515 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8516
8517 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8518
8519 Avoid integer overflow on scroll-left and scroll-right.
8520 * window.c (HSCROLL_MAX): New macro.
8521 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8522 overflow when requested scroll falls outside ptrdiff_t range.
8523
8524 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8525
8526 * window.h (struct window): Change type of 'hscroll',
8527 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8528 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8529 Adjust users accordingly.
8530 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8531 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8532 from EMACS_INT to ptrdiff_t.
8533 (make_window): Omit redundant initialization.
8534
8535 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
8536
8537 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8538
8539 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8540
8541 * window.h (struct window): Change type of 'use_time' and
8542 'sequence_number' from Lisp_Object to int.
8543 * frame.c (make_frame): Adjust users accordingly.
8544 * print.c (print_object): Likewise.
8545 * window.c (select_window, Fwindow_use_time, make_parent_window)
8546 (make_window): Likewise.
8547
8548 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8549
8550 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8551 enabled with --enable-checking=[all,glyphs] configure option.
8552 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8553 adjust comments accordingly.
8554 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8555 undefined, adjust comments accordingly.
8556 * image.c: Likewise.
8557 * scroll.c: Likewise.
8558 * w32fns.c: Likewise.
8559 * w32term.c: Likewise.
8560 * xdisp.c: Likewise.
8561 * xfaces.c: Likewise.
8562 * xfns.c: Likewise.
8563 * xterm.c: Likewise.
8564
8565 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8566
8567 Generalize run-time debugging checks.
8568 * dispextern.h (XASSERTS): Remove.
8569 * fontset.c (xassert): Remove.
8570 Convert from xassert to eassert.
8571 * alloc.c: Convert from xassert to eassert.
8572 * bidi.c: Likewise.
8573 * dispnew.c: Likewise.
8574 * fns.c: Likewise.
8575 * fringe.c: Likewise.
8576 * ftfont.c: Likewise.
8577 * gtkutil.c: Likewise.
8578 * image.c: Likewise.
8579 * keyboard.c: Likewise.
8580 * menu.c: Likewise.
8581 * process.c: Likewise.
8582 * scroll.c: Likewise.
8583 * sound.c: Likewise.
8584 * term.c: Likewise.
8585 * w32console.c: Likewise.
8586 * w32fns.c: Likewise.
8587 * w32term.c: Likewise.
8588 * window.c: Likewise.
8589 * xdisp.c: Likewise.
8590 * xfaces.c: Likewise.
8591 * xfns.c: Likewise.
8592 * xselect.c: Likewise.
8593 * xterm.c: Likewise.
8594
8595 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8596
8597 * fns.c (maybe_resize_hash_table): Output message when growing the
8598 purify-hashtable.
8599
8600 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8601
8602 * alloc.c (allocate_string_data): Remove dead code.
8603 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8604 avoid GCC warning about unused macro.
8605
8606 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8607
8608 * alloc.c (allocate_string): Omit intervals initialization.
8609 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8610 as in make_pure_string and make_pure_c_string.
8611
8612 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8613
8614 * alloc.c (allocate_string): Fix last change.
8615
8616 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8617
8618 * alloc.c (allocate_string): Remove two redundant calls
8619 to memset, add explicit initialization where appropriate.
8620
8621 2012-06-27 Glenn Morris <rgm@gnu.org>
8622
8623 * lisp.mk (lisp): Remove paths.elc.
8624
8625 2012-06-27 Chong Yidong <cyd@gnu.org>
8626
8627 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8628
8629 2012-06-26 John Wiegley <johnw@newartisans.com>
8630
8631 * unexmacosx.c (copy_data_segment): Add two section names used
8632 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8633
8634 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8635 when building with Clang.
8636
8637 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8638
8639 * eval.c (Fapply): Allow calling it with a single argument.
8640
8641 2012-06-26 Eli Zaretskii <eliz@gnu.org>
8642
8643 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8644 _stricmp and _strnicmp.
8645 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8646
8647 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8648
8649 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8650 allocated window.
8651 (allocate_process): Likewise for new process.
8652 (allocate_terminal): Change to use offsetof.
8653 (allocate_frame): Likewise.
8654 * frame.c (make_frame): Omit redundant initialization.
8655 * window.c (make_parent_window): Use memset.
8656 (make_window): Omit redundant initialization.
8657 * process.c (make_process): Omit redundant initialization.
8658 * terminal.c (create_terminal): Likewise.
8659
8660 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8661
8662 * term.c (delete_tty): Remove redundant call to memset.
8663
8664 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8665
8666 * alloc.c: Remove build_string.
8667 * lisp.h: Define build_string as static inline. This provides
8668 a better opportunity to optimize away calls to strlen when the
8669 function is called with compile-time constant argument.
8670 * image.c (imagemagick_error): Convert to build_string.
8671 * w32proc.c (sys_spawnve): Likewise.
8672 * xterm.c (x_term_init): Likewise.
8673
8674 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8675
8676 Use sprintf return value instead of invoking strlen on result.
8677 In the old days this wasn't portable, since some sprintf
8678 implementations returned char *. But they died out years ago and
8679 Emacs already assumes sprintf returns int.
8680 Similarly for float_to_string.
8681 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8682 * ccl.c (ccl_driver):
8683 * character.c (string_escape_byte8):
8684 * data.c (Fnumber_to_string):
8685 * doprnt.c (doprnt):
8686 * print.c (print_object):
8687 * xdisp.c (message_dolog):
8688 * xfns.c (syms_of_xfns):
8689 Use sprintf or float_to_string result to avoid need to call strlen.
8690 * data.c (Fnumber_to_string):
8691 Use make_unibyte_string, since the string must be ASCII.
8692 * lisp.h, print.c (float_to_string): Now returns int length.
8693 * term.c (produce_glyphless_glyph):
8694 Use sprintf result rather than recomputing it.
8695
8696 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8697 * Makefile.in (ALL_CFLAGS):
8698 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8699 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8700
8701 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8702
8703 * dispextern.h (xstrcasecmp): Define to library function
8704 strcasecmp if available.
8705 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8706
8707 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8708
8709 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8710 Avoid comma operator.
8711 * menu.c (push_submenu_start, push_submenu_end)
8712 (push_left_right_boundary, push_menu_pane): Likewise.
8713 * msdos.c (dos_rawgetc): Likewise.
8714
8715 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8716
8717 * xfns.c (xic_create_fontsetname): Remove redundant calls
8718 to memset.
8719
8720 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8721
8722 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8723 sprintf already null-terminates its output.
8724
8725 * xfns.c (x_window): Remove redundant cast.
8726
8727 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8728
8729 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8730 `const char *' to `char *' to avoid compiler warning.
8731
8732 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8733
8734 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8735 instead of truncating it to 63 (admittedly a generous limit).
8736
8737 * process.c: Fix spelling and caps in comments.
8738
8739 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8740
8741 * emacs.c (setpgrp): Remove definition, unused.
8742 * sysdep.c (setpgrp): Remove definition, not used in this file.
8743
8744 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
8745
8746 * makefile.w32-in: Update dependencies.
8747
8748 2012-06-24 Eli Zaretskii <eliz@gnu.org>
8749
8750 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8751 (SYSTIME_H): Add nt/inc/sys/time.h.
8752
8753 * systime.h [WINDOWSNT]: Include sys/time.h.
8754
8755 * s/ms-w32.h (struct timespec): Definition moved from
8756 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8757
8758 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8759
8760 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8761 * buffer.h (buffer_slot_type_mismatch):
8762 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8763 * eval.c (unwind_to_catch):
8764 * image.c (my_png_error, my_error_exit):
8765 * keyboard.c (quit_throw_to_read_char, user_error)
8766 (Fexit_recursive_edit, Fabort_recursive_edit):
8767 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8768 (wrong_type_argument, buffer_overflow, __executable_start)
8769 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8770 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8771 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8772 (fatal):
8773 (child_setup) [!DOS_NT]:
8774 * lread.c (end_of_file_error, invalid_syntax):
8775 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8776 * puresize.h (pure_write_error):
8777 * search.c (matcher_overflow):
8778 * sound.c (sound_perror, alsa_sound_perror):
8779 * sysdep.c, syssignal.h (croak):
8780 * term.c (maybe_fatal, vfatal):
8781 * textprop.c (text_read_only):
8782 * undo.c (user_error):
8783 * unexmacosx.c (unexec_error):
8784 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8785 Use _Noreturn rather than NO_RETURN.
8786 No need for separate decl merely because of _Noreturn.
8787 * sound.c (sound_warning, parse_sound):
8788 Remove unnecessary forward decls.
8789
8790 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8791
8792 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8793 * lisp.h (WAIT_READING_MAX): New macro.
8794 * dispnew.c (Fsleep_for, sit_for):
8795 * keyboard.c (kbd_buffer_get_event):
8796 * process.c (Faccept_process_output):
8797 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8798 This improves on the previous patch, which introduced a bug
8799 when time_t is unsigned and as wide as intmax_t.
8800 See <http://bugs.gnu.org/9000#51>.
8801
8802 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8803
8804 * dispnew.c (sit_for, Fsleep_for):
8805 * keyboard.c (kbd_buffer_get_event):
8806 * process.c (Faccept_process_output): Avoid compiler warnings when
8807 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8808
8809 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8810
8811 * makefile.w32-in: Update dependencies.
8812
8813 * w32.c (ltime): Add return type and declare static.
8814 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8815
8816 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8817
8818 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8819 Privately reported by Herbert J. Skuhra.
8820 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8821 All uses changed.
8822 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8823 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8824
8825 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8826
8827 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8828 last argument of make_unibyte_string.
8829
8830 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8831 language ID in the event parameters.
8832
8833 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8834 event.code, not the obscure "character set ID".
8835
8836 2012-06-23 Chong Yidong <cyd@gnu.org>
8837
8838 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8839
8840 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8841
8842 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8843 * w32.c (fdutimens): New function.
8844
8845 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8846
8847 * s/ms-w32.h (pselect): Redirect to sys_select.
8848
8849 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8850
8851 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8852 in the logic of incrementing and decrementing the value of
8853 use_relocatable_buffers.
8854
8855 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8856
8857 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8858 Privately reported by Herbert J. Skuhra.
8859 [__FreeBSD__]: Remove "*/" typo after "#include".
8860 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8861 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8862 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8863 Don't assume EMACS_TIME and struct timeval are the same type.
8864
8865 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8866
8867 Support higher-resolution time stamps (Bug#9000).
8868 The time stamps are only nanosecond-resolution at the C level,
8869 since that's the best that any real-world system supports now.
8870 But they are picosecond-resolution at the Lisp level, as that's
8871 easy, and leaves room for future OS improvements.
8872
8873 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8874 (LIBES): Use it.
8875
8876 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8877 Don't get current time unless it's needed.
8878
8879 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8880 now provides it if it's absent.
8881 (start_atimer): Port to higher-res time stamps.
8882 Check for time stamp overflow. Don't get current time more
8883 often than is needed.
8884
8885 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8886 Include systime.h, not time.h.
8887 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8888
8889 * dired.c: Include stat-time.h.
8890 (Ffile-attributes): File times now have higher resolution.
8891
8892 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8893 (struct image): Timestamp now has higher resolution.
8894
8895 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8896 has at least microseconds now. All uses removed.
8897 (update_frame, update_single_window, update_window, update_frame_1)
8898 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8899 (duration_to_sec_usec): Remove; no longer needed.
8900
8901 * editfns.c (time_overflow): Now extern.
8902 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8903 (float-time, Fformat_time_string, Fcurrent_time_string)
8904 (Fcurrent_time_zone): Accept and generate higher-resolution
8905 time stamps.
8906 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8907 (decode_time_components, lisp_seconds_argument): New functions.
8908 (make_time): Now static.
8909 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8910 Report an error if the time is invalid, rather than having the caller
8911 do that.
8912
8913 * fileio.c: Include <stat-time.h>
8914 (Fcopy_file): Copy higher-resolution time stamps.
8915 Prefer to set the time stamp via a file descriptor if that works.
8916 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8917 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8918 (Fvisited_file_modtime, Fset_visited_file_modtime):
8919 Support higher-resolution time stamps.
8920
8921 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8922
8923 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8924
8925 * image.c (prepare_image_for_display, clear_image_cache)
8926 (lookup_image): Port to higer-resolution time stamps.
8927
8928 * keyboard.c (start_polling, bind_polling_period):
8929 Check for time stamp overflow.
8930 (read_char, kbd_buffer_get_event, timer_start_idle)
8931 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8932 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8933 Port to higher-resolution time stamps. Do not assume time_t is signed.
8934 (decode_timer): New function. Timers are now vectors of length 9,
8935 not 8, to accommodate the picosecond component.
8936 (timer_check_2): Use it.
8937
8938 * nsterm.m (select_timeout, timeval_subtract): Remove.
8939 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8940 as they're a bit more accurate and handle overflow better.
8941 (ns_select): Change prototype to be compatible with pselect.
8942 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8943 * nsterm.h (ns_select): Adjust prototype.
8944
8945 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8946 us-resolution time stamps.
8947 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8948
8949 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8950
8951 * lisp.h (time_overflow): New decl.
8952 (wait_reading_process_output): First arg is now intmax_t, not int,
8953 to accommodate larger waits.
8954
8955 * process.h (struct Lisp_Process.read_output_delay):
8956 Now counts nanoseconds, not microseconds.
8957 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8958 EMACS_HAS_USECS.
8959 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8960 (wait_reading_process_output):
8961 Port to ns-resolution time stamps.
8962 (Faccept_process_output, wait_reading_process_output):
8963 Check for time stamp overflow. Do not assume time_t is signed.
8964 (select_wrapper): Remove; we now use pselect.
8965 (Fprocess_attributes): Now generates ns-resolution time stamps.
8966
8967 * sysdep.c: Include utimens.h. Don't include utime.h
8968 or worry about struct utimbuf; gnulib does that for us now.
8969 (gettimeofday): Remove; gnulib provides a substitute.
8970 (make_timeval): New function.
8971 (set_file_times): Now sets ns-resolution time stamps.
8972 New arg FD; all uses changed.
8973 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8974 (system_process_attributes):
8975 Now returns ns-resolution time stamp. All uses changed.
8976 Check for time stamp overflow.
8977
8978 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8979 provides a substitute now.
8980
8981 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8982 since it guarantees struct timespec.
8983 (EMACS_TIME): Now struct timespec, so that we can support
8984 ns-resolution time stamps.
8985 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8986 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8987 (EMACS_USECS): Remove.
8988 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8989 so multiply the arg by 1000 before storing it.
8990 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8991 New macros.
8992 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8993 Port to ns-resolution time stamps.
8994 (EMACS_TIME_NEG_P): Remove; replaced by....
8995 (EMACS_TIME_SIGN): New macro.
8996 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8997 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8998 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8999 (make_timeval, make_lisp_time, decode_time_components): New decls.
9000 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
9001 that it mishandled time_t overflow. You can't compare by subtracting!
9002 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
9003 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
9004
9005 * term.c: Include <sys/time.h>.
9006 (timeval_to_Time): New function, for proper overflow wraparound.
9007 (term_mouse_position, term_mouse_click): Use it.
9008
9009 * undo.c (record_first_change): Support higher-resolution time stamps
9010 in the undo buffer.
9011 (Fprimitive_undo): Use them when restoring time stamps.
9012
9013 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
9014 (w32_get_internal_run_time):
9015 Port to higher-resolution Emacs time stamps.
9016 (ltime): Now accepts single 64-bit integer, as that's more convenient
9017 for callers.
9018
9019 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
9020
9021 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
9022 for compatibility with pselect. Support ns-resolution time stamps.
9023
9024 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
9025
9026 * xselect.c (wait_for_property_change, x_get_foreign_selection):
9027 Check for time stamp overflow, and support ns-resolution time stamps.
9028
9029 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
9030 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
9031 (timeval_subtract): Remove; no longer needed.
9032 (XTflash, XTring_bell, x_wait_for_event):
9033 Port to ns-resolution time stamps. Don't assume time_t is signed.
9034
9035 2012-06-22 Chong Yidong <cyd@gnu.org>
9036
9037 * xdisp.c (x_consider_frame_title): Revert last change.
9038
9039 2012-06-22 Eli Zaretskii <eliz@gnu.org>
9040
9041 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
9042 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
9043 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
9044 staticidx goes up to 1597 out of 1600 = 0x640.)
9045
9046 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
9047
9048 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
9049 Otherwise, the umask might be mistakenly 0 while handling input signals.
9050
9051 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
9052
9053 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
9054
9055 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
9056
9057 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
9058 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
9059 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
9060 access to `contents' member of Lisp_Vector objects with AREF and ASET
9061 where appropriate.
9062
9063 2012-06-19 Chong Yidong <cyd@gnu.org>
9064
9065 * frame.c (delete_frame): When selecting a frame on a different
9066 text terminal, do not alter the terminal's top-frame.
9067
9068 * xdisp.c (format_mode_line_unwind_data): Record the target
9069 frame's selected window and its terminal's top-frame.
9070 (unwind_format_mode_line): Restore them.
9071 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
9072 Callers changed.
9073 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
9074 since tty frames can be explicitly named.
9075 (prepare_menu_bars): Likewise.
9076
9077 * term.c (Ftty_top_frame): New function.
9078
9079 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9080
9081 Port byte-code-meter to modern targets.
9082 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
9083 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
9084 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
9085 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
9086 (METER_1, METER_2): Simplify.
9087
9088 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
9089
9090 * data.c (Fdefalias): Return `symbol' (bug#11686).
9091
9092 2012-06-18 Martin Rudalics <rudalics@gmx.at>
9093
9094 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
9095 gets killed during executing of this function (Bug#11665).
9096 Try to always return Qt when the buffer has been actually killed.
9097 (Vkill_buffer_query_functions): In doc-string say that functions
9098 run by this hook should not change the current buffer.
9099
9100 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9101
9102 Fix recently-introduced process.c problems found by static checking.
9103 * process.c (write_queue_push, write_queue_pop, send_process):
9104 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
9105 (write_queue_pop): Fix pointer signedness problem.
9106 (send_process): Remove unused local.
9107
9108 2012-06-17 Chong Yidong <cyd@gnu.org>
9109
9110 * xdisp.c (redisplay_internal): No need to redisplay terminal
9111 frames that are not on top.
9112
9113 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
9114
9115 * process.c (make_process): Initialize write_queue.
9116 (write_queue_push, write_queue_pop): New functions.
9117 (send_process): Use them to maintain correct ordering of process
9118 writes (Bug#10815).
9119
9120 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
9121
9122 * lisp.h (eassert): Assume C89 or later.
9123 This removes the need for CHECK.
9124 (CHECK): Remove. Its comments about always evaluating its
9125 argument were confusing, as 'eassert' typically does not evaluate
9126 its argument.
9127
9128 * coding.c (produce_chars): Use ptrdiff_t, not int.
9129
9130 * xterm.c (x_draw_underwave): Check for integer overflow.
9131 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
9132
9133 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
9134
9135 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
9136 referenced (Bug#11583).
9137
9138 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
9139
9140 Implement wave-style variant of underlining.
9141 * dispextern.h (face_underline_type): New enum.
9142 (face): Add field for underline type.
9143 * nsterm.m (ns_draw_underwave): New function.
9144 (ns_draw_text_decoration): Use it.
9145 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
9146 New functions.
9147 (x_draw_glyph_string): Use them.
9148 * xfaces.c (Qline, Qwave): New Lisp objects.
9149 (check_lface_attrs, merge_face_ref)
9150 (Finternal_set_lisp_face_attribute, realize_x_face):
9151 Handle wave-style underline face attributes.
9152 * xterm.c (x_draw_underwave): New function.
9153 (x_draw_glyph_string): Use it.
9154
9155 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
9156
9157 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
9158 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
9159 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
9160 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
9161 ($(BLD)/w32select.$(O)): Update dependencies.
9162
9163 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9164
9165 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
9166 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
9167 * character.c (_fetch_multibyte_char_p): Remove.
9168 * alloc.c: Include "character.h" before "buffer.h".
9169 * bidi.c: Likewise.
9170 * buffer.c: Likewise.
9171 * bytecode.c: Likewise.
9172 * callint.c: Likewise.
9173 * callproc.c: Likewise.
9174 * casefiddle.c: Likewise.
9175 * casetab.c: Likewise.
9176 * category.c: Likewise.
9177 * cmds.c: Likewise.
9178 * coding.c: Likewise.
9179 * composite.c: Likewise.
9180 * dired.c: Likewise.
9181 * dispnew.c: Likewise.
9182 * doc.c: Likewise.
9183 * dosfns.c: Likewise.
9184 * editfns.c: Likewise.
9185 * emacs.c: Likewise.
9186 * fileio.c: Likewise.
9187 * filelock.c: Likewise.
9188 * font.c: Likewise.
9189 * fontset.c: Likewise.
9190 * fringe.c: Likewise.
9191 * indent.c: Likewise.
9192 * insdel.c: Likewise.
9193 * intervals.c: Likewise.
9194 * keyboard.c: Likewise.
9195 * keymap.c: Likewise.
9196 * lread.c: Likewise.
9197 * macros.c: Likewise.
9198 * marker.c: Likewise.
9199 * minibuf.c: Likewise.
9200 * nsfns.m: Likewise.
9201 * nsmenu.m: Likewise.
9202 * print.c: Likewise.
9203 * process.c: Likewise.
9204 * regex.c: Likewise.
9205 * region-cache.c: Likewise.
9206 * search.c: Likewise.
9207 * syntax.c: Likewise.
9208 * term.c: Likewise.
9209 * textprop.c: Likewise.
9210 * undo.c: Likewise.
9211 * unexsol.c: Likewise.
9212 * w16select.c: Likewise.
9213 * w32fns.c: Likewise.
9214 * w32menu.c: Likewise.
9215 * window.c: Likewise.
9216 * xdisp.c: Likewise.
9217 * xfns.c: Likewise.
9218 * xmenu.c: Likewise.
9219 * xml.c: Likewise.
9220 * xselect.c: Likewise.
9221
9222 2012-06-16 Eli Zaretskii <eliz@gnu.org>
9223
9224 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
9225 If all the glyphs of the glyph row came from strings, and we have no
9226 cursor positioning clues, put the cursor on the first glyph of the
9227 row.
9228 (handle_face_prop): Use chunk-relative overlay string index when
9229 indexing into it->string_overlays array. (Bug#11653)
9230 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
9231 the rightmost. (Bug#11720)
9232
9233 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9234
9235 * category.h (CHAR_HAS_CATEGORY): Define as inline.
9236 (CATEGORY_MEMBER): Enforce 1/0 value.
9237 * category.c (_temp_category_set): Remove.
9238
9239 2012-06-16 Eli Zaretskii <eliz@gnu.org>
9240
9241 * window.c (Fdelete_other_windows_internal)
9242 (Fdelete_window_internal): Don't access frame's mouse highlight
9243 info of the initial frame. (Bug#11677)
9244
9245 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
9246
9247 * .gdbinit (xgetint): Fix recently-introduced paren typo.
9248 Assume USE_2_TAGS_FOR_INTS.
9249 (xreload): Adjust $tagmask width to match recent lisp.h change.
9250
9251 Simplify lisp.h in minor ways that should not affect code.
9252 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
9253 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
9254 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
9255 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
9256 (INTTYPEBITS): New macro, for clarity.
9257 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
9258 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
9259 Simplify now that USE_LSB_TAG is always defined.
9260 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
9261 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
9262
9263 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
9264
9265 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
9266
9267 2012-06-13 Glenn Morris <rgm@gnu.org>
9268
9269 * s/bsd-common.h (BSD4_3):
9270 * s/usg5-4-common.h (USG5_4): No longer define; unused.
9271
9272 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
9273
9274 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
9275 instead of union.
9276 (XLI, XIL): Define.
9277 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
9278 Use them.
9279 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
9280 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
9281 * alloc.c (widen_to_Lisp_Object): Remove.
9282 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
9283 * frame.c (delete_frame): Remove outdated comment.
9284 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
9285 USE_LISP_UNION_TYPE.
9286 (Fw32_unregister_hot_key): Likewise.
9287 (Fw32_toggle_lock_key): Likewise.
9288 * w32menu.c (add_menu_item): Likewise.
9289 (w32_menu_display_help): Use XIL instead of checking
9290 USE_LISP_UNION_TYPE.
9291 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
9292 (init_heap): Likewise.
9293 * w32term.c (w32_read_socket): Update comment.
9294
9295 2012-06-13 Glenn Morris <rgm@gnu.org>
9296
9297 * s/usg5-4-common.h, src/s/unixware.h:
9298 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
9299
9300 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
9301
9302 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
9303
9304 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
9305 * alloc.c (make_number) [!defined make_number]:
9306 Remove, as lisp.h always defines this now.
9307 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
9308 (roundup_size): Verify that it is a power of 2.
9309 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
9310 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
9311 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
9312 -DUSE_LSB_TAG=0, to override the automatically-selected default.
9313 USE_LSB_TAG now is always defined to be either 0 or 1.
9314 All uses changed.
9315 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
9316 code works fine either way, and efficiency is not a concern here,
9317 as the union type is for debugging, not for production.
9318 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
9319 Use an inline function on all platforms when using the union type,
9320 since this is simpler and 'static inline' can be used portably
9321 within Emacs now.
9322 (LISP_INITIALLY_ZERO): New macro.
9323 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
9324 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
9325
9326 2012-06-12 Glenn Morris <rgm@gnu.org>
9327
9328 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
9329
9330 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
9331
9332 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
9333 Move BROKEN_SIGIO to configure.
9334
9335 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
9336 Move NO_TERMIO to configure.
9337
9338 2012-06-12 Chong Yidong <cyd@gnu.org>
9339
9340 * image.c (imagemagick_load_image): Use MagickFlattenImage if
9341 MagickMergeImageLayers is undefined. Use pixel pusher loop if
9342 MagickExportImagePixels is undefined.
9343
9344 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
9345
9346 * image.c (imagemagick_load_image): Remove unused label.
9347
9348 2012-06-11 Glenn Morris <rgm@gnu.org>
9349
9350 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9351 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
9352 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
9353 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
9354
9355 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
9356
9357 * alloc.c (make_byte_code): New function.
9358 (Fmake_byte_code): Use it. Don't purify here.
9359 * lread.c (read1): Use it as well to avoid extra allocation.
9360
9361 2012-06-11 Chong Yidong <cyd@gnu.org>
9362
9363 * image.c (imagemagick_load_image): Implement transparency.
9364
9365 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
9366
9367 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
9368 account for preceding backslashes. (Bug#11663)
9369
9370 2012-06-09 Chong Yidong <cyd@gnu.org>
9371
9372 * term.c: Support italics in capable terminals (Bug#9652).
9373 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
9374 (turn_on_face): Output using TS_enter_italic_mode if available.
9375 Don't handle unused blinking and alt-charset cases.
9376 (turn_off_face): Handle italic case; discard unused tty_blinking_p
9377 and tty_alt_charset_p cases.
9378 (tty_capable_p, init_tty): Support italics.
9379
9380 * termchar.h (struct tty_display_info): Add field for italics.
9381 Remove unused blink field.
9382
9383 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
9384 Handle slant.
9385
9386 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
9387 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
9388 tty_alt_charset_p. Add tty_italic_p.
9389
9390 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
9391
9392 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9393 dbus_type_is_basic if available.
9394 (xd_extract_signed, xd_extract_unsigned): Rename from
9395 extract_signed and extract_unsigned, respectively. Adapt callers.
9396
9397 2012-06-09 Chong Yidong <cyd@gnu.org>
9398
9399 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9400
9401 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9402 case (Bug#9752).
9403
9404 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9405
9406 * xdisp.c (vmessage): Treat frame message as multibyte.
9407 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9408 would generate the diagnostic "Making \302\247 buffer-local while
9409 let-bound!".
9410
9411 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9412
9413 * dispnew.c (showing_window_margins_p): Undo last change, which
9414 was done due to an inadvertent commit.
9415 (adjust_frame_glyphs_for_frame_redisplay): Do call
9416 showing_window_margins_p.
9417
9418 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9419
9420 * eval.c (Fmake_var_non_special): New primitive.
9421 (syms_of_eval): Defsubr it.
9422 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9423
9424 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
9425
9426 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9427 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9428
9429 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9430
9431 * alloc.c (allocate_vectorlike): Fix last change.
9432
9433 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9434
9435 Block-based vector allocation of small vectors.
9436 * lisp.h (struct vectorlike_header): New field `nbytes',
9437 adjust comment accordingly.
9438 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
9439 to denote vector blocks. Adjust users (live_vector_p,
9440 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9441 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9442 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9443 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9444 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9445 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9446 (roundup_size): New constant.
9447 (struct vector_block): New data type.
9448 (vector_blocks, vector_free_lists, zero_vector): New variables.
9449 (all_vectors): Rename to `large_vectors'.
9450 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9451 (sweep_vectors): New functions.
9452 (allocate_vectorlike): Return `zero_vector' as the only vector of
9453 0 items. Allocate new vector from block if vector size is less than
9454 or equal to VBLOCK_BYTES_MAX.
9455 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9456 (init_alloc_once): Add call to init_vectors.
9457
9458 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9459
9460 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9461
9462 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9463
9464 * doprnt.c (doprnt): Truncate multibyte char correctly.
9465 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9466 would mishandle a string argument "Xc" if X was a multibyte
9467 character of length 2: it would truncate after X's first byte
9468 rather than including all of X.
9469
9470 2012-06-06 Chong Yidong <cyd@gnu.org>
9471
9472 * buffer.c (word_wrap): Doc fix.
9473
9474 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9475
9476 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9477
9478 2012-06-03 Glenn Morris <rgm@gnu.org>
9479
9480 * xdisp.c (tool-bar-style): Doc fix.
9481
9482 2012-06-03 Ulrich Müller <ulm@gentoo.org>
9483
9484 * Makefile.in (PAXCTL): Define.
9485 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9486 binary via PaX flags if the paxctl utility is available.
9487 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9488 Restore PaX flags to their default. (Bug#11398)
9489
9490 2012-06-03 Chong Yidong <cyd@gnu.org>
9491
9492 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9493 buffer (Bug#11226).
9494
9495 2012-06-03 Chong Yidong <cyd@gnu.org>
9496
9497 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9498 (note_mode_line_or_margin_highlight): If there is no help echo,
9499 use mode-line-default-help-echo. Handle the case where the mouse
9500 position is past the end of the mode line string.
9501
9502 * buffer.c (buffer_local_value_1): New function, split from
9503 Fbuffer_local_value; can return Qunbound.
9504 (Fbuffer_local_value): Use it.
9505 (Vmode_line_format): Docstring tweaks.
9506
9507 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9508
9509 * sysdep.c (system_process_attributes): Improve comment.
9510
9511 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9512
9513 * keyboard.c: Export real-this-command to Elisp.
9514 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9515 and DEFVAR it. Update all users.
9516
9517 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9518
9519 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9520
9521 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9522 Convert pctcpu and pctmem to Lisp float properly.
9523 Let the compiler fold better, as 100.0/0x8000 is exact.
9524
9525 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9526
9527 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9528 cons_block.
9529
9530 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9531
9532 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9533
9534 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9535
9536 For a 'struct window', replace some Lisp_Object fields to
9537 bitfields where appropriate, remove unused fields.
9538 * window.h (struct window): Remove unused 'last_mark_x' and
9539 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
9540 change its type from Lisp_Object to bitfield.
9541 Change type of 'force_start', 'optional_new_start',
9542 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
9543 fields from Lisp_Object to bitfield. Adjust users accordingly.
9544
9545 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9546
9547 Pacify gcc -Wdouble-precision when using Xaw.
9548 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9549 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9550 Use 'float' consistently, rather than 'float' in most places
9551 and 'double' in a couple of places.
9552
9553 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9554
9555 * xdisp.c (handle_stop): Detect whether we have overlay strings
9556 loaded by testing it->current.overlay_string_index to be
9557 non-negative, instead of checking whether n_overlay_strings is
9558 positive. (Bug#11587)
9559
9560 2012-05-31 Chong Yidong <cyd@gnu.org>
9561
9562 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9563
9564 * doc.c (Fsubstitute_command_keys): Doc fix.
9565
9566 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9567
9568 * search.c (search_buffer): Remove calls to
9569 r_alloc_inhibit_buffer_relocation, as it is now called by
9570 maybe_unify_char, which was the cause of relocation of buffer text
9571 in bug#11519.
9572
9573 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9574
9575 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9576 for the duration of call to load_charset, to avoid problems with
9577 callers of maybe_unify_char that access buffer text through C
9578 pointers.
9579
9580 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9581 decrement the inhibition flag, instead of just setting or
9582 resetting it.
9583
9584 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9585
9586 Remove obsolete '#define static' cruft.
9587 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9588 This #undef was "temporary" in 2000; it is no longer needed
9589 now that '#define static' has gone away.
9590 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9591 (gray_bitmap_bits): Remove; no longer needed.
9592 All uses replaced with definiens.
9593 * xterm.c: Include "bitmaps/gray.xbm".
9594
9595 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9596
9597 Clean up __executable_start, monstartup when --enable-profiling.
9598 The following changes affect the code only when profiling.
9599 * dispnew.c (__executable_start): Rename from safe_bcopy.
9600 Define only on platforms that need it.
9601 * emacs.c: Include <sys/gmon.h> when profiling.
9602 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9603 (__executable_start): Remove decl, since lisp.h does it now.
9604 (safe_bcopy): Remove decl; no longer has that name.
9605 (main): Coalesce #if into single bit of code, for simplicity.
9606 Cast pointers to uintptr_t, since standard libraries want integers
9607 and not pointers.
9608 * lisp.h (__executable_start): New decl.
9609
9610 2012-05-31 Glenn Morris <rgm@gnu.org>
9611
9612 * image.c (Fimagemagick_types): Doc fix.
9613
9614 2012-05-30 Jim Meyering <meyering@redhat.com>
9615
9616 * callproc.c (Fcall_process_region): Include directory component
9617 in mkstemp error message (Bug#11586).
9618
9619 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9620
9621 * alloc.c, lisp.h (make_pure_vector): Now static.
9622
9623 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9624
9625 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9626 Move to byte-run.el.
9627 (Fautoload): Do the hash-doc more carefully.
9628 * data.c (Fdefalias): Purify definition, except for keymaps.
9629 (Qdefun): Move from eval.c.
9630 * lisp.h (Qdefun): Remove.
9631 * lread.c (read1): Tiny simplification.
9632
9633 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
9634
9635 Do not create empty overlays with the evaporate property (Bug#9642).
9636 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9637 Bug#9642, but explicitly check that the buffer the overlay would
9638 be moved to is live and rearrange lines to make sure that errors
9639 will not put the overlay in an inconsistent state.
9640 (Fdelete_overlay): Cosmetics.
9641
9642 2012-05-28 Eli Zaretskii <eliz@gnu.org>
9643
9644 * w32term.c (my_bring_window_to_top): New function.
9645 (x_raise_frame): Use handle returned by DeferWindowPos, which
9646 could be different from the original one.
9647 Call my_bring_window_to_top instead of my_set_foreground_window.
9648 (Bug#11513)
9649
9650 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9651 by calling BringWindowToTop.
9652
9653 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9654 (WM_EMACS_END): Increase by one.
9655
9656 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9657
9658 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9659 This avoids undefined behavior that might cause the eassert
9660 to not catch an out-of-range value.
9661
9662 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
9663
9664 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9665 Update dependencies.
9666
9667 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9668
9669 * bidi.c (bidi_mirror_char): Fix last change.
9670
9671 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9672
9673 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9674 when referring to sectname field in printf format.
9675
9676 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9677
9678 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9679 Only r_alloc_inhibit_buffer_relocation needed to be added;
9680 the others were already declared.
9681
9682 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9683 before checking whether it's out of range. Put the check inside
9684 eassert. See
9685 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9686
9687 2012-05-27 Ken Brown <kbrown@cornell.edu>
9688
9689 * callproc.c (Fcall_process): Restore a line that was accidentally
9690 commented out in the 2011-02-13 change (bug#11547).
9691
9692 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9693
9694 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9695 defined on ralloc.c.
9696
9697 * buffer.c [REL_ALLOC]: Remove prototypes of
9698 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9699 they are now on lisp.h.
9700
9701 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9702
9703 * search.c (search_buffer): Use it to inhibit relocation of buffer
9704 text while re_search_2 is doing its job, because re_search_2 is
9705 passed C pointers to buffer text. (Bug#11519)
9706
9707 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9708 Update value to 24.
9709
9710 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9711 state after an additional call to move_it_in_display_line_to, keep
9712 the values of it->max_ascent and it->max_descent found for the
9713 entire line.
9714 (pos_visible_p): Revert the comparison against bottom_y to what it
9715 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9716 (Bug#11464)
9717
9718 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9719
9720 Fix coding-related core dumps with gcc -ftrapv.
9721 The code was computing A - B, where A and B are pointers, and B is
9722 random garbage. This can lead to core dumps on platforms that
9723 have special pointer registers, and it also leads to core dumps on
9724 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9725 A - B only when B is initialized properly.
9726 * coding.c (coding_set_source, coding_set_destination): Return void.
9727 (coding_change_source, coding_change_destinations): New functions,
9728 with the old behaviors of coding_set_source and coding_set_destination.
9729 All callers that need an offset changed to use these new functions.
9730
9731 2012-05-26 Glenn Morris <rgm@gnu.org>
9732
9733 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9734
9735 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9736
9737 Extend mouse support on W32 text-mode console.
9738 * xdisp.c (draw_row_with_mouse_face):
9739 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9740
9741 * w32console.c: Include window.h.
9742 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9743 New functions.
9744 (initialize_w32_display): Initialize mouse-highlight data.
9745
9746 * w32inevt.c: Include termchar.h and window.h.
9747 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9748 moves, call note_mouse_highlight. If help_echo changed, call
9749 gen_help_event to produce help-echo message in the echo area.
9750 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9751 highlight info.
9752
9753 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9754
9755 * lread.c (read1): Simplify slightly to avoid an overflow warning
9756 with GCC 4.7.0 on x86-64.
9757
9758 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9759
9760 * bidi.c (bidi_mirror_char): Revert last change: an int is
9761 definitely wide enough here.
9762
9763 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
9764
9765 Fix integer width and related bugs (Bug#9874).
9766 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9767 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9768 (string_bytes, check_sblock, allocate_string_data):
9769 (compact_small_strings, Fmake_bool_vector, make_string)
9770 (make_unibyte_string, make_multibyte_string)
9771 (make_string_from_bytes, make_specified_string)
9772 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9773 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9774 (mark_vectorlike):
9775 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9776 (allocate_pseudovector):
9777 Use int, not EMACS_INT, where int is wide enough.
9778 (inhibit_garbage_collection, Fgarbage_collect):
9779 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9780 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9781 int might not be wide enough.
9782 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9783 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9784 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9785 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9786 (bidi_level_of_next_char, bidi_move_to_visually_next):
9787 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9788 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9789 (Fkill_buffer, Fset_buffer_major_mode)
9790 (advance_to_char_boundary, Fbuffer_swap_text)
9791 (Fset_buffer_multibyte, overlays_at, overlays_in)
9792 (overlay_touches_p, struct sortvec, record_overlay_string)
9793 (overlay_strings, recenter_overlay_lists)
9794 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9795 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9796 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9797 (Foverlay_recenter, last_overlay_modification_hooks_used)
9798 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9799 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9800 (validate_region): Omit unnecessary test for b <= e,
9801 since that's guaranteed by the previous test.
9802 (adjust_overlays_for_delete): Avoid pos + length overflow.
9803 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9804 (report_overlay_modification):
9805 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9806 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9807 Omit pointer cast, which isn't needed anyway, and doesn't work
9808 after the EMACS_INT -> ptrdiff_t change.
9809 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9810 * buffer.h: Adjust decls to match defn changes elsewhere.
9811 (struct buffer_text, struct buffer):
9812 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9813 Use EMACS_INT, not int, where int might not be wide enough.
9814 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9815 not int, to avoid needless 32-bit limit on 64-bit hosts.
9816 (exec_byte_code): Use tighter memory-full test, one that checks
9817 for alloca overflow. Don't compute the address of the object just
9818 before an array, as that's not portable. Use EMACS_INT, not
9819 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9820 * callint.c (Fcall_interactively):
9821 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9822 * callproc.c (call_process_kill, Fcall_process):
9823 Don't assume pid_t fits into an Emacs fixnum.
9824 (call_process_cleanup, Fcall_process, child_setup):
9825 Don't assume pid_t fits into int.
9826 (call_process_cleanup, Fcall_process, delete_temp_file)
9827 (Fcall_process_region):
9828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9829 (Fcall_process): Simplify handling of volatile integers.
9830 Use int, not EMACS_INT, where int will do.
9831 * casefiddle.c (casify_object, casify_region, operate_on_word)
9832 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9833 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9834 (casify_object): Avoid integer overflow when overallocating buffer.
9835 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9836 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9837 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9838 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9839 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9840 integers are now checked earlier. All uses replaced with XINT.
9841 (ccl_driver):
9842 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9843 For CCL_MapSingle, check that content and value are in int range.
9844 (ccl_driver, Fregister_code_conversion_map):
9845 Check that Vcode_version_map_vector is a vector.
9846 (resolve_symbol_ccl_program): Check that vector header is in range.
9847 Always copy the vector, so that we can check its contents reliably
9848 now rather than having to recheck each instruction as it's being
9849 executed. Check that vector words fit in 'int'.
9850 (ccl_get_compiled_code, Fregister_ccl_program)
9851 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9852 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9853 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9854 contents are in range.
9855 (Fccl_execute_on_string): Check that status is in range.
9856 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9857 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9858 Accept and return EMACS_INT, not int, because callers can pass values
9859 out of 'int' range.
9860 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9861 (multibyte_chars_in_text, parse_str_as_multibyte)
9862 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9863 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9864 (string_escape_byte8, Fget_byte):
9865 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9866 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9867 avoid mishandling large integers.
9868 * character.h: Adjust decls to match defn changes elsewhere.
9869 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9870 (Ffind_charset_region):
9871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9872 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9873 (load_charset_map_from_vector, Fdefine_charset_internal):
9874 Don't assume fixnum fits in int.
9875 (load_charset_map_from_vector, Fmap_charset_chars):
9876 Remove now-unnecessary CHECK_NATNUMs.
9877 (Fdefine_charset_internal): Check ranges here, more carefully.
9878 Don't rely on undefined behavior with signed left shift overflow.
9879 Don't assume unsigned int fits into fixnum, or that fixnum fits
9880 into unsigned int. Don't require max_code to be a valid fixnum;
9881 that's not true for gb10830 4-byte on a 32-bit host. Allow
9882 invalid_code to be a cons, for the same reason. Require code_offset
9883 to be a character. Avoid int overflow if max_char is close
9884 to INT_MAX.
9885 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9886 this is intended anyway and avoids some undefined behavior.
9887 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9888 INDEX_TO_CODE_POINT, as that's what it expects.
9889 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9890 * charset.h (DECODE_CHAR): Return int, not unsigned;
9891 this is what was intended anyway, and it avoids undefined behavior.
9892 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9893 integer-overflow issues.
9894 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9895 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9896 where the argument is EMACS_INT, and this behavior is not intended.
9897 * chartab.c (Fmake_char_table, Fset_char_table_range)
9898 (uniprop_get_decoder, uniprop_get_encoder):
9899 Don't assume fixnum fits in int.
9900 * cmds.c (move_point): New function, that does the gist of
9901 Fforward_char and Fbackward_char, but does so while checking
9902 for integer overflow more accurately.
9903 (Fforward_char, Fbackward_char): Use it.
9904 (Fforward_line, Fend_of_line, internal_self_insert)
9905 (internal_self_insert):
9906 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9907 Fix a FIXME, by checking for integer overflow when calculating
9908 target_clm and actual_clm.
9909 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9910 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9911 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9912 (coding_alloc_by_making_gap, alloc_destination)
9913 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9914 (encode_coding_utf_16, detect_coding_emacs_mule)
9915 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9916 (detect_coding_iso_2022, decode_coding_iso_2022)
9917 (encode_invocation_designation, encode_designation_at_bol)
9918 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9919 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9920 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9921 (encode_coding_ccl, encode_coding_raw_text)
9922 (detect_coding_charset, decode_coding_charset)
9923 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9924 (produce_composition, produce_charset, produce_annotation)
9925 (decode_coding, handle_composition_annotation)
9926 (handle_charset_annotation, consume_chars, decode_coding_gap)
9927 (decode_coding_object, encode_coding_object, detect_coding_system)
9928 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9929 (code_convert_region, code_convert_string)
9930 (Fdefine_coding_system_internal)
9931 (coding_set_source, coding_set_destination):
9932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9933 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9934 (Fdefine_coding_system_internal):
9935 Don't assume fixnums fit in int.
9936 (decode_coding_gap, decode_coding_object, encode_coding_object)
9937 (Fread_coding_system, Fdetect_coding_region)
9938 (Funencodable_char_position, Fcheck_coding_systems_region)
9939 (get_translation, handle_composition_annotation, consume_chars):
9940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9941 (consume_chars): Rewrite to not calculate an address outside buffer.
9942 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9943 Don't access memory outside of the args array.
9944 (Fdefine_coding_system_internal): Check for charset-id overflow.
9945 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9946 result of ENCODE_CHAR.
9947 * coding.h: Adjust decls to match defn changes elsewhere.
9948 (struct coding_system):
9949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9950 * composite.c (get_composition_id, find_composition)
9951 (run_composition_function, update_compositions)
9952 (compose_text, composition_gstring_put_cache)
9953 (composition_gstring_p, composition_gstring_width)
9954 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9955 (composition_compute_stop_pos, composition_reseat_it)
9956 (composition_update_it, struct position_record)
9957 (find_automatic_composition, composition_adjust_point)
9958 (Fcomposition_get_gstring, Ffind_composition_internal):
9959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9960 (update_compositions):
9961 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9962 * composite.h: Adjust decls to match defn changes elsewhere.
9963 (struct composition):
9964 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9965 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9966 Do not attempt to compute the address of the object just before a
9967 buffer; this is not portable.
9968 (Faref, Faset):
9969 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9970 (Faset): Use int, not EMACS_INT, where int is wide enough.
9971 (Fstring_to_number): Don't assume fixnums fit in int.
9972 (Frem): Don't assume arg is nonnegative.
9973 * dbusbind.c (xd_append_arg): Check for integers out of range.
9974 (Fdbus_call_method): Don't overflow the timeout int.
9975 (extract_signed, extract_unsigned): New functions.
9976 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9977 (xd_get_connection_references): Return ptrdiff_t, not int.
9978 All uses changed.
9979 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9980 (xd_read_message_1):
9981 Use int, not unsigned, where the dbus API uses int.
9982 (Fdbus_message_internal): Don't overflow mtype.
9983 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9984 * dired.c (directory_files_internal, file_name_completion, scmp)
9985 (file_name_completion_stat):
9986 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9987 (file_name_completion): Don't overflow matchcount.
9988 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9989 * dispextern.h: Adjust decls to match defn changes elsewhere.
9990 (struct text_pos, struct glyph, struct bidi_saved_info)
9991 (struct bidi_string_data, struct bidi_it, struct composition_it)
9992 (struct it):
9993 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9994 (struct display_pos, struct composition_it, struct it):
9995 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9996 * dispnew.c (increment_matrix_positions)
9997 (increment_row_positions, mode_line_string)
9998 (marginal_area_string):
9999 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10000 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
10001 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10002 (duration_to_sec_usec): New function, to check for overflow better.
10003 (Fsleep_for, sit_for): Use it.
10004 * doc.c (get_doc_string, store_function_docstring):
10005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10006 (get_doc_string, Fsnarf_documentation):
10007 Use int, not EMACS_INT, where int is wide enough.
10008 (get_doc_string):
10009 Use SAFE_ALLOCA, not alloca.
10010 Check for overflow when converting EMACS_INT to off_t.
10011 * doprnt.c (doprnt):
10012 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10013 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
10014 Don't assume uid_t fits into fixnum.
10015 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
10016 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
10017 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
10018 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
10019 (general_insert_function)
10020 (Finsert_char, make_buffer_string, make_buffer_string_both)
10021 (update_buffer_properties, Fbuffer_substring)
10022 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
10023 (Fsubst_char_in_region, check_translation)
10024 (Ftranslate_region_internal, save_restriction_restore, Fformat)
10025 (transpose_markers, Ftranspose_regions):
10026 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10027 (clip_to_bounds): Move to lisp.h as an inline function).
10028 (Fconstrain_to_field): Don't assume integers are nonnegative.
10029 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
10030 (Fsubst_char_in_region, Fsave_restriction):
10031 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10032 (Femacs_pid): Don't assume pid_t fits into fixnum.
10033 (lo_time): Use int, not EMACS_INT, when int suffices.
10034 (lisp_time_argument): Check for usec out of range.
10035 (Fencode_time): Don't assume fixnum fits in int.
10036 (Fuser_login_name, Fuser_full_name): Signal an error
10037 if a uid argument is out of range, rather than relying on
10038 undefined behavior.
10039 (Fformat_time_string): Remove now-unnecessary check.
10040 lisp_time_argument checks for out-of-range usec now.
10041 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
10042 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
10043 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
10044 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
10045 (init_cmdargs, Fdump_emacs):
10046 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10047 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
10048 the bottom (typically) 32 bits of the fixnum.
10049 * eval.c (specpdl_size, call_debugger):
10050 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10051 (when_entered_debugger, Fbacktrace_debug):
10052 Don't assume fixnum can fit in int.
10053 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
10054 the object just before a buffer; this is not portable.
10055 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
10056 (grow_specpdl, unbind_to):
10057 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10058 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
10059 (grow_specpdl): Simplify allocation by using xpalloc.
10060 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
10061 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
10062 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
10063 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10064 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
10065 (a_write, e_write):
10066 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10067 (Fcopy_file, non_regular_nbytes, read_non_regular)
10068 (Finsert_file_contents):
10069 Use int, not EMACS_INT, where int is wide enough.
10070 (READ_BUF_SIZE): Verify that it fits in int.
10071 (Finsert_file_contents): Check that counts are in proper range,
10072 rather than assuming fixnums fit into ptrdiff_t etc.
10073 Don't assume fixnums fit into int.
10074 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
10075 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
10076 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
10077 (string_char_to_byte, string_byte_to_char)
10078 (string_make_multibyte, string_to_multibyte)
10079 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
10080 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
10081 (substring_both, Fdelete, internal_equal, Ffillarray)
10082 (Fclear_string, mapcar1)
10083 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
10084 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
10085 (larger_vector, make_hash_table, maybe_resize_hash_table)
10086 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
10087 (Fmaphash, secure_hash):
10088 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10089 (concat): Check for string index and length overflow.
10090 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
10091 (Frequire):
10092 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10093 (larger_vector): New API (vec, incr_min, size_max) replaces old
10094 one (vec, new_size, init). This catches size overflow.
10095 INIT was removed because it was always Qnil.
10096 All callers changed.
10097 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
10098 the upper bound on a hash table index size.
10099 (make_hash_table, maybe_resize_hash_table): Use it.
10100 (secure_hash): Computer start_byte and end_byte only after
10101 they're known to be in ptrdiff_t range.
10102 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
10103 (Ffont_get_glyphs, Ffont_at):
10104 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10105 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
10106 (Flist_fonts, Fopen_font):
10107 Don't assume fixnum can fit in int.
10108 (check_gstring): Don't assume index can fit in int.
10109 (font_match_p): Check that fixnum is a character, not a nonnegative
10110 fixnum, since the later code needs to stuff it into an int.
10111 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
10112 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
10113 conversion overflow issues.
10114 (Fopen_font): Check for integer out of range.
10115 (Ffont_get_glyphs): Don't assume index can fit in int.
10116 * font.h: Adjust decls to match defn changes elsewhere.
10117 * fontset.c (reorder_font_vector): Redo score calculation to avoid
10118 integer overflow.
10119 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
10120 printmax_t, where ptrdiff_t is wide enough.
10121 (Finternal_char_font):
10122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10123 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
10124 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
10125 (Fset_frame_position, x_set_frame_parameters)
10126 (x_set_line_spacing, x_set_border_width)
10127 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
10128 Check that fixnums are in proper range for system types.
10129 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
10130 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10131 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
10132 Use SAFE_ALLOCA_LISP, not alloca.
10133 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
10134 intptr_t is wide enough.
10135 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
10136 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
10137 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
10138 Check for fixnum out of range.
10139 * ftfont.c (ftfont_list): Don't assume index fits in int.
10140 Check that fixnums are in proper range for system types.
10141 (ftfont_shape_by_flt):
10142 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10143 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10144 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10145 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
10146 Check that fixnums are in proper range for system types.
10147 * gnutls.h: Adjust decls to match defn changes elsewhere.
10148 * gtkutil.c (xg_dialog_run):
10149 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10150 (update_frame_tool_bar):
10151 Check that fixnums are in proper range for system types.
10152 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
10153 (lookup_image): Check that fixnums are in range for system types.
10154 * indent.c (last_known_column, last_known_column_point):
10155 (current_column_bol_cache):
10156 (skip_invisible, current_column, check_display_width):
10157 (check_display_width, scan_for_column, current_column_1)
10158 (Findent_to, Fcurrent_indentation, position_indentation)
10159 (indented_beyond_p, Fmove_to_column, compute_motion):
10160 (Fcompute_motion, Fvertical_motion):
10161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10162 (last_known_column_modified): Use EMACS_INT, not int.
10163 (check_display_width):
10164 (Fcompute_motion):
10165 Check that fixnums and floats are in proper range for system types.
10166 (compute_motion): Don't assume index or fixnum fits in int.
10167 (compute_motion, Fcompute_motion):
10168 Use int, not EMACS_INT, when it is wide enough.
10169 (vmotion): Omit local var start_hpos that is always 0; that way
10170 we don't need to worry about overflow in expressions involving it.
10171 * indent.h: Adjust decls to match defn changes elsewhere.
10172 (struct position):
10173 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10174 Use int, not EMACS_INT, where int is wide enough.
10175 Remove unused members ovstring_chars_done and tab_offset;
10176 all uses removed.
10177 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
10178 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
10179 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
10180 (make_gap, copy_text, insert, insert_and_inherit)
10181 (insert_before_markers, insert_before_markers_and_inherit)
10182 (insert_1, count_combining_before, count_combining_after)
10183 (insert_1_both, insert_from_string)
10184 (insert_from_string_before_markers, insert_from_string_1)
10185 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
10186 (adjust_after_replace, adjust_after_insert, replace_range)
10187 (replace_range_2, del_range, del_range_1, del_range_byte)
10188 (del_range_both, del_range_2, modify_region)
10189 (prepare_to_modify_buffer, signal_before_change)
10190 (signal_after_change, Fcombine_after_change_execute):
10191 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10192 * intervals.c (traverse_intervals, rotate_right, rotate_left)
10193 (balance_an_interval, split_interval_right, split_interval_left)
10194 (find_interval, next_interval, update_interval)
10195 (adjust_intervals_for_insertion, delete_node, delete_interval)
10196 (interval_deletion_adjustment, adjust_intervals_for_deletion)
10197 (static_offset_intervals, offset_intervals)
10198 (merge_interval_right, merge_interval_left, make_new_interval)
10199 (graft_intervals_into_buffer, temp_set_point_both)
10200 (temp_set_point, set_point, adjust_for_invis_intang)
10201 (set_point_both, move_if_not_intangible, get_property_and_range)
10202 (get_local_map, copy_intervals, copy_intervals_to_string)
10203 (compare_string_intervals, set_intervals_multibyte_1):
10204 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10205 * intervals.h: Adjust decls to match defn changes elsewhere.
10206 (struct interval):
10207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10208 * keyboard.c (this_command_key_count, this_single_command_key_start)
10209 (before_command_key_count, before_command_echo_length, echo_now)
10210 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
10211 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
10212 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
10213 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
10214 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10215 (last_non_minibuf_size, last_point_position, echo_truncate)
10216 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
10217 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
10218 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
10219 (stuff_buffered_input):
10220 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10221 (last_auto_save, command_loop_1, read_char):
10222 Use EMACS_INT, not int, to avoid integer overflow.
10223 (record_char): Avoid overflow in total_keys computation.
10224 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
10225 * keyboard.h: Adjust decls to match defn changes elsewhere.
10226 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
10227 (Fkey_description, Fdescribe_vector, Flookup_key):
10228 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10229 (click_position): New function, to check that positions are in range.
10230 (Fcurrent_active_maps):
10231 (describe_command):
10232 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10233 (Faccessible_keymaps, Fkey_description):
10234 (preferred_sequence_p):
10235 Don't assume fixnum can fit into int.
10236 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
10237 Check for integer overflow in size calculations.
10238 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
10239 avoid mishandling large integers.
10240 * lisp.h: Adjust decls to match defn changes elsewhere.
10241 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
10242 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
10243 (struct Lisp_Marker):
10244 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10245 (clip_to_bounds): Now an inline function, moved here from editfns.c.
10246 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
10247 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
10248 All callers changed.
10249 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
10250 Assume the arg has valid form, since it always does.
10251 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
10252 unsigned integer system type.
10253 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
10254 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
10255 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10256 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
10257 (duration_to_sec_usec): New decl.
10258 * lread.c (read_from_string_index, read_from_string_index_byte)
10259 (read_from_string_limit, readchar, unreadchar, openp)
10260 (read_internal_start, read1, oblookup):
10261 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10262 (Fload, readevalloop, Feval_buffer, Feval_region):
10263 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10264 (openp): Check for out-of-range argument to 'access'.
10265 (read1): Use int, not EMACS_INT, where int is wide enough.
10266 Don't assume fixnum fits into int.
10267 Fix off-by-one error that can read outside a buffer.
10268 (read_filtered_event): Use duration_to_sec_usec
10269 to do proper overflow checking on durations.
10270 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
10271 in size calculation.
10272 (Fexecute_kbd_macro):
10273 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10274 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
10275 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
10276 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
10277 (set_marker_both, set_marker_restricted_both, marker_position)
10278 (marker_byte_position, Fbuffer_has_markers_at):
10279 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10280 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
10281 * menu.c (ensure_menu_items): Rename from grow_menu_items.
10282 It now merely ensures that the menu is large enough, without
10283 necessarily growing it, as this avoids some integer overflow issues.
10284 All callers changed.
10285 (keymap_panes, parse_single_submenu, Fx_popup_menu):
10286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10287 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
10288 Use SAFE_ALLOCA_LISP, not alloca.
10289 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
10290 to EMACS_INT. Check that fixnums are in proper range for system types.
10291 * minibuf.c (minibuf_prompt_width, string_to_object)
10292 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
10293 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
10294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10295 (get_minibuffer, read_minibuf_unwind):
10296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10297 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
10298 this simplifies overflow checking. All callers changed.
10299 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
10300 (Ftest_completion):
10301 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10302 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
10303 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
10304 Check that fixnums are in proper range for system types.
10305 (Fx_create_frame, Fx_show_tip):
10306 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10307 * nsfont.m (ns_findfonts, nsfont_list_family):
10308 Don't assume fixnum fits in long.
10309 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
10310 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10311 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
10312 wide enough.
10313 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
10314 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10315 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
10316 (PRINTDECLARE, PRINTPREPARE):
10317 (strout, print_string):
10318 (print, print_preprocess, print_check_string_charset_prop)
10319 (print_object):
10320 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10321 (PRINTDECLARE):
10322 (temp_output_buffer_setup, Fprin1_to_string, print_object):
10323 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10324 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
10325 (printchar, strout): Use xpalloc to catch size calculation overflow.
10326 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
10327 (print_error_message): Use SAFE_ALLOCA, not alloca.
10328 (print_object): Use int, not EMACS_INT, where int is wide enough.
10329 (print_depth, new_backquote_output, print_number_index):
10330 Use ptrdiff_t, not int, where int might not be wide enough.
10331 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
10332 (Fset_process_window_size, Fformat_network_address)
10333 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
10334 (sigchld_handler):
10335 Check that fixnums are in proper range for system types.
10336 (Fsignal_process): Simplify by avoiding a goto.
10337 Check for process-ids out of pid_t range rather than relying on
10338 undefined behavior.
10339 (process_tick, update_tick): Use EMACS_INT, not int.
10340 (Fformat_network_address, read_process_output, send_process)
10341 (Fprocess_send_region, status_notify):
10342 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10343 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
10344 (wait_reading_process_output, read_process_output, exec_sentinel):
10345 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10346 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
10347 (Faccept_process_output): Use duration_to_sec_usec to do proper
10348 overflow checking on durations.
10349 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
10350 Don't assume pid_t fits in int.
10351 * process.h (struct Lisp_Process): Members tick and update_tick
10352 are now of type EMACS_INT, not int.
10353 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
10354 configured --with-wide-int.
10355 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
10356 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
10357 * search.c (looking_at_1, string_match_1):
10358 (fast_string_match, fast_c_string_match_ignore_case)
10359 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
10360 (scan_newline, find_before_next_newline, search_command)
10361 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
10362 (set_search_regs, wordify):
10363 (Freplace_match):
10364 (Fmatch_data):
10365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10366 (string_match_1, search_buffer, set_search_regs):
10367 (Fmatch_data):
10368 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10369 (wordify): Check for overflow in size calculation.
10370 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
10371 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
10372 Check that fixnums are in proper range for system types.
10373 * sound.c (struct sound_device)
10374 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
10375 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10376 (Fplay_sound_internal):
10377 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10378 * syntax.c (struct lisp_parse_state, find_start_modiff)
10379 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
10380 (Fparse_partial_sexp):
10381 Don't assume fixnums can fit in int.
10382 (struct lisp_parse_state, find_start_pos, find_start_value)
10383 (find_start_value_byte, find_start_begv)
10384 (update_syntax_table, char_quoted, dec_bytepos)
10385 (find_defun_start, prev_char_comend_first, back_comment):
10386 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
10387 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
10388 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10389 (Finternal_describe_syntax_value): Check that match_lisp is a
10390 character, not an integer, since the code stuffs it into int.
10391 (scan_words, scan_sexps_forward):
10392 Check that fixnums are in proper range for system types.
10393 (Fforward_word):
10394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10395 (scan_sexps_forward):
10396 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10397 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10398 * syntax.h: Adjust decls to match defn changes elsewhere.
10399 (struct gl_state_s):
10400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10401 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10402 MOST_POSITIVE_FIXNUM.
10403 * sysdep.c (wait_for_termination_1, wait_for_termination)
10404 (interruptible_wait_for_termination, mkdir):
10405 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10406 (emacs_read, emacs_write):
10407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10408 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10409 and double all fit in int.
10410 * term.c (set_tty_color_mode):
10411 Check that fixnums are in proper range for system types.
10412 * termhooks.h (struct input_event):
10413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10414 * textprop.c (validate_interval_range, interval_of)
10415 (Fadd_text_properties, set_text_properties_1)
10416 (Fremove_text_properties, Fremove_list_of_text_properties)
10417 (Ftext_property_any, Ftext_property_not_all)
10418 (copy_text_properties, text_property_list, extend_property_ranges)
10419 (verify_interval_modification):
10420 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10421 (Fnext_single_char_property_change)
10422 (Fprevious_single_char_property_change):
10423 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10424 (copy_text_properties):
10425 Check for integer overflow in index calculation.
10426 * undo.c (last_boundary_position, record_point, record_insert)
10427 (record_delete, record_marker_adjustment, record_change)
10428 (record_property_change):
10429 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10430 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10431 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10432 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10433 (Fx_hide_tip, Fx_file_dialog):
10434 * w32menu.c (set_frame_menubar):
10435 Use ptrdiff_t, not int, for consistency with rest of code.
10436 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10437 (select_window, Fdelete_other_windows_internal)
10438 (window_scroll_pixel_based, window_scroll_line_based)
10439 (Frecenter, Fset_window_configuration):
10440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10441 (Fset_window_hscroll, run_window_configuration_change_hook)
10442 (set_window_buffer, temp_output_buffer_show, scroll_command)
10443 (Fscroll_other_window, Frecenter):
10444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10445 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10446 Don't assume fixnum fits in int.
10447 (Fset_window_scroll_bars):
10448 Check that fixnums are in proper range for system types.
10449 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10450 (string_pos, c_string_pos, number_of_chars, init_iterator)
10451 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10452 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10453 (compute_display_string_end, handle_face_prop)
10454 (face_before_or_after_it_pos, handle_invisible_prop)
10455 (handle_display_prop, handle_display_spec, handle_single_display_spec)
10456 (display_prop_intangible_p, string_buffer_position_lim)
10457 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10458 (get_overlay_strings_1, get_overlay_strings)
10459 (iterate_out_of_display_property, forward_to_next_line_start)
10460 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10461 (get_next_display_element, set_iterator_to_next)
10462 (get_visually_first_element, compute_stop_pos_backwards)
10463 (handle_stop_backwards, next_element_from_buffer)
10464 (move_it_in_display_line_to, move_it_in_display_line)
10465 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10466 (add_to_log, message_dolog, message_log_check_duplicate)
10467 (message2, message2_nolog, message3, message3_nolog
10468 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10469 (current_message_1, truncate_echo_area, truncate_message_1)
10470 (set_message, set_message_1, store_mode_line_noprop)
10471 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10472 (text_outside_line_unchanged_p, check_point_in_composition)
10473 (reconsider_clip_changes)
10474 (redisplay_internal, set_cursor_from_row, try_scrolling)
10475 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10476 (redisplay_window, find_last_unchanged_at_beg_row)
10477 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10478 (trailing_whitespace_p, find_row_edges, display_line)
10479 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10480 (display_mode_element, store_mode_line_string)
10481 (pint2str, pint2hrstr, decode_mode_spec)
10482 (display_count_lines, display_string, draw_glyphs)
10483 (x_produce_glyphs, x_insert_glyphs)
10484 (rows_from_pos_range, mouse_face_from_buffer_pos)
10485 (fast_find_string_pos, mouse_face_from_string_pos)
10486 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10487 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10488 (safe_call, init_from_display_pos, handle_fontified_prop)
10489 (handle_single_display_spec, load_overlay_strings)
10490 (with_echo_area_buffer, setup_echo_area_for_printing)
10491 (display_echo_area, echo_area_display)
10492 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10493 (update_tool_bar, hscroll_window_tree, redisplay_internal)
10494 (redisplay_window, dump_glyph_row, display_mode_line)
10495 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
10496 (handle_display_spec, display_prop_string_p):
10497 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10498 (handle_single_display_spec, build_desired_tool_bar_string)
10499 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10500 (get_specified_cursor_type):
10501 Check that fixnums are in proper range for system types.
10502 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10503 (Flookup_image_map):
10504 Don't assume fixnums fit in int.
10505 (compare_overlay_entries):
10506 Avoid mishandling comparisons due to subtraction overflow.
10507 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10508 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10509 (handle_tool_bar_click):
10510 Use int, not unsigned, since we prefer signed and the signedness
10511 doesn't matter here.
10512 (get_next_display_element, next_element_from_display_vector):
10513 Use int, not EMACS_INT, when int is wide enough.
10514 (start_hourglass): Use duration_to_sec_usec to do proper
10515 overflow checking on durations.
10516 * xfaces.c (Fbitmap_spec_p):
10517 Check that fixnums are in proper range for system types.
10518 (compare_fonts_by_sort_order):
10519 Avoid mishandling comparisons due to subtraction overflow.
10520 (Fx_family_fonts, realize_basic_faces):
10521 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10522 (Fx_family_fonts):
10523 Don't assume fixnum fits in int.
10524 Use SAFE_ALLOCA_LISP, not alloca.
10525 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10526 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10527 (face_at_buffer_position, face_for_overlay_string)
10528 (face_at_string_position):
10529 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10530 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10531 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10532 (Fx_show_tip):
10533 Check that fixnums are in proper range for system types.
10534 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10535 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10536 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10537 (Fx_change_window_property): Don't assume fixnums fit in int.
10538 * xfont.c (xfont_chars_supported):
10539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10540 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10541 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10542 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10543 * xml.c (parse_region):
10544 * xrdb.c (magic_file_p):
10545 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10546 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10547 (x_get_local_selection, x_reply_selection_request)
10548 (x_handle_selection_request, wait_for_property_change):
10549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10550 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10551 short is wide enough.
10552 (x_send_client_event): Don't assume fixnum fits in int.
10553 * xterm.c (x_x_to_emacs_modifiers):
10554 Don't assume EMACS_INT overflows nicely into int.
10555 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10556 may come from Lisp.
10557 (handle_one_xevent): NATNUMP can eval its arg twice.
10558 (x_connection_closed):
10559 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10560 * xterm.h: Adjust decls to match defn changes elsewhere.
10561 (struct scroll_bar): Use struct vectorlike_header
10562 rather than rolling our own approximation.
10563 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10564
10565 2012-05-25 Glenn Morris <rgm@gnu.org>
10566
10567 * lisp.mk (lisp): Update for more files being compiled now.
10568
10569 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10570
10571 * lread.c: Remove `read_pure' which makes no difference.
10572 (read_pure): Remove var.
10573 (unreadpure): Remove function.
10574 (readevalloop): Don't call read_list with -1 flag.
10575 (read1, read_vector): Don't test read_pure any more.
10576 (read_list): Simplify.
10577
10578 * fileio.c, character.h: Minor style tweaks.
10579
10580 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10581
10582 * window.h (clip_changed): Remove useless declaration.
10583
10584 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
10585
10586 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10587 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10588
10589 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10590
10591 Remove src/m/*.
10592 This directory predates autoconf and is no longer needed nowadays.
10593 Move its few remaining bits of functionality to where they're needed.
10594 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10595 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10596 * m/template.h: Remove.
10597 * Makefile.in (M_FILE): Remove. All uses removed.
10598 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10599 * lisp.h (USE_LSB_TAG):
10600 * mem-limits.h (EXCEEDS_LISP_PTR):
10601 Use VAL_MAX, not VALBITS, in #if.
10602 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10603 (EMACS_UINT): Define unconditionally now.
10604 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10605 (BITS_PER_EMACS_INT): New constants, replacing
10606 what used to be in config.h, but not useful in #if.
10607 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10608 define them any more.
10609 (VAL_MAX): New macro.
10610 (VALMASK): Use it.
10611 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10612 BITS_PER_EMACS_INT, in #if.
10613 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10614 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10615 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10616 * s/ms-w32.h (DATA_START):
10617 Move here from removed file m/intel386.h.
10618 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10619 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10620
10621 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10622
10623 Assume C89 or later.
10624 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10625 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10626 (xrealloc):
10627 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10628 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10629 * textprop.c, tparam.c (NULL): Remove.
10630 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10631 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10632 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10633 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10634 * xterm.c (input_signal_count): Assume volatile works.
10635
10636 2012-05-21 Ken Brown <kbrown@cornell.edu>
10637
10638 * xgselect.c (xg_select): Fix first argument in call to 'select'
10639 (bug#11508).
10640
10641 2012-05-20 Ken Brown <kbrown@cornell.edu>
10642
10643 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
10644 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
10645
10646 2012-05-19 Ken Brown <kbrown@cornell.edu>
10647
10648 * xfns.c (x_in_use): Remove `static' qualifier.
10649 * xterm.h (x_in_use): Declare.
10650 * xgselect.c: Include xterm.h.
10651 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10652 and `display_arg' (bug#9754).
10653
10654 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10655
10656 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10657
10658 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10659 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10660
10661 2012-05-18 Eli Zaretskii <eliz@gnu.org>
10662
10663 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10664
10665 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10666 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10667
10668 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10669 reference to image_cache->refcount.
10670 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10671
10672 2012-05-17 Juri Linkov <juri@jurta.org>
10673
10674 * search.c (Fword_search_regexp, Fword_search_backward)
10675 (Fword_search_forward, Fword_search_backward_lax)
10676 (Fword_search_forward_lax): Move functions to isearch.el
10677 (bug#10145, bug#11381).
10678
10679 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10680
10681 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10682
10683 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10684
10685 * lread.c (init_obarray): Declare Qt and Qnil as special.
10686
10687 2012-05-14 Glenn Morris <rgm@gnu.org>
10688
10689 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10690 Put "libexec" before "bin", for the sake of init_callproc_1.
10691
10692 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10693
10694 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10695
10696 * unexaix.c: Port to more-recent AIX compilers.
10697 (report_error, report_error_1, make_hdr, copy_sym)
10698 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10699 Make arguments const char *, not char *, to avoid violations of C
10700 standard and to fix some AIX warnings reported by Gilles Pion.
10701
10702 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10703
10704 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10705 already have overlays loaded.
10706 (handle_single_display_spec): Before returning without displaying
10707 fringe bitmap, synchronize the bidi iterator with the main display
10708 iterator, by calling iterate_out_of_display_property.
10709 (iterate_out_of_display_property): Detect buffer iteration by
10710 testing that it->string is a Lisp string.
10711 (get_next_display_element): When the current object is exhausted,
10712 and there's something on it->stack, call set_iterator_to_next to
10713 proceed with what's on the stack, instead of returning zero.
10714 (set_iterator_to_next): If called at the end of a Lisp string,
10715 proceed to consider_string_end without incrementing string
10716 position. Don't increment display vector index past the end of
10717 the display vector. (Bug#11417)
10718 (pos_visible_p): Don't report a position visible when move_it_to
10719 stopped at the last line of window, which happens to be scanned
10720 backwards by the bidi iteration. (Bug#11464)
10721
10722 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10723
10724 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10725 and right-margin display specs even if the spec is invalid or we
10726 are on a TTY, and thus unable to display on the fringes.
10727 That's because the text with the property will not be displayed anyway,
10728 so we need to signal to the caller that this is a "replacing"
10729 display spec. This fixes display when the spec is invalid or we
10730 are on a TTY.
10731
10732 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10733
10734 * unexaix.c (make_hdr): Fix typo in prototype.
10735 This bug broke the build on AIX. Problem reported by Gilles Pion.
10736
10737 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
10738
10739 * keyboard.c (kbd_buffer_get_event): Read special events also in
10740 batch mode. (Bug#11415)
10741
10742 2012-05-12 Glenn Morris <rgm@gnu.org>
10743
10744 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10745
10746 2012-05-12 Eli Zaretskii <eliz@gnu.org>
10747
10748 * lisp.mk (lisp): Add newcomment.elc.
10749
10750 2012-05-12 Glenn Morris <rgm@gnu.org>
10751
10752 * Makefile.in (MKDIR_P): New, set by configure.
10753 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10754
10755 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10756
10757 Remove unused function hourglass_started.
10758 * dispextern.h (hourglass_started):
10759 * w32fns.c (hourglass_started):
10760 * xdisp.c (hourglass_started): Remove.
10761
10762 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
10763
10764 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10765 Update dependencies.
10766
10767 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10768
10769 * xgselect.c (xg_select): Put maxfds+1 into a var.
10770 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10771
10772 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10773
10774 2012-05-10 Dave Abrahams <dave@boostpro.com>
10775
10776 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10777 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10778
10779 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10780
10781 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10782 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
10783 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10784 Initialize xd_registered_buses.
10785
10786 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10787
10788 Untag more efficiently if USE_LSB_TAG.
10789 This is based on a proposal by YAMAMOTO Mitsuharu in
10790 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10791 For an admittedly artificial (nth 8000 longlist) benchmark on
10792 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10793 Emacs's overall text size by 1%.
10794 * lisp.h (XUNTAG): New macro.
10795 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10796 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10797 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10798 * eval.c (Fautoload):
10799 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10800 * frame.h (XFRAME): Use XUNTAG.
10801
10802 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10803 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10804 Remove unportable assumptions about print widths of types like
10805 dbus_uint32_t.
10806 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10807 intptr_t when converting between pointer and integer, to avoid GCC
10808 warnings about wrong width.
10809
10810 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10811
10812 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10813 stack for each reader_thread, instead of defaulting to 8MB
10814 determined by the linker. This avoids failures in creating
10815 subprocesses on Windows 7, see the discussion in this thread:
10816 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10817
10818 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10819
10820 Fix up display of the *Minibuf-0* buffer in the mini window.
10821 * keyboard.c (read_char): Don't clear the echo area if there's no
10822 message to clear.
10823 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10824 contents of *Minibuf-0*) if there's no message displayed in its stead.
10825
10826 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10827
10828 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10829 batch mode.
10830
10831 2012-05-06 Chong Yidong <cyd@gnu.org>
10832
10833 * lisp.mk (lisp): Update.
10834
10835 2012-05-05 Jim Meyering <meyering@redhat.com>
10836
10837 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10838
10839 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10840
10841 * data.c (PUT_ERROR): New macro.
10842 (syms_of_data): Use it. Add new error type `user-error'.
10843 * undo.c (user_error): New function.
10844 (Fprimitive_undo): Use it.
10845 * print.c (print_error_message): Adjust print style for `user-error'.
10846 * keyboard.c (user_error): New function.
10847 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10848
10849 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10850
10851 Do not limit current-time-string to years 1000..9999.
10852 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10853 (Fcurrent_time_string): Support any year that is supported by the
10854 underlying localtime representation. Don't use asctime, as it
10855 has undefined behavior for years outside the range -999..9999.
10856
10857 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10858
10859 Fix race conditions involving setenv, gmtime, localtime, asctime.
10860 Without this fix, interrupts could mess up code that uses these
10861 nonreentrant functions, since setting TZ invalidates existing
10862 tm_zone or tzname values, and since most of these functions return
10863 pointers to static storage.
10864 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10865 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10866 Grow the critical sections to include not just invoking
10867 localtime/gmtime, but also accessing these functions' results
10868 including their tm_zone values if any, and any related TZ setting.
10869 (format_time_string): Last arg is now struct tm *, not struct tm **,
10870 so that the struct tm is saved in the critical section.
10871 All callers changed. Simplify allocation of initial buffer, partly
10872 motivated by the fact that memory allocation needs to be outside
10873 the critical section.
10874
10875 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10876
10877 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10878 with RESET_INTERVAL.
10879
10880 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10881 Remove duplicated buffer name initialization.
10882
10883 2012-05-02 Jim Meyering <jim@meyering.net>
10884
10885 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10886
10887 * xfns.c (x_window): Use xstrdup (Bug#11375).
10888
10889 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10890
10891 * xdisp.c (pos_visible_p): If already at a newline from the
10892 display string before the 'while' loop, don't walk back the glyphs
10893 from it3.glyph_row. Solves assertion violation when the display
10894 string begins with a newline (egg.el). (Bug#11367)
10895
10896 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10897
10898 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10899 Move to simple.el.
10900
10901 2012-05-01 Glenn Morris <rgm@gnu.org>
10902
10903 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10904 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10905 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10906 All were removed before 23.1.
10907
10908 * dispnew.c: Remove HAVE_LIBNCURSES test;
10909 it is always true on relevant platforms.
10910
10911 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10912 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10913
10914 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10915
10916 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10917
10918 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10919 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10920 Remove.
10921
10922 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10923
10924 Do not avoid creating empty evaporating overlays (Bug#9642).
10925 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10926 That is, do not delete an evaporating overlay if it becomes
10927 empty after its bounds are adjusted to fit within its buffer.
10928 This fix caused other problems, and I'm reverting it until we get
10929 to the bottom of them.
10930
10931 2012-04-27 Chong Yidong <cyd@gnu.org>
10932
10933 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10934
10935 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10936
10937 * xdisp.c (pos_visible_p): If the window start position is beyond
10938 ZV, start the display from buffer beginning. Prevents assertion
10939 violation in init_iterator when the minibuffer window is scrolled
10940 via the scroll bar.
10941
10942 * window.c (window_scroll_pixel_based): Likewise.
10943
10944 2012-04-27 Chong Yidong <cyd@gnu.org>
10945
10946 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10947
10948 2012-04-27 Glenn Morris <rgm@gnu.org>
10949
10950 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10951 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10952
10953 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10954
10955 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10956 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10957
10958 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10959
10960 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10961 display element, check also the underlying string or buffer
10962 character. (Bug#11341)
10963
10964 * w32menu.c: Include w32heap.h.
10965 (add_menu_item): If the call to AppendMenuW (via
10966 unicode_append_menu) fails, disable Unicode menus only if we are
10967 running on Windows 9X/Me.
10968
10969 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10970
10971 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10972 (xgetint): Add missing shift for LSB tags.
10973
10974 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10975
10976 * keyboard.c (read_char): Don't wipe echo area for select window
10977 events: These might get delayed via `mouse-autoselect-window'
10978 (Bug#11304).
10979
10980 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10981
10982 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10983 manipulation of :loaded-from data.
10984
10985 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10986
10987 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10988 now a cons (bug#11311).
10989
10990 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10991
10992 Do not create empty overlays with the evaporate property (Bug#9642).
10993 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10994 if it becomes empty after its bounds are adjusted to fit within
10995 its buffer. Without this fix, in a nonempty buffer (let ((o
10996 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10997 yields an empty overlay that has the evaporate property, which is
10998 not supposed to happen.
10999
11000 Fix minor GTK3 problems found by static checking.
11001 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11002 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11003 (struct _EmacsFixedClass, emacs_fixed_get_type):
11004 Move decls here from emacsgtkfixed.h, since they needn't be public.
11005 (emacs_fixed_get_type): Now static.
11006 (emacs_fixed_class_init): Omit unused local.
11007 (emacs_fixed_child_type): Remove; unused.
11008 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11009 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11010 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
11011 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
11012 (EMACS_FIXED_GET_CLASS): Remove; unused.
11013 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
11014
11015 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
11016 Problem reported by Juanma Barranquero for Windows -Wunused-function.
11017
11018 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11019
11020 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
11021 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
11022 (__malloc_size_t, __malloc_ptrdiff_t):
11023 Remove. All uses removed, replaced by the definiens if needed,
11024 since we can assume C89 or better now.
11025 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
11026 (protect_malloc_state, align, get_contiguous_space)
11027 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
11028 (malloc_atfork_handler_child, malloc_enable_thread)
11029 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
11030 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
11031 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
11032 (special_realloc, _realloc_internal_nolock, _realloc_internal)
11033 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
11034 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
11035 Define using prototypes, not old style.
11036 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
11037 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
11038 (align): Don't assume that signed integer overflow wraps around.
11039 Omit unused local var.
11040 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
11041 (_free_internal_nolock, memalign, mallochook, reallochook):
11042 Omit no-longer-needed casts.
11043 (valloc): Use getpagesize, not __getpagesize.
11044 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
11045 (struct hdr): The 'magic' member is now size_t, not unsigned long.
11046
11047 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
11048
11049 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
11050
11051 Move functions from C to Lisp. Make non-blocking method calls
11052 the default. Implement further D-Bus standard interfaces.
11053
11054 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
11055 (QCdbus_request_name_allow_replacement)
11056 (QCdbus_request_name_replace_existing)
11057 (QCdbus_request_name_do_not_queue)
11058 (QCdbus_request_name_reply_primary_owner)
11059 (QCdbus_request_name_reply_in_queue)
11060 (QCdbus_request_name_reply_exists)
11061 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
11062 (QCdbus_registered_serial, QCdbus_registered_method)
11063 (QCdbus_registered_signal): New Lisp objects.
11064 (XD_DEBUG_MESSAGE): Use sizeof.
11065 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
11066 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
11067 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
11068 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
11069 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
11070 (xd_signature, xd_append_arg): Allow float for integer types.
11071 (xd_get_connection_references): New function.
11072 (xd_get_connection_address): Rename from xd_initialize.
11073 Return cached address.
11074 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
11075 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
11076 level.
11077 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
11078 Return number of refcounts.
11079 (Fdbus_get_unique_name): Make stronger parameter check.
11080 (Fdbus_message_internal): New defun.
11081 (Fdbus_call_method, Fdbus_call_method_asynchronously)
11082 (Fdbus_method_return_internal, Fdbus_method_error_internal)
11083 (Fdbus_send_signal, Fdbus_register_service)
11084 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
11085 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
11086 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
11087 (Vdbus_compiled_version, Vdbus_runtime_version)
11088 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
11089 (Vdbus_message_type_method_return, Vdbus_message_type_error)
11090 (Vdbus_message_type_signal): New defvars.
11091 (Vdbus_registered_buses, Vdbus_registered_objects_table):
11092 Adapt docstring.
11093
11094 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11095
11096 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
11097 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
11098 Do not assume ptrdiff_t is the same width as 'int'.
11099
11100 * alloc.c: Handle unusual debugging option combinations.
11101 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
11102 since the two debugging options are incompatible.
11103 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
11104 is defined.
11105 (mem_init, mem_insert, mem_insert_fixup):
11106 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
11107 (NEED_MEM_INSERT): Remove; no longer needed.
11108
11109 2012-04-22 Leo Liu <sdl.web@gmail.com>
11110
11111 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
11112
11113 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11114
11115 * sysdep.c [__FreeBSD__]: Minor cleanups.
11116 (list_system_processes, system_process_attributes) [__FreeBSD__]:
11117 Use Emacs indenting style more consistently. Avoid some casts.
11118 Use 'double' consistently rather than mixing 'float' and 'double'.
11119
11120 2012-04-21 Eduard Wiebe <usenet@pusto.de>
11121
11122 * sysdep.c (list_system_processes, system_process_attributes):
11123 Add implementation for FreeBSD (Bug#5243).
11124
11125 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
11126
11127 * lisp.mk (lisp): Update.
11128
11129 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
11130
11131 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
11132 It is never used otherwise.
11133
11134 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
11135
11136 * print.c (print_preprocess): Only check print_depth if print-circle
11137 is nil.
11138 (print_object): Check for cycles even when print-circle is nil and
11139 print-gensym is t, but only check print_depth if print-circle is nil.
11140
11141 2012-04-20 Chong Yidong <cyd@gnu.org>
11142
11143 * process.c (wait_reading_process_output): If EIO occurs on a pty,
11144 set the status to "failed" and ensure that sentinel is run.
11145
11146 2012-04-20 Glenn Morris <rgm@gnu.org>
11147
11148 * process.c (Fset_process_inherit_coding_system_flag)
11149 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
11150 (Fmake_network_process, Fmake_serial_process): Doc fix.
11151
11152 2012-04-20 Eli Zaretskii <eliz@gnu.org>
11153
11154 * xdisp.c (string_buffer_position_lim): Limit starting position to
11155 BEGV.
11156 (set_cursor_from_row): If called for a mode-line or header-line
11157 row, return zero immediately.
11158 (try_cursor_movement): If inside continuation line, don't back up
11159 farther than the first row after the header line, if any.
11160 Don't consider the header-line row as "partially visible", even if
11161 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
11162
11163 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
11164
11165 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
11166 (bug#11238).
11167
11168 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
11169 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
11170
11171 configure: new option --enable-gcc-warnings (Bug#11207)
11172 * Makefile.in (C_WARNINGS_SWITCH): Remove.
11173 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
11174 (ALL_CFLAGS): Use new macros rather than old.
11175 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
11176 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
11177 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
11178 -Wunused-result, -Wunused-variable. This should go away once
11179 the Emacs and Gnulib regex code is merged.
11180 (xmalloc, xrealloc): Now static.
11181
11182 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
11183
11184 * dired.c (Fsystem_groups): Remove unused local.
11185
11186 2012-04-17 Glenn Morris <rgm@gnu.org>
11187
11188 * dired.c (Fsystem_users): Doc fix.
11189
11190 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
11191
11192 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
11193 (syms_of_dired): Add them.
11194
11195 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
11196
11197 Fix minor alloc.c problems found by static checking.
11198 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
11199 New extern decls, to avoid calling undeclared functions.
11200 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
11201 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
11202 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
11203 (NEED_MEM_INSERT): New macro.
11204 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
11205 Remove one incorrect comment and fix another.
11206
11207 Fix minor ralloc.c problems found by static checking.
11208 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11209 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
11210 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
11211 (r_alloc_sbrk): Now static.
11212
11213 Improve ralloc.c interface checking.
11214 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11215 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
11216 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
11217 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
11218 [REL_ALLOC]: ... to here, to check interface.
11219 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
11220 Remove decls. This fixes an "It stinks!".
11221
11222 * alloc.c (which_symbols): Fix alignment issue / type clash.
11223
11224 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
11225
11226 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
11227 (struct Lisp_Misc_Any): Likewise.
11228 (struct Lisp_Free): Likewise.
11229 * alloc.c (union aligned_Lisp_Symbol): Define.
11230 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
11231 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
11232 (union aligned_Lisp_Misc): Define.
11233 (MARKER_BLOCK_SIZE, struct marker_block): Use union
11234 aligned_Lisp_Misc instead of union Lisp_Misc.
11235 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
11236
11237 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
11238
11239 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
11240 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
11241 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
11242 * s/netbsd.h, s/sol2-6.h:
11243 Remove definition of GC_MARK_STACK, since the default now works.
11244 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
11245 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
11246 no longer the default.
11247 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
11248
11249 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
11250
11251 * lread.c (lisp_file_lexically_bound_p):
11252 Fix hang at ";-*-\n" (bug#11238).
11253
11254 2012-04-14 Eli Zaretskii <eliz@gnu.org>
11255
11256 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
11257 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
11258
11259 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
11260
11261 * nsterm.m (constrainFrameRect): Always constrain when there is only
11262 one screen (Bug#10962).
11263
11264 2012-04-13 Ken Brown <kbrown@cornell.edu>
11265
11266 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
11267
11268 2012-04-13 Reuben Thomas <rrt@sc3d.org>
11269
11270 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
11271
11272 2012-04-11 Daniel Colascione <dancol@dancol.org>
11273
11274 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
11275 against is gone. It's better to use vfork now so that when Cygwin
11276 gains a new, working vfork, we use it automatically (bug#10398).
11277
11278 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11279
11280 * window.c (save_window_save): Obey window-point-insertion-type.
11281
11282 2012-04-11 Glenn Morris <rgm@gnu.org>
11283
11284 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
11285
11286 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11287
11288 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
11289
11290 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
11291
11292 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
11293 (force_quit_count): New var.
11294 (handle_interrupt): Use it.
11295
11296 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
11297
11298 * w32.c (w32_delayed_load): Record the full path of the library
11299 being loaded (bug#10424).
11300
11301 2012-04-09 Glenn Morris <rgm@gnu.org>
11302
11303 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
11304 not just in the obarray, before snarfing them. (Bug#11036)
11305
11306 * Makefile.in ($(leimdir)/leim-list.el):
11307 Pass EMACS rather than BUILT_EMACS.
11308
11309 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
11310
11311 * process.c (make_process):
11312 * process.h: Add integer `gnutls_handshakes_tried' member to
11313 process struct.
11314
11315 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
11316 Add convenience `GNUTLS_LOG2i' macro.
11317
11318 * gnutls.c (gnutls_log_function2i): Convenience log function.
11319 (emacs_gnutls_read): Use new log functions,
11320 `gnutls_handshakes_tried' process member, and
11321 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
11322 attempts per process (connection).
11323
11324 2012-04-09 Chong Yidong <cyd@gnu.org>
11325
11326 * eval.c (Fuser_variable_p, user_variable_p_eh)
11327 (lisp_indirect_variable): Functions deleted.
11328 (Fdefvar): Caller changed.
11329
11330 * callint.c (Finteractive, Fcall_interactively):
11331 * minibuf.c (Fread_variable): Callers changed.
11332
11333 2012-04-09 Eli Zaretskii <eliz@gnu.org>
11334
11335 * xdisp.c (set_cursor_from_row): If the display string appears in
11336 the buffer at position that is closer to point than the position
11337 after the display string, display the cursor on the first glyph of
11338 the display string. Fixes cursor display when a 'display' text
11339 property immediately follows invisible text. (Bug#11094)
11340
11341 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
11342
11343 composite.c: use 'double' consistently
11344 * composite.c (get_composition_id): Use 'double' consistently
11345 instead of converting 'float' to 'double' and vice versa; this is
11346 easier to understand and avoids a GCC warning.
11347
11348 2012-04-09 Glenn Morris <rgm@gnu.org>
11349
11350 * Makefile.in: Generate leim-list with bootstrap-emacs, in
11351 preparation for dumping it with emacs. (Bug#4789)
11352 (leimdir): New variable.
11353 ($(leimdir)/leim-list.el): New rule.
11354 (emacs$(EXEEXT)): Depend on leim-list.el.
11355
11356 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
11357 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
11358 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
11359
11360 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
11361
11362 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
11363 proper alignment.
11364
11365 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
11366
11367 * xml.c (init_libxml2_functions) [WINDOWSNT]:
11368 Remove unused local variable.
11369
11370 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11371
11372 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
11373 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
11374 (mark_memory): Mark Lisp_Objects only if pointers might hide in
11375 objects, as mark_maybe_pointer will catch them otherwise.
11376 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
11377 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
11378
11379 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11380
11381 Fix typo that broke non-Windows builds.
11382 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
11383
11384 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11385
11386 Support building on MS-Windows with libxml2.
11387
11388 * makefile.w32-in (OBJ2): Add xml.$(O).
11389 (GLOBAL_SOURCES): Add xml.c.
11390 ($(BLD)/xml.$(O)): New dependency list.
11391
11392 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11393 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11394 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11395 [!WINDOWSNT]: New macros.
11396 (init_libxml2_functions, libxml2_loaded_p): New functions.
11397 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11398 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11399 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11400 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11401 linked in).
11402 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11403 Call init_libxml2_functions before calling libxml2 functions.
11404 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11405
11406 * emacs.c: Don't include libxml/parser.h.
11407 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11408 xmlCleanupParser directly.
11409
11410 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11411
11412 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11413
11414 * indent.c (Fvertical_motion): If there is a display string at
11415 point, use it.vpos to compute how many lines to backtrack after
11416 move_it_to point. (Bug#11133)
11417
11418 2012-04-06 Eli Zaretskii <eliz@gnu.org>
11419
11420 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11421 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11422 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11423 macros related to unification of CJK characters. For the details,
11424 see the discussion following the message here:
11425 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
11426
11427 2012-04-04 Chong Yidong <cyd@gnu.org>
11428
11429 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11430
11431 2012-04-01 Eli Zaretskii <eliz@gnu.org>
11432
11433 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11434 instead of alloca. (Bug#11138)
11435
11436 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11437
11438 * w32menu.c (is_simple_dialog): Properly check lisp types.
11439 (Bug#11141)
11440
11441 2012-03-31 Eli Zaretskii <eliz@gnu.org>
11442
11443 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11444 position we get to after a call to move_it_to fails the
11445 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11446 only if we wind up in a string from display property. (Bug#11063)
11447
11448 * window.c (Fdelete_other_windows_internal): Invalidate the row
11449 and column information about mouse highlight, so that redisplay
11450 restores it after reallocating the glyph matrices. (Bug#7464)
11451
11452 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11453 string comes from a `display' text property, use the buffer
11454 position of that property as if we actually saw that position in
11455 the row's glyphs.
11456 (move_it_by_lines): Remove the assertion that
11457 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11458 violated when there's a before-string at the beginning of a line.
11459 (Bug#11063)
11460
11461 2012-03-30 Eli Zaretskii <eliz@gnu.org>
11462
11463 * xdisp.c (append_space_for_newline): If the default face was
11464 remapped, use the remapped face for the appended newline.
11465 (extend_face_to_end_of_line): Use the remapped default face for
11466 extending the face to the end of the line.
11467 (display_line): Call extend_face_to_end_of_line when the default
11468 face was remapped. (Bug#11068)
11469
11470 2012-03-29 Eli Zaretskii <eliz@gnu.org>
11471
11472 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11473
11474 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11475
11476 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11477
11478 2012-03-27 Glenn Morris <rgm@gnu.org>
11479
11480 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11481 Doc fixes.
11482
11483 2012-03-26 Kenichi Handa <handa@m17n.org>
11484
11485 * dispextern.h (struct glyph): Fix previous change. Change the
11486 bit length of glyphless.ch to 25 (Bug#11082).
11487
11488 2012-03-26 Chong Yidong <cyd@gnu.org>
11489
11490 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11491 (command_loop_1): Use it; inhibit selection update for
11492 handle-select-window too (Bug#8996).
11493
11494 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11495
11496 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
11497
11498 2012-03-25 Kenichi Handa <handa@m17n.org>
11499
11500 * dispextern.h (struct glyph): Change the bit length of
11501 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11502
11503 2012-03-24 Eli Zaretskii <eliz@gnu.org>
11504
11505 * s/ms-w32.h (tzname): Include time.h before redirecting to
11506 _tzname. Fixes the MSVC build. (Bug#9960)
11507
11508 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11509
11510 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11511 characters.
11512
11513 * xterm.c (XTread_socket): Only modify handling_signal if
11514 !SYNC_INPUT. (Bug#11080)
11515
11516 2012-03-23 Eli Zaretskii <eliz@gnu.org>
11517
11518 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11519 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11520 when fetching a multibyte character consumes more bytes than
11521 CHAR_BYTES returns, due to unification of CJK characters in
11522 string_char. (Bug#11073)
11523
11524 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11525
11526 * process.c (wait_reading_process_output): Handle pty disconnect
11527 by refraining from sending oneself a SIGCHLD (bug#10933).
11528
11529 2012-03-22 Chong Yidong <cyd@gnu.org>
11530
11531 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11532
11533 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
11534 Mark string as coming from a prefix property.
11535 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11536 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11537
11538 2012-03-21 Chong Yidong <cyd@gnu.org>
11539
11540 * xfaces.c (Vface_remapping_alist): Doc fix.
11541
11542 2012-03-20 Eli Zaretskii <eliz@gnu.org>
11543
11544 * w32proc.c (Fw32_set_console_codepage)
11545 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11546 Doc fixes.
11547
11548 2012-03-20 Chong Yidong <cyd@gnu.org>
11549
11550 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11551 to reflect default non-nil value of redisplay-dont-pause.
11552
11553 2012-03-19 Kenichi Handa <handa@m17n.org>
11554
11555 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11556 it fit in a valid range (Bug#11003).
11557
11558 2012-03-18 Eli Zaretskii <eliz@gnu.org>
11559
11560 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11561 that is not from display property, accept the row as a "cursor
11562 row" if one of the string's character has a non-nil `cursor'
11563 property. Fixes cursor positioning when there are newlines in
11564 overlay strings, e.g. in icomplete.el. (Bug#11035)
11565
11566 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11567
11568 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11569
11570 2012-03-12 Chong Yidong <cyd@gnu.org>
11571
11572 * eval.c (inhibit_lisp_code): Rename from
11573 inhibit_window_configuration_change_hook; move from window.c.
11574
11575 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11576 * window.c (run_window_configuration_change_hook)
11577 (syms_of_window): Callers changed.
11578
11579 2012-03-11 Chong Yidong <cyd@gnu.org>
11580
11581 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11582
11583 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11584
11585 2012-03-10 Chong Yidong <cyd@gnu.org>
11586
11587 * frame.c (other_visible_frames): Don't assume the selected frame
11588 is visible (Bug#10955).
11589
11590 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11591
11592 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11593
11594 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11595
11596 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11597 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11598 zero (Bug#10954).
11599
11600 2012-03-03 Glenn Morris <rgm@gnu.org>
11601
11602 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
11603
11604 2012-03-02 Eli Zaretskii <eliz@gnu.org>
11605
11606 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11607 position past the first glyph_row that ends at ZV. (Bug#10902)
11608 (redisplay_window, next_element_from_string): Fix typos in
11609 comments.
11610 (redisplay_window): Pass to move_it_vertically the margin in
11611 pixels, not in screen lines.
11612
11613 2012-03-02 Glenn Morris <rgm@gnu.org>
11614
11615 * buffer.c (buffer-list-update-hook): Doc fix.
11616
11617 2012-02-29 Eli Zaretskii <eliz@gnu.org>
11618
11619 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11620 push_it before setting up the iterator for the first overlay
11621 string, even if we have an empty string loaded.
11622 (next_overlay_string): If there's an empty string on the iterator
11623 stack, pop the stack. (Bug#10903)
11624
11625 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11626
11627 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11628 Suggested by Stefan Monnier in
11629 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11630 * alloc.c (widen_to_Lisp_Object): New static function.
11631 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11632 and widening them to Lisp_Objects. This would work even if
11633 USE_LSB_TAG is defined and wide integers are used, which might
11634 happen in a future version of Emacs.
11635
11636 2012-02-25 Chong Yidong <cyd@gnu.org>
11637
11638 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11639 Doc fix.
11640
11641 * xselect.c (Fx_selection_exists_p): Doc fix.
11642 (x_clipboard_manager_save_all): Print an informative message
11643 before saving to clipboard manager.
11644
11645 2012-02-24 Chong Yidong <cyd@gnu.org>
11646
11647 * keyboard.c (process_special_events): Handle all X selection
11648 requests in kbd_buffer, not just the next one (Bug#8869).
11649
11650 2012-02-23 Chong Yidong <cyd@gnu.org>
11651
11652 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11653 call when setting menu-bar-lines and tool-bar-lines parameters.
11654 (unwind_create_frame_1): New helper function.
11655
11656 * window.c (inhibit_window_configuration_change_hook): New var.
11657 (run_window_configuration_change_hook): Obey it.
11658 (syms_of_window): Initialize it.
11659
11660 2012-02-22 Chong Yidong <cyd@gnu.org>
11661
11662 * xterm.c (x_draw_image_relief): Add missing type check for
11663 Vtool_bar_button_margin (Bug#10743).
11664
11665 2012-02-21 Chong Yidong <cyd@gnu.org>
11666
11667 * fileio.c (Vfile_name_handler_alist): Doc fix.
11668
11669 * buffer.c (Fget_file_buffer): Protect against invalid file
11670 handler return value.
11671
11672 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11673
11674 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11675 when computing $valmask.
11676
11677 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11678 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11679 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11680 It's useless in that case, and it can cause problems on hosts
11681 that allocate halves of EMACS_INT values separately.
11682 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11683 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11684 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11685 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11686 it avoids undefined behavior on hosts where shifting right by more
11687 than the word width has undefined behavior.
11688
11689 2012-02-19 Chong Yidong <cyd@gnu.org>
11690
11691 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11692 (Funhandled_file_name_directory, Ffile_name_as_directory)
11693 (Fdirectory_file_name, Fexpand_file_name)
11694 (Fsubstitute_in_file_name): Protect against invalid file handler
11695 return values (Bug#10845).
11696
11697 2012-02-18 Eli Zaretskii <eliz@gnu.org>
11698
11699 * .gdbinit (pitx): Fix incorrect references to fields of the
11700 iterator stack.
11701
11702 2012-02-17 Chong Yidong <cyd@gnu.org>
11703
11704 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11705
11706 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11707
11708 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11709 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11710
11711 2012-02-15 Chong Yidong <cyd@gnu.org>
11712
11713 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11714 marked as special. Also, starting docstrings with * is obsolete.
11715
11716 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11717
11718 * gnutls.c (emacs_gnutls_write): Fix last change.
11719
11720 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11721
11722 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11723 send_process.
11724
11725 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11726
11727 * keymap.c (Fsingle_key_description): Handle char ranges.
11728
11729 2012-02-12 Chong Yidong <cyd@gnu.org>
11730
11731 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11732 as that creates a dangerous corner case.
11733
11734 * window.c (Fdelete_window_internal): Invalidate the mouse
11735 highlight (Bug#9904).
11736
11737 2012-02-12 Glenn Morris <rgm@gnu.org>
11738
11739 * xselect.c (Fx_own_selection_internal)
11740 (Fx_get_selection_internal, Fx_disown_selection_internal)
11741 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11742 * nsselect.m (Fx_own_selection_internal)
11743 (Fx_disown_selection_internal, Fx_selection_exists_p)
11744 (Fx_selection_owner_p, Fx_get_selection_internal):
11745 Sync docs and argument specs with the xselect.c versions.
11746
11747 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11748
11749 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11750
11751 2012-02-11 Eli Zaretskii <eliz@gnu.org>
11752
11753 * w32select.c (Fx_selection_exists_p): Sync doc string and
11754 argument list with xselect.c. (Bug#10783)
11755
11756 * w16select.c (Fx_selection_exists_p): Sync doc string and
11757 argument list with xselect.c. (Bug#10783)
11758
11759 2012-02-10 Glenn Morris <rgm@gnu.org>
11760
11761 * fns.c (Fsecure_hash): Doc fix.
11762
11763 2012-02-09 Kenichi Handa <handa@m17n.org>
11764
11765 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11766
11767 2012-02-07 Chong Yidong <cyd@gnu.org>
11768
11769 * buffer.c (Fbuffer_local_variables)
11770 (buffer_lisp_local_variables): Handle unbound vars correctly;
11771 don't let Qunbound leak into Lisp.
11772
11773 2012-02-07 Glenn Morris <rgm@gnu.org>
11774
11775 * image.c (Fimagemagick_types): Doc fix.
11776
11777 * image.c (imagemagick-render-type): Change it from a lisp object
11778 to an integer. Move the doc here from the lisp manual.
11779 Treat all values not equal to 0 the same.
11780
11781 2012-02-06 Chong Yidong <cyd@gnu.org>
11782
11783 * doc.c (store_function_docstring): Avoid applying docstring of
11784 alias to base function (Bug#2603).
11785
11786 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11787
11788 * .gdbinit (pp1, pv1): Remove redundant defines.
11789 (pr): Use pp.
11790
11791 2012-02-04 Chong Yidong <cyd@gnu.org>
11792
11793 * nsterm.m: Declare a global (Bug#10694).
11794
11795 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11796
11797 * w32.c (get_emacs_configuration_options):
11798 Include --enable-checking, if specified, in the return value.
11799
11800 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11801
11802 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11803 after rounding frame sizes. (Bug#9723)
11804
11805 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11806
11807 * keyboard.c (adjust_point_for_property): Don't position point
11808 before BEGV. (Bug#10696)
11809
11810 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11811
11812 Handle overflow when computing char display width (Bug#9496).
11813 * character.c (char_width): Return EMACS_INT, not int.
11814 (char_width, c_string_width): Check for overflow when
11815 computing the width; this is possible now that individual
11816 characters can have unbounded width. Problem introduced
11817 by merge from Emacs 23 on 2012-01-19.
11818
11819 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11820
11821 * dbusbind.c (Fdbus_register_method): Mention the return value
11822 :ignore in the docstring.
11823
11824 2012-02-02 Glenn Morris <rgm@gnu.org>
11825
11826 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11827
11828 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11829 Unconditionally set to t. (Bug#10673)
11830 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11831 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11832 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11833
11834 2012-02-02 Kenichi Handa <handa@m17n.org>
11835
11836 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11837 0, do not call append_composite_glyph.
11838
11839 2012-02-02 Kenichi Handa <handa@m17n.org>
11840
11841 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11842 NULL (Bug#6988).
11843 (x_produce_glyphs): If the component of a composition is a null
11844 string, set it->pixel_width to 1 to avoid zero-width glyph.
11845
11846 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11847
11848 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11849 first 2 arguments are identical. This makes inserting large
11850 output from a subprocess an order of magnitude faster on
11851 MS-Windows, where all sbrk'ed memory is always contiguous.
11852
11853 2012-01-31 Glenn Morris <rgm@gnu.org>
11854
11855 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11856 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11857 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11858
11859 2012-01-29 Glenn Morris <rgm@gnu.org>
11860
11861 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11862
11863 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11864
11865 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11866
11867 2012-01-28 Chong Yidong <cyd@gnu.org>
11868
11869 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11870
11871 2012-01-26 Chong Yidong <cyd@gnu.org>
11872
11873 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11874
11875 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11876 repeat counts (Bug#10507).
11877
11878 2012-01-26 Glenn Morris <rgm@gnu.org>
11879
11880 * lread.c (syms_of_lread): Doc fix.
11881
11882 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11883
11884 * coding.c (encode_designation_at_bol): Change return value to
11885 EMACS_INT.
11886
11887 2012-01-25 Chong Yidong <cyd@gnu.org>
11888
11889 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11890
11891 2012-01-21 Chong Yidong <cyd@gnu.org>
11892
11893 * floatfns.c (Fcopysign): Make the second argument non-optional,
11894 since nil is not allowed anyway.
11895
11896 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11897
11898 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11899 (send_process): Likewise.
11900
11901 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11902
11903 * window.c (save_window_save, Fcurrent_window_configuration)
11904 (Vwindow_persistent_parameters): Do not use Qstate.
11905 Rewrite doc-strings.
11906
11907 2012-01-19 Kenichi Handa <handa@m17n.org>
11908
11909 * character.c (char_width): New function.
11910 (Fchar_width, c_string_width, lisp_string_width):
11911 Use char_width (Bug#9496).
11912
11913 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11914
11915 * window.c (Vwindow_persistent_parameters): New variable.
11916 (Fset_window_configuration, save_window_save): Handle persistent
11917 window parameters.
11918
11919 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11920
11921 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11922 thrashing the stack of the thread. (Bug#9087)
11923
11924 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11925
11926 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11927
11928 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11929
11930 * xdisp.c (rows_from_pos_range): Handle the case where the
11931 highlight ends on a newline. (Bug#10464)
11932 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11933 he end column for display of highlight that ends on a newline
11934 before a R2L line.
11935
11936 2012-01-11 Glenn Morris <rgm@gnu.org>
11937
11938 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11939 from load-path also when installation-directory is nil. (Bug#10208)
11940
11941 2012-01-10 Glenn Morris <rgm@gnu.org>
11942
11943 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11944
11945 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11946 Update template values to be closer to their typical values these days.
11947
11948 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11949
11950 * xdisp.c (rows_from_pos_range): Accept additional argument
11951 DISP_STRING, and accept any glyph in a row whose object is that
11952 string as eligible for mouse highlight. Fixes mouse highlight of
11953 display strings from overlays. (Bug#10464)
11954
11955 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11956
11957 emacs: fix an auto-save permissions race condition (Bug#10400)
11958 * fileio.c (auto_saving_dir_umask): New static var.
11959 (Fmake_directory_internal): Use it.
11960 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11961 creating the directory. The old code temporarily assigns
11962 too-generous permissions to the directory.
11963 (do_auto_save_eh): Clear it.
11964 (Fdo_auto_save): Catch all errors, not just file errors, so
11965 that the var is always cleared.
11966
11967 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11968
11969 * search.c (scan_buffer): Pass character positions to
11970 know_region_cache, not byte positions. (Bug#6540)
11971
11972 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11973
11974 * w32.c (sys_rename): Report EXDEV when rename of a directory
11975 fails because the target is on another logical disk. (Bug#10284)
11976
11977 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11978
11979 * xterm.c (x_embed_request_focus): New function.
11980
11981 * xterm.h: Add prototype.
11982
11983 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11984
11985 2012-01-05 Glenn Morris <rgm@gnu.org>
11986
11987 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11988
11989 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11990
11991 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11992 Load gnutls_transport_set_lowat only if GnuTLS version is below
11993 2.11.1.
11994 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11995 GnuTLS versions below 2.11.1.
11996
11997 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11998
11999 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
12000 to the doc string advising against its use for altering the way
12001 windows are scrolled.
12002
12003 2011-12-28 Kenichi Handa <handa@m17n.org>
12004
12005 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
12006 coding-system ASCII compatible only when it does not produce BOM
12007 on encoding (Bug#10383).
12008
12009 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
12010
12011 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
12012 can scroll.
12013 (create_and_show_popup_menu): Always use menu_position_func for
12014 Gtk3 (Bug#10361).
12015
12016 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
12017
12018 * callint.c (Fcall_interactively): Don't truncate prompt string.
12019
12020 2011-12-23 Eli Zaretskii <eliz@gnu.org>
12021
12022 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
12023 property that ends at ZV, so that the bidi iteration could be
12024 resumed from there (after widening). (Bug#10360)
12025
12026 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
12027
12028 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
12029
12030 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
12031
12032 * nsterm.m (x_free_frame_resources):
12033 Release f->output_data.ns->miniimage.
12034 (ns_index_color): Fix indentation. Do not retain
12035 color_table->colors[i].
12036
12037 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
12038 before returning.
12039
12040 * nsfns.m (x_set_background_color): Assign return value from
12041 ns_index_color to face-background instead of NSColor*.
12042 (ns_implicitly_set_icon_type): Fix indentation.
12043 Change assignment in for loop to comparison.
12044
12045 * emacs.c (ns_pool): New variable.
12046 (main): Assign ns_pool.
12047 (Fkill_emacs): Call ns_release_autorelease_pool.
12048
12049 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
12050 autorelease fdesc, release fdAttrs and tdict.
12051 (ns_get_covering_families): Release charset.
12052 (ns_findfonts): Release NSFontDescriptor created with new.
12053 (ns_uni_to_glyphs): Fix indentation.
12054 (setString): Release attrStr before assigning new value.
12055
12056 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12057
12058 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
12059 and NS_IMPL_COCOA.
12060 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
12061 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
12062
12063 2011-12-18 David Reitter <reitter@cmu.edu>
12064
12065 * nsterm.m (ns_term_init): Subscribe for notifications
12066 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
12067 to method trackingNotification in EmacsMenu.
12068
12069 * nsmenu.m (trackingMenu): New variable.
12070 (trackingNotification): New method (from Aquamacs).
12071 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
12072 from Aquamacs (Bug#7030).
12073
12074 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12075
12076 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
12077 (symbol_to_nsstring): Fix indentation.
12078 (ns_symbol_to_pb): New function.
12079 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
12080 (Fns_rotate_cut_buffers_internal): Remove.
12081 (Fns_store_selection_internal): Rename from
12082 Fns_store_cut_buffer_internal.
12083 (ns_get_foreign_selection, Fx_own_selection_internal)
12084 (Fx_disown_selection_internal, Fx_selection_exists_p)
12085 (Fns_get_selection_internal, Fns_store_selection_internal):
12086 Use ns_symbol_to_pb and check if return value is nil.
12087 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
12088 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
12089 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
12090 renamed to Sns_store_selection_internal.
12091 (ns_handle_selection_request): Move code to Fx_own_selection_internal
12092 and remove this function.
12093 (ns_handle_selection_clear): Remove, never used.
12094 (Fx_own_selection_internal): Move code from ns_handle_selection_request
12095 here.
12096
12097 2011-12-17 Ken Brown <kbrown@cornell.edu>
12098
12099 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
12100 GID is unknown (Bug#10257).
12101
12102 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
12103
12104 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
12105 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
12106 which caused a build failure on GNU/Linux IA-64. This problem was
12107 introduced by my 2011-10-07 patch.
12108
12109 2011-12-15 Juri Linkov <juri@jurta.org>
12110
12111 * image.c (imagemagick_error): New function. (Bug#10112)
12112 (imagemagick_load_image): Comment out `MagickSetResolution' call.
12113 Use `imagemagick_error' where ImageMagick functions return
12114 `MagickFalse'.
12115 (Fimagemagick_types): Add `Fnreverse' to return the list in the
12116 proper order.
12117
12118 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12119
12120 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
12121 fill background (Bug#8992).
12122
12123 2011-12-13 Martin Rudalics <rudalics@gmx.at>
12124
12125 * window.c (Vwindow_combination_resize)
12126 (Vwindow_combination_limit): Use t instead of non-nil in
12127 doc-strings.
12128 (Vrecenter_redisplay): Add first sentence of doc-string on
12129 separate line.
12130 (Frecenter): Fix doc-string typo.
12131
12132 2011-12-11 Kenichi Handa <handa@m17n.org>
12133
12134 * coding.c (Funencodable_char_position): Pay attention to the
12135 buffer text relocation (Bug#9389).
12136
12137 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12138
12139 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
12140 gtk_init (Bug#10100).
12141
12142 2011-12-10 Eli Zaretskii <eliz@gnu.org>
12143
12144 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
12145 IT->string is nil. (Bug#10263)
12146
12147 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12148
12149 * nsterm.h (x_free_frame_resources): Declare.
12150
12151 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
12152 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
12153
12154 * nsterm.h (ns_get_defaults_value): Declare.
12155
12156 * nsterm.m (ns_default): Call ns_get_defaults_value.
12157
12158 2011-12-09 Eli Zaretskii <eliz@gnu.org>
12159
12160 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
12161 (Bug#10170)
12162
12163 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12164
12165 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
12166 that where the value of an _OBJC_* symbol points to is in the .bss
12167 section (Bug#10240).
12168
12169 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12170
12171 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
12172 after the loop to call ccl_driver at least once (Bug#8619).
12173
12174 2011-12-08 Kenichi Handa <handa@m17n.org>
12175
12176 * ftfont.c (get_adstyle_property): Fix previous change
12177 (Bug#10233).
12178
12179 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
12180
12181 * w32.c (init_environment): If no_site_lisp, remove site-lisp
12182 dirs from the default value of EMACSLOADPATH (bug#10208).
12183
12184 2011-12-07 Glenn Morris <rgm@gnu.org>
12185
12186 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
12187 installation and source directories as well. (Bug#10208)
12188
12189 2011-12-06 Chong Yidong <cyd@gnu.org>
12190
12191 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
12192
12193 2011-12-06 Glenn Morris <rgm@gnu.org>
12194
12195 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
12196 as an error, not just -1. (Bug#10217)
12197
12198 2011-12-05 Chong Yidong <cyd@gnu.org>
12199
12200 * keyboard.c (process_special_events): New function.
12201 (swallow_events, Finput_pending_p): Use it (Bug#10195).
12202
12203 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
12204
12205 * coding.c (encode_designation_at_bol): Don't use uninitialized
12206 local variable (Bug#9318).
12207
12208 2011-12-05 Kenichi Handa <handa@m17n.org>
12209
12210 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
12211 return Qnil (Bug#8046, Bug#10193).
12212
12213 2011-12-05 Kenichi Handa <handa@m17n.org>
12214
12215 * coding.c (encode_designation_at_bol): New args charbuf_end and
12216 dst. Return the number of produced bytes. Callers changed.
12217 (coding_set_source): Return how many bytes coding->source was
12218 relocated.
12219 (coding_set_destination): Return how many bytes
12220 coding->destination was relocated.
12221 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
12222 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
12223
12224 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12225
12226 * coding.c (CODING_CHAR_CHARSET_P): New macro.
12227 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
12228 macro (Bug#9318).
12229
12230 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
12231
12232 The following changes are to fix Bug#9318.
12233
12234 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
12235 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
12236 (encode_coding_iso_2022, encode_coding_sjis)
12237 (encode_coding_big5, encode_coding_charset): Use the above macros.
12238
12239 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
12240
12241 * lisp.h (process_quit_flag): Fix external declaration.
12242
12243 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
12244
12245 Don't macro-inline non-performance-critical code.
12246 * eval.c (process_quit_flag): New function.
12247 * lisp.h (QUIT): Use it.
12248
12249 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
12250
12251 * nsfns.m (get_geometry_from_preferences): New function.
12252 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
12253
12254 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
12255
12256 * emacs.c (Qkill_emacs): Define.
12257 (syms_of_emacs): Initialize it.
12258 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
12259 Qquit_flag to `kill-emacs' instead.
12260 (quit_throw_to_read_char): Add parameter `from_signal'.
12261 All callers changed. Call Fkill_emacs if requested and safe.
12262 * lisp.h (QUIT): Call Fkill_emacs if requested.
12263
12264 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
12265
12266 * widget.c (update_wm_hints): Return if wmshell is null.
12267 (widget_update_wm_size_hints): New function.
12268
12269 * widget.h (widget_update_wm_size_hints): Declare.
12270
12271 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
12272 widget_update_wm_size_hints (Bug#10104).
12273
12274 2011-12-03 Eli Zaretskii <eliz@gnu.org>
12275
12276 * xdisp.c (handle_invisible_prop): If the invisible text ends just
12277 before a newline, prepare the bidi iterator for consuming the
12278 newline, and keep the current paragraph direction. (Bug#10183)
12279 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
12280
12281 2011-12-02 Juri Linkov <juri@jurta.org>
12282
12283 * search.c (Fword_search_regexp): New Lisp function created from
12284 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
12285 (Fword_search_backward, Fword_search_forward)
12286 (Fword_search_backward_lax, Fword_search_forward_lax):
12287 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
12288 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
12289
12290 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
12291
12292 * fileio.c (Finsert_file_contents): Move after-change-function call
12293 to before the "handled:" label, since all "goto handled" appear in
12294 cases where the *-change-functions have already been properly called
12295 (bug#10117).
12296
12297 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
12298
12299 * keyboard.c (interrupt_signal): Don't call kill-emacs when
12300 waiting for input. (Bug#10169)
12301
12302 2011-11-30 Eli Zaretskii <eliz@gnu.org>
12303
12304 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
12305 verifies glyph row's hash code--we have just reallocated the
12306 glyphs, so their contents can be complete garbage. (Bug#10164)
12307
12308 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
12309
12310 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
12311
12312 2011-11-30 Eli Zaretskii <eliz@gnu.org>
12313
12314 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
12315 attributes are tested _before_ calling verify_row_hash, to protect
12316 against GCC re-ordering of the tests. (Bug#10164)
12317
12318 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
12319
12320 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
12321
12322 * xterm.c (handle_one_xevent): Only set async_visible and friends
12323 if net_wm_state_hidden_seen is non-zero (Bug#10002)
12324 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
12325 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
12326
12327 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
12328
12329 Remove GCPRO-related macros that exist only to avoid shadowing locals.
12330 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
12331 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
12332 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12333 All uses changed to use GCPRO1 etc.
12334 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
12335 Revert to old implementation (i.e., before 2011-03-11).
12336
12337 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12338
12339 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
12340 of scroll runs so as to avoid assigning disabled bogus rows and
12341 unnecessary graphics copy operations.
12342
12343 2011-11-27 Eli Zaretskii <eliz@gnu.org>
12344
12345 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
12346 (snprintf) [_MSC_VER]: Redirect to _snprintf.
12347 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
12348 (malloc, free, realloc, calloc): Redirect to e_* only when
12349 compiling Emacs.
12350
12351 * lisp.h (GCTYPEBITS): Move before first use.
12352 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
12353 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
12354 this macro definition.
12355
12356 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
12357 _MSC_VER.
12358
12359 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
12360
12361 * gtkutil.c (xg_create_frame_widgets):
12362 Call gtk_window_set_has_resize_grip (FALSE) if that function is
12363 present with Gtk+ 2.0.
12364
12365 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12366
12367 * fileio.c (Finsert_file_contents): Undo previous change; see
12368 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12369
12370 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12371
12372 Rename locals to avoid shadowing.
12373 * fileio.c (Finsert_file_contents):
12374 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
12375 * process.c (wait_reading_process_output):
12376 Rename inner 'proc' to 'p' to avoid shadowing.
12377 Indent for consistency with usual Emacs style.
12378
12379 2011-11-25 Eli Zaretskii <eliz@gnu.org>
12380
12381 * xdisp.c (redisplay_window): If cursor row is not fully visible
12382 after recentering, and scroll-conservatively is set to a large
12383 number, scroll window by a few more lines to make the cursor fully
12384 visible and out of scroll-margin. (Bug#10105)
12385 (start_display): Don't move to the next line if the display should
12386 start at a newline that is part of a display vector or an overlay
12387 string. (Bug#10119)
12388
12389 2011-11-24 Juri Linkov <juri@jurta.org>
12390
12391 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12392 after the `MagickPingImage' call. (Bug#10112)
12393
12394 2011-11-23 Chong Yidong <cyd@gnu.org>
12395
12396 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12397
12398 2011-11-23 Martin Rudalics <rudalics@gmx.at>
12399
12400 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12401 making another buffer current. (Bug#10114)
12402
12403 2011-11-23 Glenn Morris <rgm@gnu.org>
12404
12405 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12406
12407 2011-11-23 Chong Yidong <cyd@gnu.org>
12408
12409 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12410 using it (Bug#5984).
12411
12412 2011-11-22 Eli Zaretskii <eliz@gnu.org>
12413
12414 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12415 and header-lines, as they don't have one computed for them.
12416 (Bug#10098)
12417
12418 * .gdbinit (prow): Make displayed values more self-explaining.
12419 Add row's hash code.
12420
12421 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12422
12423 * process.c (wait_reading_process_output): Fix asynchrounous
12424 GnuTLS socket handling on some versions of the GnuTLS library.
12425 (wait_reading_process_output): Add comment and URL.
12426
12427 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12428
12429 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12430
12431 2011-11-21 Chong Yidong <cyd@gnu.org>
12432
12433 * window.c (Fnext_window, Fprevious_window): Doc fix.
12434
12435 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12436
12437 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12438
12439 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12440
12441 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12442
12443 2011-11-20 Martin Rudalics <rudalics@gmx.at>
12444
12445 * window.c (Fset_window_combination_limit): Rename argument
12446 STATUS to LIMIT.
12447 (Vwindow_combination_limit): Remove "status" from doc-string.
12448
12449 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12450
12451 * m/ibms390.h: Remove.
12452 * m/ibms390x.h: Don't include "ibms390.h".
12453
12454 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12455
12456 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12457 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12458
12459 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12460
12461 * casetab.c (Fset_case_table):
12462 * charset.c (Fcharset_after): Fix typos.
12463
12464 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
12465
12466 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12467 Otherwise, valgrind does not work on some platforms.
12468 Problem reported by Andreas Schwab in
12469 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12470 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12471 is set, removing the need for VIRT_ADDRESS_VARIES.
12472 (PURE_P): Use a more-efficient implementation that needs just one
12473 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12474 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12475 to 4 (xorl, subq, cmpq, setbe).
12476 * alloc.c (pure): Always extern now, since that's the
12477 VIRT_ADDR_VARIES behavior.
12478 (PURE_POINTER_P): Use a single comparison, not two, for
12479 consistency with the new puresize.h.
12480 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12481 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12482 Remove VIRT_ADDR_VARIES no longer needed.
12483
12484 2011-11-19 Eli Zaretskii <eliz@gnu.org>
12485
12486 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12487 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12488 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12489 behave as if the cursor position were at the window margin.
12490
12491 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12492 and the cursor position is out of bounds, behave as if the cursor
12493 position were at the window margin. (Bug#10075)
12494
12495 2011-11-18 Chong Yidong <cyd@gnu.org>
12496
12497 * window.c (Fwindow_combination_limit): Make first argument
12498 non-optional, since it is meaningless for live windows like the
12499 selected window.
12500
12501 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12502
12503 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12504
12505 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12506
12507 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12508 (graft_intervals_into_buffer): Simplify.
12509
12510 2011-11-18 Eli Zaretskii <eliz@gnu.org>
12511
12512 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12513 hash values of the two rows.
12514 (copy_row_except_pointers): Preserve the used[] arrays and the
12515 hash values of the two rows. (Bug#10035)
12516 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
12517
12518 * xdisp.c (row_hash): New function, body extracted from
12519 compute_line_metrics.
12520 (compute_line_metrics): Call row_hash, instead of computing the
12521 hash code inline.
12522
12523 * dispnew.c (verify_row_hash): Call row_hash for computing the
12524 hash code of a row, instead of duplicating code from xdisp.c.
12525
12526 * dispextern.h (row_hash): Add prototype.
12527
12528 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12529
12530 * frame.c (delete_frame): Don't delete the terminal when the last
12531 X frame is closed if emacs is built with GTK toolkit.
12532
12533 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
12534
12535 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12536
12537 2011-11-17 Martin Rudalics <rudalics@gmx.at>
12538
12539 * window.c (Vwindow_splits): Rename to
12540 Vwindow_combination_resize. Suggested by Juri Linkov.
12541 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12542 of Vwindow_splits.
12543
12544 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
12545
12546 * nsfns.m (Fns_font_name):
12547 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
12548
12549 2011-11-16 Martin Rudalics <rudalics@gmx.at>
12550
12551 * window.h (window): Rename slot "nest" to "combination_limit".
12552 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12553 (Fset_window_nest): Rename to Fset_window_combination_limit.
12554 (Vwindow_nest): Rename to Vwindow_combination_limit.
12555 (recombine_windows, make_parent_window, make_window)
12556 (Fsplit_window_internal, saved_window)
12557 (Fset_window_configuration, save_window_save): Rename all
12558 occurrences of window_nest to window_combination_limit.
12559
12560 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
12561
12562 * image.c (imagemagick_load_image): Fix typo.
12563
12564 2011-11-14 Eli Zaretskii <eliz@gnu.org>
12565
12566 * xdisp.c (display_line): Move the call to
12567 highlight_trailing_whitespace before the call to
12568 compute_line_metrics, since the latter needs to see the final
12569 faces of all the glyphs to compute ROW's hash value.
12570 Fixes assertion violations in row_equal_p. (Bug#10035)
12571
12572 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
12573
12574 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12575 just return (bug#10044).
12576
12577 2011-11-12 Eli Zaretskii <eliz@gnu.org>
12578
12579 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12580 with user-defined heap size. Bump the default size of the temacs
12581 heap to 27MB, to avoid memory warning when running temacs.
12582 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12583
12584 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12585 current_matrix and desired_matrix. (Bug#9990)
12586 (verify_row_hash) [XASSERTS]: New function.
12587 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12588 that the hash value of glyph rows is correct.
12589
12590 2011-11-12 Martin Rudalics <rudalics@gmx.at>
12591
12592 * window.h (window): Remove splits slot.
12593 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12594 (Fdelete_other_windows_internal, make_parent_window)
12595 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12596 (Fset_window_configuration, save_window_save): Don't deal with
12597 split status of windows.
12598 (saved_window): Remove splits slot.
12599 (Vwindow_splits): Rewrite doc-string.
12600
12601 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12602
12603 * xfns.c (unwind_create_frame):
12604 * nsfns.m (unwind_create_frame):
12605 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12606 Vframe_list (Bug#9999).
12607
12608 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12609
12610 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
12611
12612 2011-11-11 Kenichi Handa <handa@m17n.org>
12613
12614 * callproc.c (Fcall_process): Set the member dst_multibyte of
12615 process_coding.
12616
12617 2011-11-11 Johan Bockgård <bojohan@gnu.org>
12618
12619 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12620 avoid a crash (bug#9496).
12621
12622 2011-11-09 Chong Yidong <cyd@gnu.org>
12623
12624 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12625 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12626
12627 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12628
12629 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12630
12631 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12632
12633 Avoid some portability problems by eschewing 'extern inline' functions.
12634 The trivial performance wins aren't worth the portability hassles; see
12635 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12636 et seq.
12637 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12638 (window_box_width, window_box_left, window_box_left_offset)
12639 (window_box_right, window_box_right_offset): Undo previous change,
12640 by removing the "extern"s.
12641 * intervals.c (adjust_intervals_for_insertion)
12642 (adjust_intervals_for_deletion): Undo previous change,
12643 making these static again.
12644 (offset_intervals, temp_set_point_both, temp_set_point)
12645 (copy_intervals_to_string): No longer inline.
12646 * xdisp.c (window_text_bottom_y, window_box_width)
12647 (window_box_height, window_box_left_offset)
12648 (window_box_right_offset, window_box_left, window_box_right)
12649 (window_box): No longer inline.
12650
12651 2011-11-08 Chong Yidong <cyd@gnu.org>
12652
12653 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12654 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12655 Signal an error if not a live window.
12656 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12657 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12658
12659 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
12660
12661 * lisp.h (syms_of_abbrev): Remove declaration.
12662 Reported by CHENG Gao <chenggao@royau.me>.
12663
12664 2011-11-07 Eli Zaretskii <eliz@gnu.org>
12665
12666 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12667 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12668 of temacs in GUI mode.
12669
12670 2011-11-07 Martin Rudalics <rudalics@gmx.at>
12671
12672 * window.h: Declare delete_all_child_windows instead of
12673 delete_all_subwindows.
12674 * window.c (Fwindow_nest, Fset_window_nest)
12675 (Fset_window_new_total, Fset_window_new_normal)
12676 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12677 (delete_all_subwindows): Rename to delete_all_child_windows.
12678 (Fdelete_other_windows_internal, Fset_window_configuration):
12679 Call delete_all_child_windows instead of delete_all_subwindows.
12680 * frame.c (delete_frame): Call delete_all_child_windows instead
12681 of delete_all_subwindows.
12682
12683 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12684
12685 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12686 This is also needed for porting to any host where GC_MARK_STACK is
12687 not GC_MAKE_GCPROS_NOOPS.
12688 (which_symbols): Use it.
12689
12690 2011-11-07 Kenichi Handa <handa@m17n.org>
12691
12692 * coding.c (coding_set_destination): Check coding->src_pos only
12693 when coding->src_object is a buffer (bug#9910).
12694
12695 * process.c (send_process): Set the member src_multibyte of coding
12696 to 0 (bug#9911) when sending a unibyte text.
12697
12698 * callproc.c (Fcall_process): Set the member src_multibyte of
12699 process_coding to 0 (bug#9912).
12700
12701 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12702
12703 * xmenu.c (cleanup_widget_value_tree): New function.
12704 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12705 calling free_menubar_widget_value_tree directly (Bug#9830).
12706
12707 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12708
12709 Fix some portability problems with 'inline'.
12710 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12711 (window_box_width, window_box_left, window_box_left_offset)
12712 (window_box_right, window_box_right_offset): Declare extern.
12713 Otherwise, these inline functions do not conform to C99 and
12714 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12715 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12716 * intervals.c (adjust_intervals_for_insertion)
12717 (adjust_intervals_for_deletion): Now extern, because otherwise the
12718 extern inline functions 'offset_intervals' couldn't refer to it.
12719 (static_offset_intervals): Remove.
12720 (offset_intervals): Rewrite using the old contents of
12721 static_offset_intervals. The old version didn't conform to C99
12722 because an extern inline function contained a reference to an
12723 identifier with static linkage.
12724
12725 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12726
12727 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12728 GC.
12729
12730 2011-11-06 Eli Zaretskii <eliz@gnu.org>
12731
12732 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12733 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12734 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12735 return Qleft_to_right.
12736
12737 2011-11-06 Chong Yidong <cyd@gnu.org>
12738
12739 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12740 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12741 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12742 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12743 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12744 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12745 (Fwindow_vscroll): Doc fix.
12746 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12747 argument, since it makes no sense to pass a live window and for
12748 consistency with window-child.
12749
12750 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12751
12752 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12753 support MSVC.
12754
12755 2011-11-05 Jason Rumney <jasonr@gnu.org>
12756
12757 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12758 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12759 fonts (Bug#6029).
12760 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12761 bitwise arithmetic preventing use of unicode-sip and non-truetype
12762 opentype fonts.
12763
12764 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12765
12766 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12767 "emacs"-only part.
12768
12769 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12770 initialization code to keep similarity to xfns.c after changes
12771 from 2011-11-05.
12772
12773 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12774
12775 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12776 (unwind_create_frame): New function (Bug#9943).
12777 (Fx_create_frame): Restructure code to be more similar to the one in
12778 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12779 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12780 Move terminal->reference_count++ just before making the frame official
12781 (Bug#9943).
12782
12783 * nsterm.m (x_free_frame_resources): New function.
12784 (x_destroy_window): Move code to x_free_frame_resources.
12785
12786 * xfns.c (unwind_create_frame): Fix comment.
12787 (Fx_create_frame, x_create_tip_frame):
12788 Move terminal->reference_count++ just before making the frame
12789 official. Move initialization of image_cache_refcount and
12790 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12791
12792 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12793
12794 Support MSVC build with newer versions of Visual Studio.
12795 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12796 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12797 nt/gmake.defs.
12798
12799 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12800 which are not supported by MSVC.
12801 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12802 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12803 bitfields.
12804 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12805 types in bitfields.
12806 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12807
12808 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12809
12810 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12811
12812 Support MSVC build with newer versions of Visual Studio.
12813 * w32.c: Don't include w32api.h for MSVC.
12814 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12815
12816 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12817 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12818 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12819 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12820 e_* cousins.
12821 (alloca) [_MSC_VER]: Define to _alloca.
12822
12823 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12824
12825 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12826
12827 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12828
12829 * xdisp.c (note_mouse_highlight): If either of
12830 previous/next-single-property-change returns nil, treat that as
12831 the beginning or the end of the buffer. (Bug#9955)
12832
12833 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12834
12835 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12836 label is not null (Bug#9951).
12837 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12838 may be NULL.
12839
12840 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12841
12842 * window.c (Fwindow_body_size): Mention in the doc string that the
12843 return value is in frame's canonical units. (Bug#9949)
12844
12845 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12846
12847 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12848
12849 * w32fns.c (unwind_create_frame): If needed, free the glyph
12850 matrices of the partially constructed frame. (Bug#9943)
12851 * xfns.c (unwind_create_frame): Likewise.
12852
12853 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12854
12855 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12856 Don't stop backward scan on the continuation glyph, even though
12857 its CHARPOS is positive.
12858 (mouse_face_from_buffer_pos, note_mouse_highlight):
12859 Rename cover_string to disp_string.
12860
12861 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12862
12863 * window.c (temp_output_buffer_show): Don't use
12864 Vtemp_buffer_show_specifiers.
12865 (Vtemp_buffer_show_specifiers): Remove unused variable.
12866
12867 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12868
12869 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12870 past the beginning of the current glyph matrix.
12871
12872 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12873
12874 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12875 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12876 HAVE_GTK3 (Bug#9869).
12877
12878 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12879 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12880
12881 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12882
12883 * xterm.c: Declare x_handle_net_wm_state to return int.
12884 (handle_one_xevent): Check if we are iconified but don't have
12885 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12886 (get_current_wm_state): Return non-zero if not hidden,
12887 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12888 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12889 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12890 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12891
12892 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12893
12894 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12895 so that this new function doesn't get optimized away by a
12896 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12897
12898 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12899
12900 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12901
12902 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12903
12904 Fix the `xbytecode' command.
12905 * .gdbinit (xprintbytestr): New command.
12906 (xwhichsymbols): Rename from `which'; all callers changed.
12907 (xbytecode): Print the byte-code string as well.
12908
12909 2011-10-29 Kim Storm <storm@cua.dk>
12910
12911 * alloc.c (which_symbols): New function.
12912
12913 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12914
12915 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12916 line. (Bug#9903)
12917
12918 2011-10-29 Glenn Morris <rgm@gnu.org>
12919
12920 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12921 Not clear what it was for, and it causes various bugs. (Bug#9839)
12922
12923 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12924
12925 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12926 possible random value that matches one of those tested as
12927 condition to clear the mouse face.
12928
12929 2011-10-28 Chong Yidong <cyd@gnu.org>
12930
12931 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12932
12933 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12934
12935 * window.c (make_window): Initialize phys_cursor_on_p.
12936
12937 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12938
12939 * lisp.h (struct Lisp_Symbol): Update comments.
12940
12941 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12942
12943 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12944
12945 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12946
12947 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12948 <oslsachem@gmail.com> for helping to debug this.
12949
12950 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12951 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12952 (g_b_init_get_glyph_outline_w): New static variables.
12953 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12954 (GetGlyphOutlineW_Proc): New typedefs.
12955 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12956 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12957 New functions.
12958 (w32font_open_internal, compute_metrics):
12959 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12960 instead of calling the "wide" APIs directly.
12961
12962 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12963
12964 * w32.h (syms_of_w32font): Add prototype.
12965
12966 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12967
12968 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12969 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12970 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12971 (Fmove_to_window_line): Doc fix.
12972
12973 2011-10-27 Chong Yidong <cyd@gnu.org>
12974
12975 * process.c (make_process): Set gnutls_state to NULL.
12976
12977 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12978 non-NULL, regardless of GNUTLS_INITSTAGE.
12979 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12980 an error. Set process slots as soon as we allocate them.
12981
12982 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12983
12984 2011-10-27 Chong Yidong <cyd@gnu.org>
12985
12986 * gnutls.c (emacs_gnutls_deinit): New function.
12987 Deallocate credentials structures as well as calling gnutls_deinit.
12988 (Fgnutls_deinit, Fgnutls_boot): Use it.
12989
12990 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12991 (deactivate_process): Call emacs_gnutls_deinit.
12992
12993 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12994
12995 * image.c (x_create_x_image_and_pixmap):
12996 * w32.c (sys_rename, w32_delayed_load):
12997 * w32font.c (fill_in_logfont):
12998 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12999
13000 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
13001
13002 * w32fns.c (w32_default_color_map): New function,
13003 extracted from Fw32_default_color_map.
13004 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
13005
13006 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
13007
13008 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
13009
13010 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
13011
13012 * keyboard.c (test_undefined): New function (bug#9751).
13013 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
13014
13015 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
13016
13017 * sysdep.c (init_sys_modes): Fix the check for the controlling
13018 terminal (Bug#6649).
13019
13020 2011-10-20 Eli Zaretskii <eliz@gnu.org>
13021
13022 * dispextern.h (struct bidi_it): New member next_en_type.
13023
13024 * bidi.c (bidi_line_init): Initialize the next_en_type member.
13025 (bidi_resolve_explicit_1): When next_en_pos is valid for the
13026 current character, check also for next_en_type being WEAK_EN.
13027 (bidi_resolve_weak): Don't enter the expensive loop if the current
13028 position is before next_en_pos. Record the bidi type of the first
13029 non-ET, non-BN character we find, in addition to its position.
13030 (bidi_level_of_next_char): Invalidate next_en_type when
13031 next_en_pos is over-stepped.
13032
13033 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
13034
13035 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
13036 * editfns.c: Rewrite current-time-zone so that it invokes
13037 the equivalent of (format-time-string "%Z") to get the time zone name.
13038 This fixes a bug when the time zone name contains characters that
13039 need converting from the system time locale to Emacs internal format.
13040 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
13041 that patch fixed format-time-string to do the conversion, but
13042 I forgot to fix current-time-zone.
13043 (format_time_string): New function, containing most of
13044 what Fformat_time_string used to contain.
13045 (Fformat_time_string): Rewrite in terms of format_time_string.
13046 This doesn't change this function's behavior.
13047 (current-time-zone): Rewrite to use format_time_string.
13048 This fixes the bug reported by Michael Schierl in
13049 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
13050 Jason Rumney's 2007-06-07 change worked around this bug, but
13051 didn't fix it.
13052 * systime.h (tzname, timezone): Remove no-longer-used declarations.
13053
13054 2011-10-19 Eli Zaretskii <eliz@gnu.org>
13055
13056 * xdisp.c (start_display): If the character at POS is displayed
13057 via a display vector, reset IT->current.dpvec_index to zero.
13058 (try_window_reusing_current_matrix): If a line ends in a display
13059 vector or the next line starts in a display vector, continue
13060 redrawing the window even though the character position of
13061 start_row was reached.
13062 (Bug#9771, part 2)
13063
13064 2011-10-18 Chong Yidong <cyd@gnu.org>
13065
13066 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
13067 with nobreak-char-display too.
13068
13069 2011-10-18 Eli Zaretskii <eliz@gnu.org>
13070
13071 Fix part 3 of bug#9771.
13072 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
13073 (bidi_resolve_neutral): Don't enter the expensive loop looking for
13074 non-neutral characters if the current character is a paragraph
13075 separator (a.k.a. Newline). This avoids running the same
13076 expensive loop twice, once when we consume the preceding newline
13077 and the other time when the line actually needs to be displayed.
13078 Avoid the loop when we see neutrals on the base embedding level
13079 following a character whose directionality is the same as the
13080 paragraph's. This avoids running the expensive loop when a line
13081 ends in a long sequence of neutrals, like control characters.
13082 Add assertion against STRONG_AL type. Slightly rearrange code
13083 that determines the type of a neutral given the first non-neutral
13084 that follows it.
13085 (bidi_level_of_next_char): Set next_en_pos to zero when
13086 invalidating its info.
13087
13088 2011-10-17 Eli Zaretskii <eliz@gnu.org>
13089
13090 * xdisp.c (push_display_prop): Determine whether to record string
13091 or buffer position by IT->string, not by IT->method. Allow
13092 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
13093 (move_it_vertically_backward): Don't look for character position
13094 immediately after the newline when in a continuation line.
13095 (Bug#9771, part 1)
13096
13097 2011-10-15 Martin Rudalics <rudalics@gmx.at>
13098
13099 * window.c (coordinates_in_window): Rewrite and delabelize
13100 vertical border check. (Bug#5357) (Bug#9618)
13101
13102 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
13103
13104 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
13105 errors in XSetWindowBorder (bug#9310).
13106
13107 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
13108
13109 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
13110 avoid crash when xmalloc overrun checking is enabled.
13111
13112 2011-10-13 Eli Zaretskii <eliz@gnu.org>
13113
13114 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
13115 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
13116 cursor motion with <left> and <right> arrow keys.
13117
13118 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
13119 some callers set that themselves.
13120
13121 2011-10-12 Eli Zaretskii <eliz@gnu.org>
13122
13123 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
13124 display string and the previous row comes from the same string and
13125 is empty. (Bug#9739) (Bug#9738)
13126
13127 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
13128
13129 * doc.c (get_doc_string): Encode file name (bug#9735).
13130
13131 2011-10-12 Eli Zaretskii <eliz@gnu.org>
13132
13133 * bidi.c (bidi_level_of_next_char):
13134 * xdisp.c (get_visually_first_element): Remove old incorrect
13135 comments regarding the Unicode Line Separator character.
13136
13137 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
13138
13139 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
13140
13141 * alloc.c (Fgc_status): Do not access beyond zombies array
13142 boundary if nzombies > MAX_ZOMBIES.
13143 * alloc.c (dump_zombies): Add missing format specifier.
13144
13145 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
13146
13147 * xdisp.c (set_cursor_from_row): Simplify conditionals,
13148 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
13149
13150 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
13151 Some packages use them to denote characters with modifiers.
13152
13153 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
13154
13155 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
13156 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
13157 matching a pp-number. Rename parameter var to var1.
13158
13159 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
13160
13161 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
13162
13163 2011-10-08 Glenn Morris <rgm@gnu.org>
13164
13165 * callint.c (Fcall_interactively): Give a more explicit error for the
13166 'c' case with a non-character input. (Bug#8479)
13167
13168 2011-10-08 Eli Zaretskii <eliz@gnu.org>
13169
13170 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
13171 lines.
13172 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
13173 lines that are hscrolled on the left.
13174
13175 * dispnew.c (buffer_posn_from_coords): Account for a possible
13176 presence of header-line. (Bug#4426)
13177
13178 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
13179
13180 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
13181 Don't advertise functionality which we discourage or doesn't work.
13182
13183 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
13184
13185 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
13186 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
13187 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
13188 this makes Emacs dump core during garbage collection on rare
13189 occasions. sizeof is obviously inferior to offsetof here, so
13190 stick with offsetof.
13191 (GC_POINTER_ALIGNMENT): New macro.
13192 (mark_memory): Omit 3rd (offset) arg; caller changed.
13193 Don't assume EMACS_INT alignment is the same as pointer alignment.
13194
13195 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
13196
13197 * keyboard.c (read_key_sequence_remapped): New var.
13198 (read_key_sequence): Compute remapping in the right buffer.
13199 (command_loop_1): Use read_key_sequence's remapping directly.
13200
13201 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
13202
13203 * dired.c (file_name_completion): Don't expand file name.
13204 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
13205 before checking file name handler.
13206
13207 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
13208 they've been requested explicitly (bug#9591).
13209
13210 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
13211
13212 * keymap.c (Fsingle_key_description): Use make_specified_string
13213 instead of build_string to build string from push_key_description.
13214 (Bug#5193)
13215
13216 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13217
13218 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
13219 This fixes a Y2038 bug on 64-bit hosts.
13220 * buffer.c (reset_buffer):
13221 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
13222 (Fclear_buffer_auto_save_failure):
13223 Use 0, not -1, to represent an unset failure time, since time_t
13224 might not be signed.
13225
13226 Remove dependency on glibc malloc internals.
13227 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13228 Move back here from lisp.h, but with their new implementations.
13229 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13230 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
13231 * charset.c (charset_table_init): New static var.
13232 (syms_of_charset): Use it instead of xmalloc. This removes a
13233 dependency on glibc malloc internals. See Eli Zaretskii's comment in
13234 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
13235 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13236 Move back to alloc.c.
13237 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13238 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
13239
13240 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
13241
13242 * nsterm.m (windowDidResize): Call x_set_window_size only when
13243 ns_in_resize is true. Otherwise set pixelwidth/height and
13244 call change_frame_size (Bug#9628).
13245
13246 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13247
13248 Port --enable-checking=all to Fedora 14 x86-64.
13249 * charset.c (syms_of_charset): Also account for glibc malloc's
13250 internal overhead when calculating the initial malloc maximum.
13251
13252 Port --enable-checking=all to Fedora 14 x86.
13253 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13254 Move to lisp.h.
13255 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
13256 (overrun_check_realloc, overrun_check_free):
13257 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
13258 That way, xmalloc returns a properly-aligned pointer even if
13259 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
13260 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
13261 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
13262 into account when calculating the initial malloc maximum.
13263 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13264 Move here from alloc.c, so that charset.c can use it too.
13265 Properly align; the old code wasn't right for common 32-bit hosts
13266 when configured with --enable-checking=all.
13267 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13268 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
13269
13270 2011-09-29 Eli Zaretskii <eliz@gnu.org>
13271
13272 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
13273 use EDOM.
13274
13275 2011-09-28 Eli Zaretskii <eliz@gnu.org>
13276
13277 * xdisp.c (compute_display_string_end): If there's no display
13278 string at CHARPOS, return -1.
13279
13280 * bidi.c (bidi_fetch_char): When compute_display_string_end
13281 returns a negative value, treat the character as a normal
13282 character not covered by a display string. (Bug#9624)
13283
13284 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
13285
13286 * lread.c (Fread_from_string): Fix typo in docstring.
13287
13288 2011-09-27 Eli Zaretskii <eliz@gnu.org>
13289
13290 * xdisp.c (handle_invisible_prop): If invisible text ends on a
13291 newline, reseat the iterator instead of bidi-iterating there one
13292 character at a time. (Bug#9610)
13293 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
13294 TO_CHARPOS if the bidi iterator is at base embedding level.
13295
13296 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
13297
13298 * lread.c (readevalloop): Use correct code for NBSP.
13299 (read1): Likewise. (Bug#9608)
13300
13301 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
13302
13303 * dbusbind.c (Fdbus_register_signal): When service is not
13304 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
13305
13306 2011-09-25 Glenn Morris <rgm@gnu.org>
13307
13308 * buffer.c (truncate-lines): Doc fix.
13309
13310 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
13311
13312 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
13313 (Fset_window_next_buffers): Doc fix.
13314
13315 2011-09-24 Glenn Morris <rgm@gnu.org>
13316
13317 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
13318
13319 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
13320
13321 Fix minor problems found by static checking.
13322 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
13323 * indent.c (Fvertical_motion): Fix == vs = typo.
13324
13325 2011-09-24 Eli Zaretskii <eliz@gnu.org>
13326
13327 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
13328 Default value is now t. Doc fix.
13329
13330 * indent.c (Fvertical_motion): Compute and apply the overshoot
13331 logic when moving up, not only when moving down. Fix the
13332 confusing name and values of the it_overshoot_expected variable;
13333 logic changes accordingly. (Bug#9254) (Bug#9549)
13334
13335 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
13336 CHARPOS is covered by a display string which includes newlines.
13337 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
13338 is covered by a display string with embedded newlines.
13339
13340 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
13341
13342 * dbusbind.c (Fdbus_register_signal): Add match rule to
13343 Vdbus_registered_objects_table. (Bug#9581)
13344 (Fdbus_register_method, Vdbus_registered_objects_table):
13345 Fix docstring.
13346
13347 2011-09-24 Jim Meyering <meyering@redhat.com>
13348
13349 do not ignore write error for any output size
13350 The previous change was incomplete.
13351 While it makes emacs --batch detect the vast majority of stdout
13352 write failures, errors were still ignored whenever the output size is
13353 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
13354 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
13355 && echo FAIL: ignored write error
13356 FAIL: ignored write error
13357 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
13358 && echo FAIL: ignored write error
13359 FAIL: ignored write error
13360 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
13361
13362 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
13363
13364 * emacs.c (Fkill_emacs): In noninteractive mode exit
13365 non-successfully if a write error occurred on stdout. (Bug#9574)
13366
13367 2011-09-21 Eli Zaretskii <eliz@gnu.org>
13368
13369 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
13370 the xassert test.
13371
13372 * dispextern.h (struct it): Update the comment documenting what
13373 can it->OBJECT be.
13374
13375 2011-09-20 Eli Zaretskii <eliz@gnu.org>
13376
13377 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
13378 a display string, extend search for cursor position to end of row.
13379 (find_row_edges): If the row ends in a newline from a display
13380 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
13381 Handle the case of a display string with multiple newlines.
13382 (Fcurrent_bidi_paragraph_direction): Fix search for previous
13383 non-empty line. Fixes confusing cursor motion with arrow keys at
13384 the beginning of a line that starts with whitespace.
13385
13386 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13387
13388 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13389 (bug#9493).
13390
13391 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
13392
13393 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13394 boolean (Bug#9154).
13395
13396 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13397
13398 * xdisp.c (display_line): Record maximum and minimum buffer
13399 positions even if no glyphs were produced (e.g., by a zero-width
13400 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13401 buffer positions that will be removed from the glyph row because
13402 they don't fit.
13403 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13404 column is beyond frame width: don't subtract 1 "pixel" when
13405 computing width of the stretch.
13406 (reseat_at_next_visible_line_start): Undo the change made on
13407 2011-09-17 that saved paragraph information and restored it after
13408 the call to `reseat'. (Bug#9545)
13409
13410 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13411
13412 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13413 and turn window cursor on if cleared (Bug#9415).
13414
13415 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
13416
13417 * search.c (boyer_moore): Take unibyte characters from pattern
13418 literally. (Bug#9458)
13419
13420 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13421
13422 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13423
13424 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13425
13426 Fix minor problem found by static checking.
13427 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13428 initialized, to pacify gcc -Wuninitialized.
13429
13430 * fileio.c: Report proper errno when syscall falls.
13431 (Finsert_file_contents): Save and restore errno,
13432 so that report_file_error outputs the correct diagnostic.
13433 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13434
13435 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13436
13437 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13438
13439 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13440
13441 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13442 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13443
13444 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13445
13446 * xdisp.c (reseat_at_next_visible_line_start): Keep information
13447 about the current paragraph and restore it after the call to reseat.
13448
13449 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13450 (bidi_find_paragraph_start): Search back for paragraph beginning
13451 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13452 (bidi_move_to_visually_next): Only trigger paragraph-related
13453 computations when the last character is a newline or at EOB, not
13454 just any NEUTRAL_B. (Bug#9470)
13455
13456 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13457 truncated lines if point is covered by a display string. (Bug#9524)
13458
13459 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13460
13461 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13462 (cons_to_x_long): New function.
13463 (lisp_data_to_selection_data): Use it. Correct the test for
13464 short-versus-long data; it was negated. Break out of vector
13465 loop, for efficiency, when a long datum is discovered.
13466
13467 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13468
13469 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13470
13471 2011-09-16 Eli Zaretskii <eliz@gnu.org>
13472
13473 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13474 GCC PR/17406) by declaring this function with external scope.
13475
13476 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13477
13478 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13479 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13480
13481 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13482
13483 * editfns.c (Fformat): Correctly handle text properties on "%%".
13484
13485 2011-09-15 Eli Zaretskii <eliz@gnu.org>
13486
13487 * xterm.c (x_draw_composite_glyph_string_foreground):
13488 * w32term.c (x_draw_composite_glyph_string_foreground):
13489 * term.c (encode_terminal_code):
13490 * composite.c (composition_update_it, get_composition_id):
13491 * xdisp.c (get_next_display_element)
13492 (fill_composite_glyph_string): Add comments about special meaning
13493 of TAB characters in a composition.
13494
13495 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13496
13497 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
13498 This occurs when processing a multibyte format.
13499 Problem reported by Wolfgang Jenker.
13500
13501 2011-09-15 Johan Bockgård <bojohan@gnu.org>
13502
13503 * xdisp.c (try_cursor_movement): Only check for exact match if
13504 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13505
13506 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13507
13508 Remove unused external symbols.
13509 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13510 * xdisp.c (calc_pixel_width_or_height): Now static.
13511 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13512 * indent.c (check_display_width):
13513 * w32term.c: Fix comment to match code.
13514 * xterm.c, xterm.h (x_catching_errors): Remove.
13515
13516 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13517
13518 * xselect.c: Use signed conversions more consistently (Bug#9498).
13519 (selection_data_to_lisp_data): Assume incoming selection data are
13520 signed integers, not unsigned. This is to be consistent with
13521 outgoing selection data, which was modified to use signed integers
13522 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13523 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13524 expects long, not unsigned long.
13525
13526 2011-09-14 Eli Zaretskii <eliz@gnu.org>
13527
13528 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13529 computation of loop end. Reported by Johan Bockgård
13530 <bojohan@gnu.org>.
13531
13532 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
13533
13534 * frame.c (Fother_visible_frames_p): Function deleted.
13535
13536 2011-09-12 Eli Zaretskii <eliz@gnu.org>
13537
13538 * indent.c (compute_motion): Process display vector front to back
13539 rather than the other way around. (Bug#2496)
13540
13541 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13542
13543 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13544
13545 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
13546
13547 * minibuf.c (Fread_from_minibuffer): Doc fix.
13548
13549 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13550
13551 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13552 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13553
13554 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13555
13556 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13557 value for non-existent files.
13558
13559 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13560
13561 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13562 set its "size" to -1. This will set the modtime_size field of
13563 the corresponding buffer to -1, which is what
13564 verify-visited-file-modtime expects for files that do not exist.
13565 (Bug#9139)
13566
13567 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13568
13569 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13570 here ...
13571 * lisp.h: ... from here. push_key_description is no longer
13572 defined in keyboard.c, so its declaration should not be in
13573 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13574 logically belongs with push_key_description.
13575
13576 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13577
13578 * buffer.h: Include <sys/types.h> instead of <time.h>.
13579 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13580 Problem reported by Herbert J. Skuhra.
13581
13582 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13583
13584 * xml.c (parse_region): Make the parsing work for
13585 non-comment-starting XML files again (bug#9144).
13586
13587 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13588
13589 * image.c (gif_load): Fix calculation of bottom and right corner.
13590 (Bug#9468)
13591
13592 2011-09-10 Eli Zaretskii <eliz@gnu.org>
13593
13594 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13595 redisplay in small windows.
13596
13597 2011-09-09 Eli Zaretskii <eliz@gnu.org>
13598
13599 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13600
13601 2011-09-08 Martin Rudalics <rudalics@gmx.at>
13602
13603 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13604 Operate on live windows only.
13605
13606 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
13607
13608 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13609
13610 2011-09-07 Eli Zaretskii <eliz@gnu.org>
13611
13612 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13613 only under bidi iteration.
13614
13615 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13616
13617 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13618
13619 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13620
13621 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13622 Without this fix, the command to link temacs failed due to an
13623 undefined symbol __builtin_isnan. This is because
13624 /usr/include/iso/math_c99.h #defines isnan(x) to
13625 __builtin_isnan(x), but the bundled gcc, which identifies itself
13626 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13627 a __builtin_isnan.
13628 * floatfns.c (isnan): #undef, and then #define to a clone of
13629 what's in data.c.
13630 (Fisnan): Always define, since it's always available now.
13631 (syms_of_floatfns): Always define isnan at the Lisp level.
13632
13633 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13634
13635 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13636
13637 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13638
13639 * fileio.c: Fix bugs with large file offsets (Bug#9428).
13640 The previous code assumed that file offsets (off_t values) fit in
13641 EMACS_INT variables, which is not true on typical 32-bit hosts.
13642 The code messed up by falsely reporting buffer overflow in cases
13643 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13644 when "big" contains more than 2**29 bytes, even though this
13645 inserts just one byte and does not overflow the buffer.
13646 (Finsert_file_contents): Store file offsets as off_t
13647 values, not as EMACS_INT values. Check for overflow when
13648 converting between EMACS_INT and off_t. When checking for
13649 buffer overflow or for overlap, take the offsets into account.
13650 Don't use EMACS_INT for small values where int suffices.
13651 When checking for overlap, fix a typo: ZV was used where
13652 ZV_BYTE was intended.
13653 (Fwrite_region): Don't assume off_t fits into 'long'.
13654 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13655
13656 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
13657
13658 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13659
13660 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13661
13662 sprintf-related integer and memory overflow issues (Bug#9412).
13663
13664 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13665 (esprintf, exprintf, evxprintf): New functions.
13666 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13667 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13668 (modify_event_symbol): Do not assume that the length of
13669 name_alist_or_stem is safe to alloca and fits in int.
13670 (Fexecute_extended_command): Likewise for function name and binding.
13671 (Frecursion_depth): Wrap around reliably on integer overflow.
13672 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13673 since some callers pass EMACS_INT values.
13674 (Fsingle_key_description): Don't crash if symbol name contains more
13675 than MAX_ALLOCA bytes.
13676 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13677 (get_minibuffer): Arg is now EMACS_INT, not int.
13678 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13679 (esprintf, exprintf, evxprintf): New decls.
13680 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13681
13682 * dbusbind.c (signature_cat): New function.
13683 (xd_signature, Fdbus_register_signal):
13684 Do not overrun buffer; instead, report string overflow.
13685
13686 * dispnew.c (add_window_display_history): Don't overrun buffer.
13687 Truncate instead; this is OK since it's just a log.
13688
13689 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13690 even if the time zone offset is outlandishly large.
13691 Don't mishandle offset == INT_MIN.
13692
13693 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13694 when creating daemon; the previous buffer-overflow check was incorrect.
13695
13696 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13697 which has the guts of the old verror function.
13698
13699 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13700 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13701
13702 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13703 (font_unparse_xlfd): Don't blindly alloca long strings.
13704 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13705 fits in int, when using sprintf. Use single snprintf to count
13706 length of string rather than counting it via multiple sprintfs;
13707 that's simpler and more reliable.
13708 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13709 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13710 sprintf, in case result does not fit in int.
13711
13712 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13713 (fontset_from_font): Print it.
13714
13715 * frame.c (tty_frame_count): Now printmax_t, not int.
13716 (make_terminal_frame, set_term_frame_name): Print it.
13717 (x_report_frame_params): In X, window IDs are unsigned long,
13718 not signed long, so print them as unsigned.
13719 (validate_x_resource_name): Check for implausibly long names,
13720 and don't assume name length fits in 'int'.
13721 (x_get_resource_string): Don't blindly alloca invocation name;
13722 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13723 not fit in int.
13724
13725 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13726 (xg_check_special_colors, xg_set_geometry):
13727 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13728
13729 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13730 Use esprintf, not sprintf, in case result does not fit in int.
13731
13732 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13733 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13734 it as a large positive number.
13735 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13736 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13737
13738 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13739 in case result does not fit in int.
13740
13741 * print.c (float_to_string): Detect width overflow more reliably.
13742 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13743 buffer overrun. Don't assume list length fits in 'int'. Treat
13744 print length of 0 as 0, not as infinity; to be consistent with other
13745 uses of print length in this function. Don't overflow print length
13746 index. Don't assume hash table size fits in 'long', or that
13747 vectorlike size fits in 'unsigned long'.
13748
13749 * process.c (make_process): Use printmax_t, not int, to format
13750 process-name gensyms.
13751
13752 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13753
13754 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13755 to avoid potential buffer overrun.
13756
13757 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13758 if X resource line is longer than 512 bytes.
13759
13760 * xfns.c (x_window): Make sprintf buffer a bit bigger
13761 to avoid potential buffer overrun.
13762
13763 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13764
13765 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13766
13767 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13768
13769 Integer overflow fixes for scrolling, etc.
13770 Without these, Emacs silently mishandles large integers sometimes.
13771 For example, "C-u 4294967297 M-x recenter" was treated as if
13772 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13773
13774 * xdisp.c (try_window_id): Check Emacs fixnum range before
13775 converting to 'int'.
13776
13777 * window.c (window_scroll_line_based, Frecenter):
13778 Check that an Emacs fixnum is in range before assigning it to 'int'.
13779 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13780 values converted from Emacs fixnums.
13781 (Frecenter): Don't wrap around a line count if it is out of 'int'
13782 range; instead, treat it as an extreme value.
13783 (Fset_window_configuration, compare_window_configurations):
13784 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13785
13786 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13787 that can exceed INT_MAX. Check that EMACS_INT value is in range
13788 before assigning it to the (possibly-narrower) index.
13789 (match_limit): Don't assume that a fixnum can fit in 'int'.
13790
13791 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13792 exceed INT_MAX.
13793
13794 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13795 (Fvertical_motion): Don't wrap around LINES values that don't fit
13796 in 'int'. Instead, treat them as extreme values. This is good
13797 enough for windows, which can't have more than INT_MAX lines anyway.
13798
13799 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13800
13801 * Require libxml/parser.h to avoid compilation warning.
13802
13803 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13804
13805 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13806 since this reportedly can destroy thread storage.
13807
13808 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13809
13810 * syntax.c (find_defun_start): Update all cache variables if
13811 exiting early (Bug#9401).
13812
13813 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13814
13815 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13816
13817 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13818 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13819 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13820
13821 * term.c (tty_append_glyph): New function.
13822 (produce_stretch_glyph): Static function and its prototype deleted.
13823
13824 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13825 Add prototypes.
13826
13827 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13828
13829 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13830 when checking :margin (Bug#9390).
13831 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13832 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13833 so that the name doesn't mislead. All uses changed.
13834
13835 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13836
13837 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13838 set_tty_hooks.
13839
13840 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13841
13842 * xdisp.c (move_it_to): Don't bail out early when reaching
13843 position beyond to_charpos, if we are scanning backwards.
13844 (move_it_vertically_backward): When DY == 0, make sure we get to
13845 the first character in the line after the newline.
13846
13847 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13848
13849 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13850 (ccl_driver): Do not generate an out-of-range pointer.
13851 (Fccl_execute_on_string): Remove unnecessary check for
13852 integer overflow, noted by Stefan Monnier in
13853 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13854 Remove a FIXME that didn't need fixing.
13855 Simplify the newly-introduced buffer reallocation code.
13856
13857 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13858
13859 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13860
13861 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13862
13863 Integer and memory overflow issues (Bug#9196).
13864
13865 * doc.c (get_doc_string): Rework so that
13866 get_doc_string_buffer_size is the actual buffer size, rather than
13867 being 1 less than the actual buffer size; this makes xpalloc more
13868 convenient.
13869
13870 * image.c (x_allocate_bitmap_record, cache_image):
13871 * xselect.c (Fx_register_dnd_atom):
13872 Simplify previous changes by using xpalloc.
13873
13874 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13875 since either will do and ptrdiff_t is convenient with xpalloc.
13876
13877 * charset.c (charset_table_size)
13878 (struct charset_sort_data.priority): Now ptrdiff_t.
13879 (charset_compare): Don't overflow if priorities differ greatly.
13880 (Fsort_charsets): Don't assume list length fits in int.
13881 Check for size-calculation overflow when allocating sort data.
13882 (syms_of_charset): Allocate an initial charset table that is
13883 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13884
13885 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13886
13887 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13888 The actual value is always <= INT_MAX, and leaving it unsigned made
13889 overflow checking harder.
13890
13891 * dispextern.h (struct glyph_matrix.rows_allocated)
13892 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13893 with xpalloc. The values are still always <= INT_MAX.
13894
13895 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13896
13897 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13898 (SAFE_NALLOCA): New macro.
13899
13900 * region-cache.c (struct boundary.pos, find_cache_boundary)
13901 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13902 (set_cache_region, invalidate_region_cache)
13903 (revalidate_region_cache, know_region_cache, region_cache_forward)
13904 (region_cache_backward, pp_cache):
13905 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13906 so that ptrdiff_t * can be passed to xpalloc.
13907 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13908 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13909 (pp_cache): Don't assume cache_len fits in int.
13910 * region-cache.h: Adjust extern decls to match.
13911
13912 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13913 EMACS_INT, since either will do, for xpalloc.
13914
13915 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13916 (xnmalloc, xnrealloc, xpalloc): New functions.
13917
13918 * bidi.c (bidi_shelve_header_size): New constant.
13919 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13920 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13921
13922 * bidi.c (bidi_cache_shrink):
13923 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13924 (overlay_strings):
13925 Don't update size of array until after memory allocation succeeds,
13926 because xmalloc/xrealloc may not return.
13927 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13928 now that we have proper integer overflow checking.
13929 (record_overlay_string, overlay_strings): Catch overflows when
13930 calculating size of overlay_str_buf.
13931
13932 * callproc.c (Fcall_process): Check for size overflow when
13933 calculating size of args2.
13934 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13935 Normally we prefer signed values, but sticking with ptrdiff_t would
13936 require adding more-complicated checks.
13937
13938 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13939 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13940 Redo buffer-overflow calculations to avoid integer overflow.
13941 Add a FIXME comment where memory seems to be over-allocated.
13942
13943 * character.c (Fstring): Check for size-calculation overflow.
13944
13945 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13946 unnecessary integer overflow. Check for size overflow.
13947 (encode_coding_object): Don't update size until xmalloc succeeds.
13948
13949 * composite.c (get_composition_id): Check for overflow in glyph
13950 length calculations.
13951
13952 Integer and memory overflow fixes for display code.
13953 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13954 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13955 (scrolling_window): Check for overflow in size calculations.
13956 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13957 Don't assume glyph table len fits in int.
13958 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13959 (row_table_size): Now ptrdiff_t, not int.
13960 (scrolling_window): Avoid overflow in size calculations.
13961 Don't update size until allocation succeeds.
13962 * fns.c (concat): Check for overflow in size calculations.
13963 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13964 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13965 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13966
13967 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13968 (get_doc_string): Check for size calculation overflow.
13969 Don't update size until allocation succeeds.
13970 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13971 EMACS_INT, where ptrdiff_t will do.
13972 (Fsubstitute_command_keys): Check for string overflow.
13973
13974 * editfns.c (set_time_zone_rule): Don't assume environment length
13975 fits in int.
13976 (message_length): Now ptrdiff_t, not int.
13977 (Fmessage_box): Don't update size until allocation succeeds.
13978 Don't assume message length fits in int.
13979 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13980
13981 * emacs.c (main): Do not reallocate argv, since there is a null at
13982 the end that can be overwritten, and this way there's no need to
13983 worry about size-calculation overflow.
13984 (sort_args): Check for size-calculation overflow.
13985
13986 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13987 alloc succeeds.
13988 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13989
13990 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13991 (x_set_scroll_bar_width, x_figure_window_size):
13992 Check for integer overflow.
13993 (x_set_alpha): Do not assume XINT fits in int.
13994
13995 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13996 This is for the members text_lines, text_cols, total_lines, total_cols,
13997 where the system imposes an 'int' limit.
13998
13999 * fringe.c (Fdefine_fringe_bitmap):
14000 Don't update size until alloc works.
14001
14002 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
14003 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
14004
14005 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
14006 Check for size-calculation overflow.
14007 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
14008 do, as we prefer signed integers.
14009 (id_to_widget.max_size, id_to_widget.used)
14010 (xg_store_widget_in_map, xg_remove_widget_from_map)
14011 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
14012 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
14013 Use and return ptrdiff_t, not int.
14014 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
14015 * gtkutil.h: Change prototypes to match the above.
14016
14017 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
14018 are duplicate now that they've been promoted to lisp.h.
14019 (x_allocate_bitmap_record, x_alloc_image_color)
14020 (make_image_cache, cache_image, xpm_load):
14021 Don't update size until alloc is done.
14022 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
14023 (x_detect_edges):
14024 Check for size calculation overflow.
14025 (ct_colors_allocated_max): New constant.
14026 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
14027 overflow.
14028
14029 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
14030 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
14031 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
14032 Use ptrdiff_t, not int, to count maps.
14033 (read_char_minibuf_menu_prompt): Check for overflow in size
14034 calculations. Don't update size until allocation succeeds.
14035 Redo calculations to avoid overflow.
14036 * keyboard.h: Change prototypes to match the above.
14037
14038 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
14039 to count maps.
14040 (current_minor_maps): Check for size calculation overflow.
14041 * keymap.h: Change prototypes to match the above.
14042
14043 * lread.c (read1, init_obarray): Don't update size until alloc done.
14044
14045 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
14046 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
14047
14048 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
14049 Now ptrdiff_t, not int.
14050 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
14051 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
14052
14053 * process.c (Fnetwork_interface_list): Check for overflow
14054 in size calculation.
14055
14056 * region-cache.c (move_cache_gap): Check for size calculation overflow.
14057
14058 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
14059 overflow. Don't bother calling xmalloc when xrealloc will do.
14060
14061 * search.c (Freplace_match): Check for size calculation overflow.
14062 (Fset_match_data): Don't assume list lengths fit in 'int'.
14063
14064 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
14065 for command line length. Do not attempt to address one before the
14066 beginning of an array, as that's not portable.
14067
14068 * term.c (max_frame_lines): Remove; unused.
14069 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
14070 not int.
14071 (encode_terminal_code, calculate_costs): Check for size
14072 calculation overflow.
14073 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
14074 table lengths and related sizes. Don't update size until alloc
14075 done. Redo calculations to avoid overflow.
14076 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
14077
14078 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
14079 subtracting pointers.
14080 (gobble_line): Check for overflow more carefully. Don't update size
14081 until alloc done.
14082
14083 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
14084 Don't update size until alloc done.
14085 Redo size calculations to avoid overflow.
14086 Check for size calculation overflow.
14087 (main) [DEBUG]: Fix typo in invoking tparam1.
14088
14089 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
14090 Use ptrdiff_t, not int, for sizes.
14091 (store_mode_line_noprop_char): Don't update size until alloc done.
14092
14093 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
14094 Use ptrdiff_t, not int, for sizes.
14095 (Finternal_make_lisp_face, cache_face):
14096 Check for size calculation overflow.
14097 (cache_face): Treat size calculation overflows as if they were
14098 memory exhaustion (the usual treatment), rather than aborting.
14099
14100 * xfns.c (x_encode_text, x_set_name_internal)
14101 (Fx_change_window_property): Use ptrdiff_t, not int, to count
14102 sizes, since they can exceed INT_MAX in size. Check for size
14103 calculation overflow.
14104
14105 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
14106 (xg_select): Check for size calculation overflow.
14107 Don't update size until alloc done.
14108
14109 * xrdb.c (get_environ_db): Don't assume path length fits in int,
14110 as sprintf is limited to int lengths.
14111
14112 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
14113 (X_LONG_MIN): New macros.
14114 Use them to make the following changes clearer.
14115 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
14116 This change doesn't affect the value now, but it may help remind
14117 future maintainers not to raise the value too much later.
14118 (SELECTION_QUANTUM): Remove, replacing with ...
14119 (selection_quantum): ... new function, which avoids overflow.
14120 All uses changed.
14121 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
14122 assumption that selection length fits in 'int'.
14123 (x_reply_selection_request, x_handle_selection_request)
14124 (x_get_window_property, receive_incremental_selection)
14125 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
14126 (lisp_data_to_selection_data, clean_local_selection_data):
14127 Use ptrdiff_t, not int, to record length of selection.
14128 (x_reply_selection_request, x_get_window_property)
14129 (receive_incremental_selection, x_property_data_to_lisp):
14130 Redo calculations to avoid overflow.
14131 (x_reply_selection_request): When sending hint, ceiling it at
14132 X_LONG_MAX rather than relying on wraparound overflow to send
14133 something.
14134 (x_get_window_property, receive_incremental_selection)
14135 (lisp_data_to_selection_data, x_property_data_to_lisp):
14136 Check for size-calculation overflow.
14137 (x_get_window_property, receive_incremental_selection)
14138 (lisp_data_to_selection_data, Fx_register_dnd_atom):
14139 Don't store size until memory allocation succeeds.
14140 (x_get_window_property): Plug memory leak on memory exhaustion.
14141 Don't double-block input; malloc is safe here. Don't assume 2**34
14142 - 4 fits in unsigned long. Add an xassert to check
14143 XGetWindowProperty overflow. Be more careful about overflow
14144 calculations, and distinguish size from memory overflow better.
14145 (receive_incremental_selection): When tracing, don't assume
14146 unsigned int is less than INT_MAX.
14147 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
14148 harmful) conversions of unsigned short to int.
14149 (lisp_data_to_selection_data): Don't assume that integers
14150 in the range -65535 through -1 fit in an X unsigned short.
14151 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
14152 result parameters unless successful. Rely on cons_to_unsigned
14153 to report problems with elements; the old code wasn't right anyway.
14154 (x_check_property_data): Check for int overflow; we cannot use
14155 a wider type due to X limits.
14156 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
14157
14158 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
14159
14160 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
14161 (x_term_init): Check for size calculation overflow.
14162 (x_color_cells): Don't store size until memory allocation succeeds.
14163 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
14164 Don't assume alloca size is less than MAX_ALLOCA.
14165 (x_term_init): Don't assume length fits in int (sprintf is limited
14166 to int size).
14167
14168 Use ptrdiff_t for composition IDs.
14169 * character.c (lisp_string_width):
14170 * composite.c (composition_table_size, n_compositions)
14171 (get_composition_id, composition_gstring_from_id):
14172 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
14173 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
14174 * window.c (Frecenter):
14175 Use ptrdiff_t, not int, for composition IDs.
14176 * composite.c (get_composition_id): Check for integer overflow.
14177 * composite.h: Adjust prototypes to match the above changes.
14178
14179 Use ptrdiff_t for hash table indexes.
14180 * category.c (hash_get_category_set):
14181 * ccl.c (ccl_driver):
14182 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
14183 * coding.c (coding_system_charset_list, detect_coding_system):
14184 * coding.h (struct coding_system.id):
14185 * composite.c (get_composition_id, gstring_lookup_cache):
14186 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
14187 * image.c (xpm_get_color_table_h):
14188 * lisp.h (hash_lookup, hash_put):
14189 * minibuf.c (Ftest_completion):
14190 Use ptrdiff_t for hash table indexes, not int (which is too
14191 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
14192 32-bit --with-wide-int hosts).
14193
14194 * charset.c (Fdefine_charset_internal): Check for integer overflow.
14195 Add a FIXME comment about memory leaks.
14196 (syms_of_charset): Don't assume xmalloc returns.
14197
14198 Don't assume that stated character widths fit in int.
14199 * character.c (Fchar_width, c_string_width, lisp_string_width):
14200 * character.h (CHAR_WIDTH):
14201 * indent.c (MULTIBYTE_BYTES_WIDTH):
14202 Use sanitize_char_width to avoid undefined and/or bad behavior
14203 with outlandish widths.
14204 * character.h (sanitize_tab_width): Rename from sanitize_width,
14205 now that we have two such functions. All uses changed.
14206 (sanitize_char_width): New inline function.
14207
14208 Don't assume that tab-width fits in int.
14209 * character.h (sanitize_width): New inline function.
14210 (SANE_TAB_WIDTH): New macro.
14211 (ASCII_CHAR_WIDTH): Use it.
14212 * indent.c (sane_tab_width): Remove. All uses replaced by
14213 SANE_TAB_WIDTH (current_buffer).
14214 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
14215
14216 * fileio.c: Integer overflow issues with file modes.
14217 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
14218
14219 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
14220 Remove unreachable code.
14221 (read_hex, load_charset_map_from_file): Check for integer overflow.
14222
14223 * xterm.c: Don't go over XClientMessageEvent limit.
14224 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
14225 (x_send_scroll_bar_event): Likewise. Check that the size does not
14226 exceed limits imposed by XClientMessageEvent, as well as the usual
14227 ptrdiff_t and size_t limits.
14228
14229 * keyboard.c: Overflow, signedness and related fixes.
14230 (make_lispy_movement): Use same integer type in forward decl
14231 that is used in the definition.
14232 (read_key_sequence, keyremap_step):
14233 Change bufsize argument back to int, undoing my 2011-03-30 change.
14234 We prefer signed types, and int is wide enough here.
14235 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
14236 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
14237 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
14238 length, not size_t. Use ptrdiff_t for index, not int.
14239 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
14240 possibility of integer overflow.
14241
14242 Overflow, signedness and related fixes for images.
14243
14244 * dispextern.h (struct it.stack[0].u.image.image_id)
14245 (struct_it.image_id, struct image.id, struct image_cache.size)
14246 (struct image_cache.used, struct image_cache.ref_count):
14247 * gtkutil.c (update_frame_tool_bar):
14248 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
14249 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
14250 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
14251 * nsmenu.m (update_frame_tool_bar):
14252 * xdisp.c (calc_pixel_width_or_height):
14253 * xfns.c (image_cache_refcount):
14254 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
14255 on typical 64-bit hosts.
14256
14257 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14258 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
14259 Omit unnecessary casts to int.
14260 (parse_image_spec): Check that integers fall into 'int' range
14261 when the callers expect that.
14262 (image_ascent): Redo ascent calculation to avoid int overflow.
14263 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
14264 (lookup_image): Remove unnecessary tests.
14265 (xbm_image_p): Locals are now of int, not EMACS_INT,
14266 since parse_image_check makes sure they fit into int.
14267 (png_load, gif_load, svg_load_image):
14268 Prefer int to unsigned where either will do.
14269 (tiff_handler): New function, combining the cores of the
14270 old tiff_error_handler and tiff_warning_handler.
14271 This function is rewritten to use vsnprintf and thereby avoid
14272 stack buffer overflows. It uses only the features of vsnprintf
14273 that are common to both POSIX and native Microsoft.
14274 (tiff_error_handler, tiff_warning_handler): Use it.
14275 (tiff_load, gif_load, imagemagick_load_image):
14276 Don't assume :index value fits in 'int'.
14277 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
14278 (imagemagick_load_image): Check that crop parameters fit into
14279 the integer types that MagickCropImage accepts. Don't assume
14280 Vimagemagick_render_type has a nonnegative value. Don't assume
14281 size_t fits in 'long'.
14282 (gs_load): Use printmax_t to print the widest integers possible.
14283 Check for integer overflow when computing image height and width.
14284
14285 2011-08-26 Eli Zaretskii <eliz@gnu.org>
14286
14287 * xdisp.c (redisplay_window): Don't force window start if point
14288 will be invisible in the resulting window. (Bug#9324)
14289
14290 2011-08-25 Eli Zaretskii <eliz@gnu.org>
14291
14292 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
14293 the display spec is of the form `(space ...)'.
14294 (handle_display_spec): Return the value returned by
14295 handle_single_display_spec, not just 1 or zero.
14296 (handle_single_display_spec): If the display spec is of the form
14297 `(space ...)', and specifies display in the text area, return 2
14298 rather than 1.
14299 (try_cursor_movement): Check for the need to scroll more
14300 accurately, and prefer exact match for point under bidi.
14301 Don't advance `row' beyond the last row of the window.
14302
14303 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
14304 into disp_prop; all users changed.
14305
14306 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
14307 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
14308 for the text covered by the display property.
14309
14310 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
14311
14312 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
14313 Change return value to nil.
14314 (Frecord_buffer): Delete unused function.
14315
14316 2011-08-24 Eli Zaretskii <eliz@gnu.org>
14317
14318 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
14319 buffers, return left-to-right.
14320 (set_cursor_from_row): Consider candidate row a win if its glyph
14321 represents a newline and point is on that newline. Fixes cursor
14322 positioning on the newline at EOL of R2L text within L2R
14323 paragraph, and vice versa.
14324 (try_cursor_movement): Check continued rows, in addition to
14325 continuation rows. Fixes unwarranted scroll when point enters a
14326 continued line of R2L text within an L2R paragraph, or vice versa.
14327 (cursor_row_p): Consider the case of point being equal to
14328 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
14329 from the end of a short line to the beginning of a continued line
14330 of R2L text within L2R paragraph.
14331 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
14332 composed characters.
14333
14334 * bidi.c (bidi_check_type): Use xassert.
14335 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
14336 members.
14337
14338 2011-08-23 Eli Zaretskii <eliz@gnu.org>
14339
14340 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
14341 a character.
14342
14343 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
14344
14345 * nsfont.m (ns_otf_to_script): Fix typo.
14346
14347 2011-08-22 Kenichi Handa <handa@m17n.org>
14348
14349 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
14350 extra slot even if the purpose is char-code-property-table.
14351
14352 2011-08-23 Eli Zaretskii <eliz@gnu.org>
14353
14354 * xdisp.c (redisplay_window): When computing centering_position,
14355 account for the height of the header line. (Bug#8874)
14356
14357 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
14358 instead of CHAR_TO_BYTE. Fixes a crash when a completion
14359 candidate is selected by the mouse, and that candidate has a
14360 composed character under the mouse.
14361
14362 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
14363 coordinates reported by pos-visible-in-window-p for a composed
14364 character in column zero.
14365
14366 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
14367
14368 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
14369
14370 2011-08-22 Eli Zaretskii <eliz@gnu.org>
14371
14372 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
14373 consider it a hit if to_charpos is anywhere in the range of the
14374 composed buffer positions.
14375
14376 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
14377
14378 * image.c (gif_load): Don't assume that each subimage has the same
14379 dimensions as the base image. Handle disposal method that is
14380 "undefined" by the gif spec (Bug#9335).
14381
14382 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
14383
14384 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
14385 (Fcondition_case): Document `debug' symbol in error handler.
14386
14387 2011-08-19 Eli Zaretskii <eliz@gnu.org>
14388
14389 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14390 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14391 from an Org mode buffer to a Speedbar frame.
14392
14393 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14394 a composition, take its buffer position from IT->cmp_it.charpos.
14395 Fixes cursor positioning at the beginning of a line that begins
14396 with a composed character.
14397
14398 2011-08-18 Eli Zaretskii <eliz@gnu.org>
14399
14400 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14401 character bidirectional type, use STRONG_L instead. Fixes crashes
14402 in a buffer produced by `describe-categories'.
14403
14404 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14405 members before the level stack, so they would be saved and
14406 restored when copying iterator state. Fixes incorrect reordering
14407 around TABs covered by display properties.
14408
14409 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14410
14411 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
14412
14413 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
14414
14415 * eval.c (internal_condition_case, internal_condition_case_1)
14416 (internal_condition_case_2, internal_condition_case_n):
14417 Remove unnecessary aborts (Bug#9081).
14418
14419 2011-08-17 Eli Zaretskii <eliz@gnu.org>
14420
14421 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14422 has no `load' handler, try opening the file locally. (Bug#9311)
14423
14424 2011-08-16 Ken Brown <kbrown@cornell.edu>
14425
14426 * gmalloc.c: Expand comment.
14427
14428 2011-08-16 Eli Zaretskii <eliz@gnu.org>
14429
14430 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14431 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14432
14433 2011-08-16 Ken Brown <kbrown@cornell.edu>
14434
14435 Fix memory allocation problems in Cygwin build (Bug#9273).
14436
14437 * unexcw.c ( __malloc_initialized): Declare external variable.
14438 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14439
14440 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14441 New variables.
14442 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14443 dumped emacs.
14444 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14445 in the static heap.
14446 [CYGWIN] (special_realloc): New function.
14447 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14448 requests to realloc storage in the static heap.
14449
14450 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14451
14452 * bidi.c (bidi_initialize): Remove unused local.
14453
14454 2011-08-15 Eli Zaretskii <eliz@gnu.org>
14455
14456 * bidimirror.h:
14457 * biditype.h: Remove file.
14458 * makefile.w32-in ($(BLD)/bidi.$(O)):
14459 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
14460
14461 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14462
14463 * chartab.c: Improve commentary for the uniprop_table API.
14464
14465 * bidi.c (bidi_paragraph_init): Support zero value of
14466 bidi_ignore_explicit_marks_for_paragraph_level.
14467 (bidi_initialize): Use uniprop_table instead of including
14468 biditype.h and bidimirror.h.
14469
14470 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14471 coordinates of the iterator when restoring from ppos_it.
14472 (Bug#9296)
14473
14474 2011-08-14 Kenichi Handa <handa@m17n.org>
14475
14476 * process.c (create_process): Call setup_process_coding_systems
14477 after the pid of the process is set to -1 (Bug#8162).
14478
14479 2011-08-14 Eli Zaretskii <eliz@gnu.org>
14480
14481 * xdisp.c (move_it_in_display_line_to): Don't invoke
14482 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14483 ppos_it. Fixes vertical cursor motion when line beginning is
14484 covered by an image. (Bug#9296)
14485
14486 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14487
14488 * nsterm.h (ns_run_ascript): Declare.
14489 (NSAPP_DATA2_RUNASSCRIPT): Define.
14490
14491 * nsfns.m (as_script, as_result, as_status): New static variables.
14492 (ns_run_ascript): New function.
14493 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
14494 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14495 the event loop. Get status from as_status (Bug#7276).
14496
14497 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14498 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14499 the event loop (Bug#7276).
14500
14501 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14502
14503 * gnutls.c (QCgnutls_bootprop_priority)
14504 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14505 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14506 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14507 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14508 (QCgnutls_bootprop_verify_hostname_error)
14509 (QCgnutls_bootprop_callbacks_verify): Rename from
14510 Qgnutls_bootprop_..., all uses changed.
14511
14512 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14513 uses changed.
14514
14515 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14516
14517 * xfaces.c (Qframe_set_background_mode): Now static.
14518 * dispextern.h (Qframe_set_background_mode): Remove decl.
14519
14520 * process.c (Fnetwork_interface_info): Declare local only if needed.
14521
14522 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14523
14524 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14525 (Fnetwork_interface_list): Allocate in increments of bytes instead
14526 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14527 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14528 sockaddr.
14529 (struct ifflag_def): notrailers is smart on OSX.
14530 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14531 Get hardware address with getifaddrs if available.
14532
14533 2011-08-12 Eli Zaretskii <eliz@gnu.org>
14534
14535 * xdisp.c (iterate_out_of_display_property): xassert that
14536 IT->position is set to within IT->object's boundaries. Break from
14537 the loop as soon as EOB is reached; avoids infloops in redisplay
14538 when IT->position is set up wrongly due to some bug.
14539 Set IT->current to match the bidi iterator unconditionally.
14540 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14541 entry. Force push_it to save on the stack the current
14542 buffer/string position, to be restored by pop_it. Fix flags in
14543 the iterator structure wrt the object coming from a display
14544 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14545 properties. (Bug#9284)
14546
14547 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
14548
14549 * fontset.c (fontset_get_font_group): Add proper type checks.
14550 (Bug#9172)
14551
14552 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14553
14554 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14555 and LC_VERSION_MIN_MACOSX.
14556 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14557 (dump_it) [LC_FUNCTION_STARTS]: Use it.
14558
14559 2011-08-08 Eli Zaretskii <eliz@gnu.org>
14560
14561 * xdisp.c (forward_to_next_line_start): Allow to use the
14562 no-display-properties-and-no-overlays under bidi display.
14563 Set disp_pos in the bidi iterator to avoid searches for display
14564 properties and overlays.
14565
14566 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
14567
14568 * editfns.c (Fset_time_zone_rule): Document relationship with the
14569 setenv function.
14570
14571 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14572 the font entity extracted from the cache (Bug#8109).
14573
14574 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
14575
14576 * composite.c (autocmp_chars): Don't reset point. That is done by
14577 restore_point_unwind (Bug#5984).
14578
14579 2011-08-07 Juri Linkov <juri@jurta.org>
14580
14581 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14582 to show the arg `TIME' instead of `TIMEVAL'.
14583
14584 2011-08-06 Eli Zaretskii <eliz@gnu.org>
14585
14586 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14587 display property strides EOL and includes a newline, as in
14588 longlines-mode. (Bug#9254)
14589 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14590 word-wrap under bidirectional display. (Bug#9224)
14591
14592 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14593 is non-zero, even if the data buffer is NULL. Fixes a crash in
14594 vertical-motion with longlines-mode. (Bug#9254)
14595
14596 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14597
14598 * bidi.c <bidi_cache_total_alloc>: Now static.
14599 (bidi_initialize): Initialize bidi_cache_total_alloc.
14600
14601 * xdisp.c (display_line): Release buffer allocated for shelved bidi
14602 cache. (Bug#9221)
14603
14604 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14605 amount allocated this far in `bidi_cache_total_alloc'.
14606 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14607 non-zero, only free the data buffer without restoring the cache
14608 contents. All callers changed.
14609
14610 * dispextern.h (bidi_unshelve_cache): Update prototype.
14611
14612 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14613 (move_it_in_display_line, move_it_to)
14614 (move_it_vertically_backward, move_it_by_lines): Replace the call
14615 to xfree to an equivalent call to bidi_unshelve_cache.
14616 (move_it_in_display_line_to): Fix logic of returning
14617 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
14618
14619 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14620
14621 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14622 came from a string character with a `cursor' property. (Bug#9229)
14623
14624 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14625
14626 * Makefile.in (LIB_PTHREAD): New variable.
14627 (LIBES): Add LIB_PTHREAD (Bug#9216).
14628
14629 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14630 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14631
14632 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14633
14634 * regex.c (re_iswctype): Remove some redundant boolean conversions.
14635
14636 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14637
14638 * xterm.c (x_find_topmost_parent): New function.
14639 (x_set_frame_alpha): Find topmost parent window with
14640 x_find_topmost_parent and set the property there also (bug#9181).
14641 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14642
14643 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14644
14645 * callproc.c (Fcall_process): Avoid vfork clobbering
14646 the local vars buffer, coding_systems, current_dir.
14647
14648 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14649
14650 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14651
14652 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14653
14654 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14655 so that it is not optimized away.
14656
14657 * xdisp.c (compute_display_string_pos): Remove unused local.
14658
14659 2011-08-02 Eli Zaretskii <eliz@gnu.org>
14660
14661 Fix slow cursor motion and scrolling in large buffers with
14662 selective display, like Org Mode buffers. (Bug#9218)
14663
14664 * dispextern.h (struct bidi_it): New member disp_prop_p.
14665
14666 * xdisp.c: Remove one-slot cache of display string positions.
14667 (compute_display_string_pos): Accept an additional argument
14668 DISP_PROP_P; callers changed. Scan at most 5K characters forward
14669 for a display string or property. If found, set DISP_PROP_P
14670 non-zero.
14671
14672 * bidi.c (bidi_fetch_char): Accept an additional argument
14673 DISP_PROP_P, and pass it to compute_display_string_pos.
14674 Only handle text covered by a display string if DISP_PROP_P is returned
14675 non-zero. All callers of bidi_fetch_char changed.
14676
14677 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14678
14679 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14680
14681 2010-12-03 Don March <don@ohspite.net>
14682
14683 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14684 last character M-[char] is translated to ESC [char] (bug#7541).
14685
14686 2011-08-02 Kenichi Handa <handa@m17n.org>
14687
14688 * lisp.h (uniprop_table): Extern it.
14689
14690 * chartab.c (uniprop_table): Make it non-static.
14691
14692 2011-08-01 Eli Zaretskii <eliz@gnu.org>
14693
14694 * xdisp.c (forward_to_next_line_start): Accept additional argument
14695 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14696 on the newline.
14697 (reseat_at_next_visible_line_start): Use the bidi iterator state
14698 returned by forward_to_next_line_start to restore the state of
14699 it->bidi_it after backing up to previous newline. (Bug#9212)
14700
14701 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14702
14703 * regex.c (re_comp): Protoize.
14704 (re_exec): Fix return type.
14705 (regexec): Fix type of `ret'. (Bug#9203)
14706
14707 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14708
14709 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14710 This is needed if max-image-size is a floating-point number.
14711
14712 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14713
14714 * print.c (print_object): Print empty symbol as ##.
14715
14716 * lread.c (read1): Read ## as empty symbol.
14717
14718 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14719
14720 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14721 setting frame foreground color (Bug#9175).
14722 (x_set_background_color): Likewise.
14723
14724 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14725 contents (Bug#9176).
14726 (EmacsTooltip -init): Remove bezels and add shadows to
14727 tooltip windows.
14728
14729 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14730 or scroll bar (Bug#8470).
14731
14732 * nsfont.m (nsfont_open): Remove assignment to voffset and
14733 unnecessary vars hshink, expand, hd, full_height, min_height.
14734 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14735
14736 * nsterm.h (nsfont_info): Remove voffset field.
14737
14738 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14739
14740 Implement strike-through and overline on NextStep (Bug#8863).
14741
14742 * nsfont.m (nsfont_open): Use underline position provided by font,
14743 instead of hard-coded value of 2.
14744 (nsfont_draw): Call ns_draw_text_decoration instead.
14745
14746 * nsterm.h: Add declaration for ns_draw_text_decoration.
14747
14748 * nsterm.m (ns_draw_text_decoration): New function for drawing
14749 underline, overline, and strike-through.
14750 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14751 ns_draw_text_decoration. Change treatment of cursor drawing to
14752 accommodate underlining, etc.
14753
14754 2011-07-28 Eli Zaretskii <eliz@gnu.org>
14755
14756 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14757 default.
14758
14759 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14760
14761 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14762 Without this fix, if a signal arrives just after memory fills up,
14763 'malloc' might be invoked reentrantly.
14764
14765 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14766 In other words, assume that every image size is allowed, on non-X
14767 hosts. This assumption is probably wrong, but it lets Emacs compile.
14768
14769 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14770
14771 * regex.c (re_iswctype): Convert return values to boolean.
14772
14773 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14774
14775 * xdisp.c (compute_display_string_pos): Don't use cached display
14776 string position if the buffer had its restriction changed.
14777 (Bug#9184)
14778
14779 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14780
14781 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14782
14783 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14784
14785 Integer signedness and overflow and related fixes. (Bug#9079)
14786
14787 * bidi.c: Integer size and overflow fixes.
14788 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14789 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14790 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14791 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14792 (bidi_find_other_level_edge):
14793 Use ptrdiff_t instead of EMACS_INT where either will do.
14794 This works better on 32-bit hosts configured --with-wide-int.
14795 (bidi_cache_ensure_space): Check for size-calculation overflow.
14796 Use % rather than repeated addition, for better worst-case speed.
14797 Don't set bidi_cache_size until after xrealloc returns, because it
14798 might not return.
14799 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14800 (bidi_cache_ensure_space): Also check that the bidi cache size
14801 does not exceed that of the largest Lisp string or buffer. See Eli
14802 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14803
14804 * alloc.c (__malloc_size_t): Remove.
14805 All uses replaced by size_t. See Andreas Schwab's note
14806 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14807
14808 * image.c: Improve checking for integer overflow.
14809 (check_image_size): Assume that f is nonnull, since
14810 it is always nonnull in practice. This is one less thing to
14811 worry about when checking for integer overflow later.
14812 (x_check_image_size): New function, which checks for integer
14813 overflow issues inside X.
14814 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14815 This removes the need for a memory_full check.
14816 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14817 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14818 (xbm_read_bitmap_data): Change locals back to 'int', since
14819 their values must fit in 'int'.
14820 (xpm_load_image, png_load, tiff_load):
14821 Invoke x_create_x_image_and_pixmap earlier,
14822 to avoid much needless work if the image is too large.
14823 (tiff_load): Treat overly large images as if
14824 x_create_x_image_and_pixmap failed, not as malloc failures.
14825 (gs_load): Use x_check_image_size.
14826
14827 * gtkutil.c: Omit integer casts.
14828 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14829 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14830
14831 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14832
14833 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14834 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14835 would wrongly return t on a 64-bit host.
14836
14837 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14838 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14839 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14840 and therefore cause GCC to emit a bogus diagnostic in some cases.
14841
14842 * image.c: Integer signedness and overflow and related fixes.
14843 This is not an exhaustive set of fixes, but it's time to
14844 record what I've got.
14845 (lookup_pixel_color, check_image_size): Remove redundant decls.
14846 (check_image_size): Don't assume that arbitrary EMACS_INT values
14847 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14848 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14849 (tiff_load, imagemagick_load_image):
14850 Check for overflow in size calculations.
14851 (x_create_x_image_and_pixmap): Remove unnecessary test for
14852 xmalloc returning NULL; that can't happen.
14853 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14854 (xpm_color_bucket): Use better integer hashing function.
14855 (xpm_cache_color): Don't possibly over-allocate memory.
14856 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14857 (gif_memory_source):
14858 Use ptrdiff_t, not int or size_t, to record sizes.
14859 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14860 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14861 either works, as we prefer signed integers.
14862 (tiff_read_from_memory, tiff_write_from_memory):
14863 Return tsize_t, not size_t, since that's what the TIFF API wants.
14864 (tiff_read_from_memory): Don't fail simply because the read would
14865 go past EOF; instead, return a short read.
14866 (tiff_load): Omit no-longer-needed casts.
14867 (Fimagemagick_types): Don't assume size fits into 'int'.
14868
14869 Improve hashing quality when configured --with-wide-int.
14870 * fns.c (hash_string): New function, taken from sxhash_string.
14871 Do not discard information about ASCII character case; this
14872 discarding is no longer needed.
14873 (sxhash-string): Use it. Change sig to match it. Caller changed.
14874 * lisp.h: Declare it.
14875 * lread.c (hash_string): Remove, since we now use fns.c's version.
14876 The fns.c version returns a wider integer if --with-wide-int is
14877 specified, so this should help the quality of the hashing a bit.
14878
14879 * emacs.c: Integer overflow minor fix.
14880 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14881 Define only if GNU_LINUX.
14882 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14883
14884 * dispnew.c: Integer signedness and overflow fixes.
14885 Remove unnecessary forward decls, that were a maintenance hassle.
14886 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14887 All uses changed.
14888 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14889 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14890 (prepare_desired_row, line_draw_cost):
14891 Use int, not unsigned, where either works.
14892 (save_current_matrix, restore_current_matrix):
14893 Use ptrdiff_t, not size_t, where either works.
14894 (init_display): Check for overflow more accurately, and without
14895 relying on undefined behavior.
14896
14897 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14898 Remove, replacing with the new symbols in lisp.h. All uses changed.
14899 * fileio.c (make_temp_name):
14900 * filelock.c (lock_file_1, lock_file):
14901 * xdisp.c (message_dolog):
14902 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14903 Use pMd etc. instead.
14904 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14905 replacing the pWIDE etc. symbols removed from editfns.c.
14906
14907 * keyboard.h (num_input_events): Now uintmax_t.
14908 This is (very slightly) less likely to mess up due to wraparound.
14909 All uses changed.
14910
14911 * buffer.c: Integer signedness fixes.
14912 (alloc_buffer_text, enlarge_buffer_text):
14913 Use ptrdiff_t rather than size_t when either will do, as we prefer
14914 signed integers.
14915
14916 * alloc.c: Integer signedness and overflow fixes.
14917 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14918 (__malloc_size_t): Default to size_t, not to int.
14919 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14920 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14921 Prefer ptrdiff_t to size_t when either would do, as we prefer
14922 signed integers.
14923 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14924 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14925 Now const. Initialize with values that are in range even if char
14926 is signed.
14927 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14928 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14929 These functions do the right thing with sizes > 2**32.
14930 (check_depth): Now ptrdiff_t, not int.
14931 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14932 Adjust to new way of storing sizes. Check for size overflow bugs
14933 in rest of code.
14934 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14935 slightly wrong anyway, as it missed one instance of
14936 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14937 (refill_memory_reserve): Omit needless cast to size_t.
14938 (mark_object_loop_halt): Mark as externally visible.
14939
14940 * xselect.c: Integer signedness and overflow fixes.
14941 (Fx_register_dnd_atom, x_handle_dnd_message):
14942 Use ptrdiff_t, not size_t, since we prefer signed.
14943 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14944 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14945 x_dnd_atoms_size and x_dnd_atoms_length.
14946
14947 * doprnt.c: Prefer signed to unsigned when either works.
14948 * eval.c (verror):
14949 * doprnt.c (doprnt):
14950 * lisp.h (doprnt):
14951 * xdisp.c (vmessage):
14952 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14953 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14954 prefer signed arithmetic to avoid comparison confusion.
14955 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14956 but is a bit tricky.
14957
14958 Assume freestanding C89 headers, string.h, stdlib.h.
14959 * data.c, doprnt.c, floatfns.c, print.c:
14960 Include float.h unconditionally.
14961 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14962 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14963 * regex.c: Likewise for stddef.h, string.h.
14964 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14965 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14966 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14967 (STDC_HEADERS): Remove obsolete defines.
14968 * sysdep.c: Include limits.h unconditionally.
14969
14970 Assume support for memcmp, memcpy, memmove, memset.
14971 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14972 * regex.c (memcmp, memcpy):
14973 Remove; we assume C89 now.
14974
14975 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14976 (__malloc_safe_bcopy): Remove; no longer needed.
14977
14978 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14979 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14980 well either way, and we prefer signed to unsigned.
14981
14982 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14983
14984 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14985 closes the connection while we're reading (bug#9182).
14986
14987 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14988
14989 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14990 are specified (Bug#9168).
14991
14992 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14993
14994 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14995 Found by GCC static checking and --with-wide-int on a 32-bit host.
14996
14997 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14998
14999 * xdisp.c (compute_display_string_pos): Fix logic of caching
15000 previous display string position. Initialize cached_prev_pos to
15001 -1. Fixes slow-down at the beginning of a buffer.
15002
15003 2011-07-24 Eli Zaretskii <eliz@gnu.org>
15004
15005 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
15006 for attrs[LFACE_FONTSET_INDEX].
15007
15008 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
15009
15010 * xml.c (parse_region): Remove unused local
15011 that was recently introduced.
15012
15013 2011-07-23 Eli Zaretskii <eliz@gnu.org>
15014
15015 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
15016 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
15017
15018 * xdisp.c (move_it_in_display_line_to): Record the best matching
15019 position for TO_CHARPOS while scanning the line, and restore it on
15020 exit if none of the characters scanned was an exact match.
15021 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
15022 when exact match is impossible due to invisible text, and the
15023 lines are truncated.
15024
15025 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
15026
15027 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
15028 for OSX >= 10.7.
15029
15030 2011-07-22 Eli Zaretskii <eliz@gnu.org>
15031
15032 Fix a significant slow-down of cursor motion with C-n, C-p,
15033 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
15034 auto-repeat under bidi redisplay in fontified buffers.
15035 * xdisp.c (compute_stop_pos_backwards): New function.
15036 (next_element_from_buffer): Call compute_stop_pos_backwards to
15037 find a suitable prev_stop when we find ourselves before
15038 base_level_stop.
15039 (reseat): Don't look for prev_stop, as that could mean a very long
15040 run.
15041 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
15042 <cached_disp_overlay_modiff>: Cache for last found display string
15043 position.
15044 (compute_display_string_pos): Return the cached position if asked
15045 about the same buffer in the same area of character positions, and
15046 the buffer wasn't changed since the time the display string
15047 position was cached.
15048
15049 2011-07-22 Eli Zaretskii <eliz@gnu.org>
15050
15051 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
15052 is an integer, which is important for empty lines. (Bug#9149)
15053
15054 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
15055
15056 * frame.c (Fmodify_frame_parameters): In tty case, update the
15057 default face if necessary (Bug#4238).
15058
15059 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
15060
15061 * editfns.c (Fstring_to_char): No need to explain what a character
15062 is in the docstring (Bug#6576).
15063
15064 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15065
15066 * xml.c (parse_region): Make sure we always return a tree.
15067
15068 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
15069
15070 * xml.c (parse_region): If a document contains only comments,
15071 return that, too.
15072
15073 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15074
15075 * xml.c (make_dom): Return comments, too.
15076
15077 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
15078
15079 Port to OpenBSD.
15080 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
15081 and the surrounding thread.
15082 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
15083 rather than fgets, and retry after EINTR. Otherwise, 'emacs
15084 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
15085 timer goes off.
15086 * s/openbsd.h (BROKEN_SIGIO): Define.
15087 * unexelf.c (unexec) [__OpenBSD__]:
15088 Don't update the .mdebug section of the Alpha COFF symbol table.
15089
15090 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15091
15092 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
15093 (bug#8460).
15094
15095 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
15096
15097 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
15098 This fixes some race conditions on the permissions of any newly
15099 created file.
15100
15101 * alloc.c (valid_pointer_p): Use pipe, not open.
15102 This fixes some permissions issues when debugging.
15103
15104 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
15105 If fchown fails to set both uid and gid, try to set just gid,
15106 as that is sometimes allowed. Adjust the file's mode to eliminate
15107 setuid or setgid bits that are inappropriate if fchown fails.
15108
15109 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
15110
15111 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
15112 to compare Lisp_Objects.
15113 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
15114 global_gnutls_log_level, don't mistake it for a Lisp_Object.
15115 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
15116
15117 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
15118
15119 * lread.c (read_integer): Unread even EOF character.
15120 (read1): Likewise. Properly record start position of symbol.
15121
15122 * lread.c (read1): Read `#:' as empty uninterned symbol if no
15123 symbol character follows.
15124
15125 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
15126
15127 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
15128 This works around a problem with the previous change to Fcopy_file.
15129 Recent glibc declares fchown with __attribute__((warn_unused_result)),
15130 and without this change, GCC might complain about discarding
15131 fchown's return value.
15132
15133 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
15134
15135 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
15136
15137 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
15138
15139 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
15140
15141 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
15142
15143 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
15144 it's used from the C level.
15145
15146 * process.c: Use the same condition for POLL_FOR_INPUT in both
15147 keyboard.c and process.c (bug#1858).
15148
15149 2011-07-09 Lawrence Mitchell <wence@gmx.li>
15150
15151 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
15152 (Fgnutls_boot): Use it.
15153
15154 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
15155
15156 * doc.c (Fsubstitute_command_keys): Revert last change.
15157
15158 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
15159
15160 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
15161 quotes the next character, and doesn't affect other longer
15162 sequences (bug#8935).
15163
15164 * lread.c (syms_of_lread): Clarify that is isn't only
15165 `eval-buffer' and `eval-defun' that's affected by
15166 `lexical-binding' (bug#8460).
15167
15168 2011-07-15 Eli Zaretskii <eliz@gnu.org>
15169
15170 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
15171 bidi redisplay when a line includes both an image and is truncated.
15172
15173 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
15174
15175 Fix minor problems found by static checking.
15176 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
15177 (elsz): Now a signed constant, not a size_t var. We prefer signed
15178 types to unsigned, to avoid integer comparison confusion. Without
15179 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
15180 "cannot optimize loop, the loop counter may overflow", a symptom
15181 of the confusion.
15182 * indent.c (Fvertical_motion): Mark locals as initialized.
15183 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
15184
15185 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15186
15187 * search.c (Fre_search_backward): Mention `case-fold-search' in
15188 all the re_search_* functions (bug#8138).
15189
15190 * keyboard.c (Fopen_dribble_file): Document when the file is
15191 closed (bug#8056).
15192
15193 2011-07-14 Eli Zaretskii <eliz@gnu.org>
15194
15195 * bidi.c (bidi_dump_cached_states): Fix format of displaying
15196 bidi_cache_idx.
15197
15198 Support bidi reordering of display and overlay strings.
15199 * xdisp.c (compute_display_string_pos)
15200 (compute_display_string_end): Accept additional argument STRING.
15201 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
15202 (reseat_to_string): Initialize bidi_it->string.s and
15203 bidi_it->string.schars.
15204 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
15205 NULL (avoids a crash in bidi_paragraph_init).
15206 Initialize itb.string.lstring.
15207 (init_iterator): Call bidi_init_it only of a valid
15208 buffer position was specified. Initialize paragraph_embedding to
15209 L2R.
15210 (reseat_to_string): Initialize the bidi iterator.
15211 (display_string): If we need to ignore text properties of
15212 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
15213 original value of -1 will not work with bidi.)
15214 (compute_display_string_pos): First arg is now struct
15215 `text_pos *'; all callers changed. Support display properties on
15216 Lisp strings.
15217 (compute_display_string_end): Support display properties on Lisp
15218 strings.
15219 (init_iterator, reseat_1, reseat_to_string): Initialize the
15220 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
15221 when iterating on a string not from display properties).
15222 (compute_display_string_pos, compute_display_string_end):
15223 Fix calculation of the object to scan. Fixes an error when using
15224 arrow keys.
15225 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
15226 base_level_stop; instead, set base_level_stop to BEGV.
15227 Fixes crashes in vertical-motion.
15228 (next_element_from_buffer): Improve commentary for when
15229 the iterator is before prev_stop.
15230 (init_iterator): Initialize bidi_p from the default value of
15231 bidi-display-reordering, not from buffer-local value. Use the
15232 buffer-local value only if initializing for buffer iteration.
15233 (handle_invisible_prop): Support invisible properties on strings
15234 that are being bidi-reordered.
15235 (set_iterator_to_next): Support bidi reordering of C strings and
15236 Lisp strings.
15237 (next_element_from_string): Support bidi reordering of Lisp
15238 strings.
15239 (handle_stop_backwards): Support Lisp strings as well.
15240 (display_string): Support display of R2L glyph rows.
15241 Use IT_STRING_CHARPOS when displaying from a Lisp string.
15242 (init_iterator): Don't initialize it->bidi_p for strings
15243 here.
15244 (reseat_to_string): Initialize it->bidi_p for strings here.
15245 (next_element_from_string, next_element_from_c_string)
15246 (next_element_from_buffer): Add xassert's for correspondence
15247 between IT's object being iterated and it->bidi_it.string
15248 structure.
15249 (face_before_or_after_it_pos): Support bidi iteration.
15250 (next_element_from_c_string): Handle the case of the first string
15251 character that is not the first one in the visual order.
15252 (get_visually_first_element): New function, refactored from common
15253 parts of next_element_from_buffer, next_element_from_string, and
15254 next_element_from_c_string.
15255 (tool_bar_lines_needed, redisplay_tool_bar)
15256 (display_menu_bar): Force left-to-right direction. Add a FIXME
15257 comment for making that be controlled by a user option.
15258 (push_it, pop_it): Save and restore the state of the
15259 bidi iterator. Save and restore the bidi_p flag.
15260 (pop_it): Iterate out of display property for string iteration as
15261 well.
15262 (iterate_out_of_display_property): Support iteration over strings.
15263 (handle_single_display_spec): Set up it->bidi_it for iteration
15264 over a display string, and call bidi_init_it.
15265 (handle_single_display_spec, next_overlay_string)
15266 (get_overlay_strings_1, push_display_prop): Set up the bidi
15267 iterator for displaying display or overlay strings.
15268 (forward_to_next_line_start): Don't use the shortcut if
15269 bidi-iterating.
15270 (back_to_previous_visible_line_start): If handle_display_prop
15271 pushed the iterator stack, restore the internal state of the bidi
15272 iterator by calling bidi_pop_it same number of times.
15273 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
15274 and we are bidi-iterating, don't decrement the iterator position;
15275 instead, set the first_elt flag in the bidi iterator, to produce
15276 the same effect.
15277 (reseat_1): Remove redundant setting of string_from_display_prop_p.
15278 (push_display_prop): xassert that we are iterating a buffer.
15279 (push_it, pop_it): Save and restore paragraph_embedding member.
15280 (handle_single_display_spec, next_overlay_string)
15281 (get_overlay_strings_1, reseat_1, reseat_to_string)
15282 (push_display_prop): Set up the `unibyte' member of bidi_it.string
15283 correctly. Don't assume unibyte strings are not bidi-reordered.
15284 (compute_display_string_pos)
15285 (compute_display_string_end): Fix handling the case of C string.
15286 (push_it, pop_it): Save and restore from_disp_prop_p.
15287 (handle_single_display_spec, push_display_prop): Set the
15288 from_disp_prop_p flag.
15289 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
15290 (pop_it): Call iterate_out_of_display_property only if we are
15291 popping after iteration over a string that came from a display
15292 property. Fix a typo in popping stretch info. Add an assertion
15293 for verifying that the iterator position is in sync with the bidi
15294 iterator.
15295 (handle_single_display_spec, get_overlay_strings_1)
15296 (push_display_prop): Fix initialization of paragraph direction for
15297 string when that of the parent object is not yet determined.
15298 (reseat_1): Call bidi_init_it to resync the bidi
15299 iterator with IT's position. (Bug#7616)
15300 (find_row_edges): If ROW->start.pos gives position
15301 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
15302 (handle_stop, back_to_previous_visible_line_start, reseat_1):
15303 Reset the from_disp_prop_p flag.
15304 (SAVE_IT, RESTORE_IT): New macros.
15305 (pos_visible_p, face_before_or_after_it_pos)
15306 (back_to_previous_visible_line_start)
15307 (move_it_in_display_line_to, move_it_in_display_line)
15308 (move_it_to, move_it_vertically_backward, move_it_by_lines)
15309 (try_scrolling, redisplay_window, display_line): Use them when
15310 saving a temporary copy of the iterator and restoring it back.
15311 (back_to_previous_visible_line_start, reseat_1)
15312 (init_iterator): Empty the bidi cache "stack".
15313 (move_it_in_display_line_to): If iterator ended up at
15314 EOL, but we never saw any buffer positions smaller than
15315 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
15316 motion in bidi-reordered lines.
15317 (move_it_in_display_line_to): Record prev_method and prev_pos
15318 immediately before the call to set_iterator_to_next. Fixes cursor
15319 motion in bidi-reordered lines with stretch glyphs and strings
15320 displayed in margins. (Bug#8133) (Bug#8867)
15321 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
15322 TO_CHARPOS.
15323 (pos_visible_p): Support positions in bidi-reordered lines.
15324 Save and restore bidi cache.
15325
15326 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
15327 (bidi_paragraph_info): Delete unused struct.
15328 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
15329 (bidi_cache_start): New variable.
15330 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
15331 to zero.
15332 (bidi_cache_fetch_state, bidi_cache_search)
15333 (bidi_cache_find_level_change, bidi_cache_iterator_state)
15334 (bidi_cache_find, bidi_peek_at_next_level)
15335 (bidi_level_of_next_char, bidi_find_other_level_edge)
15336 (bidi_move_to_visually_next): Compare cache index with
15337 bidi_cache_start rather than with zero.
15338 (bidi_fetch_char): Accept new argument STRING; all callers
15339 changed. Support iteration over a string. Support strings with
15340 display properties. Support unibyte strings. Fix the type of
15341 `len' according to what STRING_CHAR_AND_LENGTH expects.
15342 (bidi_paragraph_init, bidi_resolve_explicit_1)
15343 (bidi_resolve_explicit, bidi_resolve_weak)
15344 (bidi_level_of_next_char, bidi_move_to_visually_next):
15345 Support iteration over a string.
15346 (bidi_set_sor_type, bidi_resolve_explicit_1)
15347 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
15348 can now be zero (for strings); special values 0 and -1 were
15349 changed to -1 and -2, respectively.
15350 (bidi_char_at_pos): New function.
15351 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
15352 Call it instead of FETCH_MULTIBYTE_CHAR.
15353 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
15354 initialized to valid values.
15355 (bidi_init_it): Don't initialize charpos and bytepos with invalid
15356 values.
15357 (bidi_level_of_next_char): Allow the sentinel "position" to pass
15358 the test for valid cached positions. Fix the logic for looking up
15359 the sentinel state in the cache. GCPRO the Lisp string we are
15360 iterating.
15361 (bidi_push_it, bidi_pop_it): New functions.
15362 (bidi_initialize): Initialize the bidi cache start stack pointer.
15363 (bidi_cache_ensure_space): New function, refactored from part of
15364 bidi_cache_iterator_state. Don't assume the required size is just
15365 one BIDI_CACHE_CHUNK away.
15366 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
15367 (bidi_count_bytes, bidi_char_at_pos): New functions.
15368 (bidi_cache_search): Don't assume bidi_cache_last_idx is
15369 always valid if bidi_cache_idx is valid.
15370 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
15371 is valid if it's going to be used.
15372 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
15373 (bidi_cache_fetch_state, bidi_cache_search)
15374 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15375 (bidi_cache_iterator_state, bidi_cache_find)
15376 (bidi_find_other_level_edge, bidi_cache_start_stack):
15377 All variables related to cache indices are now EMACS_INT.
15378
15379 * dispextern.h (struct bidi_string_data): New structure.
15380 (struct bidi_it): New member `string'. Make flag members be 1-bit
15381 fields, and put them last in the struct.
15382 (compute_display_string_pos, compute_display_string_end):
15383 Update prototypes.
15384 (bidi_push_it, bidi_pop_it): Add prototypes.
15385 (struct iterator_stack_entry): New members bidi_p,
15386 paragraph_embedding, and from_disp_prop_p.
15387 (struct it): Member bidi_p is now a bit field 1 bit wide.
15388 (bidi_shelve_cache, bidi_unshelve_cache):
15389 Declare prototypes.
15390
15391 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15392 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15393 and vector-like objects.
15394
15395 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15396 cache around display iteration.
15397
15398 * window.c (Fwindow_end, window_scroll_pixel_based)
15399 (displayed_window_lines, Frecenter): Save and restore the bidi
15400 cache around display iteration.
15401
15402 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15403
15404 * editfns.c (Fdelete_region): Clarify the use of the named
15405 parameters (bug#6788).
15406
15407 2011-07-14 Martin Rudalics <rudalics@gmx.at>
15408
15409 * indent.c (Fvertical_motion): Set and restore w->pointm when
15410 saving and restoring the window's buffer (Bug#9006).
15411
15412 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15413
15414 * editfns.c (Fstring_to_char): Clarify just what is returned
15415 (bug#6576). Text by Eli Zaretskii.
15416
15417 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
15418
15419 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15420
15421 2011-07-13 Eli Zaretskii <eliz@gnu.org>
15422
15423 * buffer.c (mmap_find): Fix a typo.
15424
15425 2011-07-13 Johan Bockgård <bojohan@gnu.org>
15426
15427 Fix execution of x selection hooks.
15428 * xselect.c (Qx_lost_selection_functions)
15429 (Qx_sent_selection_functions): New vars.
15430 (syms_of_xselect): DEFSYM them.
15431 (x_handle_selection_request): Pass Qx_sent_selection_functions
15432 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15433 (x_handle_selection_clear,x_clear_frame_selections):
15434 Pass Qx_lost_selection_functions rather than
15435 Vx_lost_selection_functions to Frun_hook_with_args.
15436
15437 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15438
15439 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
15440 The old code sometimes used this field without initializing it.
15441
15442 * alloc.c (gc_sweep): Don't read past end of array.
15443 In theory, the old code could also have corrupted Emacs internals,
15444 though it'd be very unlikely.
15445
15446 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15447
15448 * character.c (Fcharacterp): Don't advertise optional ignored
15449 argument. (Bug#4026)
15450
15451 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15452
15453 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15454 key" (bug#4257).
15455
15456 * window.c (Fset_window_start): Doc fix (bug#4199).
15457 (Fset_window_hscroll): Ditto.
15458
15459 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15460
15461 Fix minor new problems caught by GCC 4.6.1.
15462 * term.c (init_tty): Remove unused local.
15463 * xsettings.c (store_monospaced_changed): Define this function only
15464 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
15465 not used otherwise.
15466
15467 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
15468
15469 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15470
15471 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15472
15473 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15474 are the mini-buffer and the echo area (bug#3320).
15475
15476 * term.c (init_tty): Remove support for supdup, c10 and perq
15477 terminals, which are no longer supported (bug#1482).
15478
15479 2011-07-10 Johan Bockgård <bojohan@gnu.org>
15480
15481 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15482
15483 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15484
15485 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15486 for non-popups (Bug#3642).
15487
15488 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15489
15490 * alloc.c (reset_malloc_hooks): Protoize.
15491 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
15492 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15493 * cm.c (losecursor): Likewise.
15494 * data.c (fmod): Likewise.
15495 * dispnew.c (swap_glyphs_in_rows): Likewise.
15496 * emacs.c (memory_warning_signal): Likewise.
15497 * floatfns.c (float_error): Likewise.
15498 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15499 (otf_open, font_otf_capability, generate_otf_features)
15500 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15501 Likewise.
15502 * image.c (pbm_read_file): Likewise.
15503 * indent.c (string_display_width): Likewise.
15504 * intervals.c (check_for_interval, search_for_interval)
15505 (inc_interval_count, count_intervals, root_interval)
15506 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15507 * lread.c (defalias): Likewise.
15508 * ralloc.c (r_alloc_check): Likewise.
15509 * regex.c (set_image_of_range_1, set_image_of_range)
15510 (regex_grow_registers): Likewise.
15511 * sysdep.c (strerror): Likewise.
15512 * termcap.c (valid_filename_p, tprint, main): Likewise.
15513 * tparam.c (main): Likewise.
15514 * unexhp9k800.c (run_time_remap, save_data_space)
15515 (update_file_ptrs, read_header, write_header, calculate_checksum)
15516 (copy_file, copy_rest, display_header): Likewise.
15517 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15518 Likewise.
15519 * xdisp.c (check_it): Likewise.
15520 * xfaces.c (register_color, unregister_color, unregister_colors):
15521 Likewise.
15522 * xfns.c (print_fontset_result): Likewise.
15523 * xrdb.c (member, fatal, main): Likewise.
15524
15525 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15526
15527 Fix minor problems found by static checking (Bug#9031).
15528 * chartab.c (char_table_set_range, map_sub_char_table):
15529 Remove unused locals.
15530 (uniprop_table): Now static.
15531 * composite.c (_work_char): Remove unused static var.
15532
15533 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
15534
15535 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15536
15537 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15538
15539 * gtkutil.c (qttip_cb): Remove code without function.
15540
15541 2011-07-09 Eli Zaretskii <eliz@gnu.org>
15542
15543 * w32.c (pthread_sigmask): New stub.
15544
15545 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
15546
15547 Use pthread_sigmask, not sigprocmask (Bug#9010).
15548 sigprocmask is portable only for single-threaded applications, and
15549 Emacs can be multi-threaded when it uses GTK.
15550 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15551 (LIBES): Use it.
15552 * callproc.c (Fcall_process):
15553 * process.c (create_process):
15554 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15555 Use pthread_sigmask, not sigprocmask.
15556
15557 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15558
15559 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15560 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15561 wrong (Bug#8591).
15562
15563 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15564
15565 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15566 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15567 (xg_hide_tooltip): Fix comment.
15568
15569 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15570 in registerServicesMenuSendTypes.
15571 (validRequestorForSendType): Don't check ns_return_types.
15572
15573 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15574 ns_return_type.
15575
15576 2011-07-08 Jason Rumney <jasonr@gnu.org>
15577
15578 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15579 SH_SHOW for hidden windows (Bug#5482).
15580
15581 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15582 frame struct members of non-existent frames (Bug#6284).
15583
15584 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15585
15586 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15587 variable firstTime not needed on OSX >= 10.6.
15588 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15589 >= 10.5. Use setKnobProportion, setDoubleValue.
15590
15591 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15592 (MAC_OS_X_VERSION_10_5): Define if not defined.
15593 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15594 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15595 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15596
15597 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
15598 cString and lossyCString on OSX >= 10.4.
15599
15600 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
15601 sizeToFit on OSX >= 10.2.
15602
15603 * nsimage.m (allocInitFromFile): Don't use deprecated method
15604 bestRepresentationForDevice on OSX >= 10.6.
15605
15606 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15607 to avoid warning.
15608
15609 * emacs.c: Declare unexec_init_emacs_zone.
15610
15611 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15612
15613 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15614
15615 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15616 on svcsMenu (Bug#8842).
15617
15618 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15619 ns_return_types.
15620 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15621
15622 * nsterm.m (QUTF8_STRING): Declare.
15623 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15624 (validRequestorForSendType): Return type is (id).
15625 Change indexOfObjectIdenticalTo to indexOfObject.
15626 Check if we have local selection before returning self (Bug#8842).
15627 (writeSelectionToPasteboard): Put local selection into paste board
15628 if we have a local selection (Bug#8842).
15629 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15630
15631 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15632 (ns_get_local_selection): Declare.
15633
15634 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15635
15636 * keymap.c (describe_map_tree): Don't insert a double newline at
15637 the end of the buffer (bug#1169) and return whether we inserted
15638 something.
15639
15640 * callint.c (Fcall_interactively): Change "reading args" to
15641 "providing args" to try to clarify what it does (bug#1010).
15642
15643 2011-07-07 Kenichi Handa <handa@m17n.org>
15644
15645 * composite.c (composition_compute_stop_pos): Ignore a static
15646 composition starting before CHARPOS (Bug#8915).
15647
15648 * xdisp.c (handle_composition_prop): Likewise.
15649
15650 2011-07-07 Eli Zaretskii <eliz@gnu.org>
15651
15652 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15653 (Bug#9015)
15654
15655 2011-07-07 Kenichi Handa <handa@m17n.org>
15656
15657 * character.h (unicode_category_t): New enum type.
15658
15659 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15660 (Qchar_code_property_table): New variable.
15661 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15662 (UNIPROP_COMPRESSED_FORM_P): New macros.
15663 (char_table_ascii): Uncompress the compressed values.
15664 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15665 Uncompress the compressed values.
15666 (sub_char_table_ref_and_range): Likewise.
15667 (char_table_ref_and_range): Uncompress the compressed values.
15668 (sub_char_table_set): New arg is_uniprop. Callers changed.
15669 Uncompress the compressed values.
15670 (sub_char_table_set_range): Args changed. Callers changed.
15671 (char_table_set_range): Adjuted for the above change.
15672 (map_sub_char_table): Delete args default_val and parent. Add arg
15673 top. Give decoded values to a Lisp function.
15674 (map_char_table): Adjust for the above change. Give decoded
15675 values to a Lisp function. Gcpro more variables.
15676 (uniprop_table_uncompress)
15677 (uniprop_decode_value_run_length): New functions.
15678 (uniprop_decoder, uniprop_decoder_count): New variables.
15679 (uniprop_get_decoder, uniprop_encode_value_character)
15680 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15681 New functions.
15682 (uniprop_encoder, uniprop_encoder_count): New variables.
15683 (uniprop_get_encoder, uniprop_table)
15684 (Funicode_property_table_internal, Fget_unicode_property_internal)
15685 (Fput_unicode_property_internal): New functions.
15686 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15687 Sunicode_property_table_internal, Sget_unicode_property_internal,
15688 and Sput_unicode_property_internal. Defvar_lisp
15689 char-code-property-alist.
15690
15691 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15692 Vunicode_category_table.
15693
15694 * font.c (font_range): Adjust for the change of
15695 Vunicode_category_table.
15696
15697 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15698
15699 * m/iris4d.h: Remove file, move contents ...
15700 * s/irix6-5.h: ... here.
15701
15702 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15703
15704 Remove unportable assumption about struct layout (Bug#8884).
15705 * alloc.c (mark_buffer):
15706 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15707 (clone_per_buffer_values): Don't assume that
15708 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15709 This isn't true in general, and it's particularly not true
15710 if Emacs is configured with --with-wide-int.
15711 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15712 New macros, used in the buffer.c change.
15713
15714 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15715
15716 * xsettings.c: Use both GConf and GSettings if both are available.
15717 (store_config_changed_event): Add comment.
15718 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15719 (store_tool_bar_style_changed): New functions.
15720 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
15721 (struct xsettings): Move font inside HAVE_XFT.
15722 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15723 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15724 Move inside HAVE_XFT.
15725 (something_changed_gsettingsCB): Rename from something_changedCB.
15726 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15727 also.
15728 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15729 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
15730 (something_changed_gconfCB): Rename from something_changedCB.
15731 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15732 (parse_settings): Move check for font inside HAVE_XFT.
15733 (read_settings, apply_xft_settings): Add comment.
15734 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15735 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15736 call store_font_name_changed.
15737 (xft_settings_event): Add comment.
15738 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15739 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15740 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15741 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15742 (xsettings_initialize): Call init_gsettings last.
15743 (xsettings_get_system_font, xsettings_get_system_normal_font):
15744 Add comment.
15745
15746 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15747
15748 Random fixes. E.g., (random) never returned negative values.
15749 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15750 subseconds part to the entropy, as that's a bit more random.
15751 Prefer signed to unsigned, since the signedness doesn't matter and
15752 in general we prefer signed. When given a limit, use a
15753 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15754 latter isn't right if USE_2_TAGS_FOR_INTS.
15755 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15756 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15757
15758 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15759
15760 * textprop.c (text_property_stickiness):
15761 Obey Vtext_property_default_nonsticky.
15762 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15763 * w32fns.c (syms_of_w32fns):
15764 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15765
15766 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15767
15768 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15769 This is more efficient than Ffile_directory_p and avoids a minor race.
15770
15771 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15772
15773 * buffer.c (Foverlay_put): Say what the return value is
15774 (bug#7835).
15775
15776 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15777 is a directory before asking whether to use the file name
15778 (bug#7564).
15779 (barf_or_query_if_file_exists): Make the "File is a directory"
15780 error be more correct.
15781
15782 * fns.c (Frequire): Remove the mention of the .gz files, since
15783 that's installation-specific, but keep the mention of
15784 `get-load-suffixes'.
15785
15786 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15787
15788 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15789 Report string overflow if the output is too long.
15790
15791 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15792
15793 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15794 (syms_of_gnutls): Remove duplicate DEFSYM for
15795 Qgnutls_bootprop_verify_hostname_error, an error for
15796 Qgnutls_bootprop_verify_error (which is no longer used).
15797
15798 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15799 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15800 Also (re)move comments that are misplaced or no longer relevant.
15801
15802 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15803
15804 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15805
15806 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15807
15808 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15809 and background color parameters if they have been changed.
15810
15811 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15812
15813 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15814
15815 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15816
15817 * xsettings.c (SYSTEM_FONT): Define only when used.
15818 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15819
15820 * keymap.c (access_keymap_1): Now static.
15821
15822 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15823
15824 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15825 leave any prefix arg for the up event (Bug#1586).
15826
15827 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15828
15829 * lread.c (syms_of_lread): Mention single symbols defined by
15830 `defvar' or `defconst' (bug#7154).
15831
15832 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15833 (Frequire): Mention get-load-suffixes.
15834
15835 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15836
15837 * window.h (window): Remove clone_number slot.
15838 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15839 Remove.
15840 (make_parent_window, make_window, saved_window)
15841 (Fset_window_configuration, save_window_save): Don't deal with
15842 clone numbers.
15843 * buffer.c (Qclone_number): Remove declaration.
15844 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15845
15846 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15847
15848 Add multiple inheritance to keymaps.
15849 * keymap.c (Fmake_composed_keymap): New function.
15850 (Fset_keymap_parent): Simplify.
15851 (fix_submap_inheritance): Remove.
15852 (access_keymap_1): New function extracted from access_keymap to handle
15853 embedded parents and handle lists of maps.
15854 (access_keymap): Use it.
15855 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15856 (Fcopy_keymap): Handle embedded parents.
15857 (Fcommand_remapping, define_as_prefix): Simplify.
15858 (Fkey_binding): Simplify.
15859 (syms_of_keymap): Move minibuffer-local-completion-map,
15860 minibuffer-local-filename-completion-map,
15861 minibuffer-local-must-match-map, and
15862 minibuffer-local-filename-must-match-map to Elisp.
15863 (syms_of_keymap): Defsubr make-composed-keymap.
15864 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15865 (parse_menu_item): Trivial simplification.
15866
15867 2011-07-01 Glenn Morris <rgm@gnu.org>
15868
15869 * Makefile.in (SETTINGS_LIBS): Fix typo.
15870
15871 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15872
15873 * coding.c (Fencode_coding_string): Record the last coding system
15874 used, as the function doc string says (bug#8738).
15875
15876 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15877
15878 * xsettings.c (store_monospaced_changed): Take new font as arg and
15879 check for change against current_mono_font.
15880 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15881 (emacs_settings_constructor, emacs_settings_get_property)
15882 (emacs_settings_set_property, emacs_settings_class_init)
15883 (emacs_settings_init, gsettings_obj): Remove.
15884 (something_changedCB): New function for HAVE_GSETTINGS.
15885 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15886 with value as argument.
15887 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15888 g_settings_new (Bug#8967). Do not create gsettings_obj.
15889 Remove calls to g_settings_bind. Connect something_changedCB to
15890 "changed".
15891
15892 * xgselect.c: Add defined (HAVE_GSETTINGS).
15893 (xgselect_initialize): Ditto.
15894
15895 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15896 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15897 xg_select.
15898
15899 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15900
15901 * eval.c (struct backtrace): Simplify and port the data structure.
15902 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15903 signed bit field, as this assumption is not portable and it makes
15904 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15905 "char debug_on_exit : 1" as this is not portable either; instead,
15906 use the portable "unsigned int debug_on_exit : 1". Remove unused
15907 member evalargs. Remove obsolete comments about cc bombing out.
15908
15909 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15910
15911 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15912 Let HAVE_GSETTINGS override HAVE_GCONF.
15913 (store_monospaced_changed): New function.
15914 (EMACS_SETTINGS): A new type derived from GObject to handle
15915 GSettings notifications.
15916 (emacs_settings_constructor, emacs_settings_get_property)
15917 (emacs_settings_set_property, emacs_settings_class_init):
15918 New functions.
15919 (gsettings_client, gsettings_obj): New variables.
15920 (GSETTINGS_SCHEMA): New define.
15921 (something_changedCB): Call store_monospaced_changed.
15922 (init_gsettings): New function.
15923 (xsettings_initialize): Call init_gsettings.
15924 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15925 to NULL.
15926
15927 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15928 GCONF_CFLAGS/LIBS.
15929
15930 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15931
15932 * window.c (resize_root_window, grow_mini_window)
15933 (shrink_mini_window): Rename Qresize_root_window to
15934 Qwindow_resize_root_window and Qresize_root_window_vertically to
15935 Qwindow_resize_root_window_vertically.
15936
15937 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15938
15939 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15940
15941 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15942
15943 * makefile.w32-in: Redesign dependencies so they reflect more
15944 clearly which files are directly included by each source file,
15945 and not through other includes.
15946
15947 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15948
15949 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15950 (sort_overlays, overlay_strings): When an overlay's clone number
15951 matches the window's clone number process the overlay even if
15952 the overlay's window property doesn't match the current window.
15953
15954 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15955 (Fwindow_hchild): Rename to Fwindow_left_child.
15956 (Fwindow_next): Rename to Fwindow_next_sibling.
15957 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15958 (resize_window_check): Rename to window_resize_check.
15959 (resize_window_apply): Rename to window_resize_apply.
15960 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15961 (Fdelete_other_windows_internal, resize_frame_windows)
15962 (Fsplit_window_internal, Fdelete_window_internal)
15963 (grow_mini_window, shrink_mini_window)
15964 (Fresize_mini_window_internal): Fix callers accordingly.
15965
15966 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15967
15968 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15969 (emacs_fixed_set_min_size): Remove.
15970 (emacs_fixed_new): Take frame as argument.
15971
15972 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15973 (_EmacsFixedPrivate): Remove minwidth/height.
15974 Add struct frame *f.
15975 (emacs_fixed_init): Initialize priv->f.
15976 (get_parent_class, emacs_fixed_set_min_size): Remove.
15977 (emacs_fixed_new): Set priv->f to argument.
15978 (emacs_fixed_get_preferred_width)
15979 (emacs_fixed_get_preferred_height): Use min_width/height from
15980 frames size_hint to set minimum and natural (Bug#8919).
15981 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15982 and use min_width/height from frames size_hint to set
15983 min_width/height (Bug#8919).
15984
15985 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15986 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15987 Fix indentation.
15988
15989 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15990
15991 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15992 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15993 called at ZV.
15994
15995 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15996
15997 * process.c (wait_reading_process_output): Bypass select if
15998 waiting for a cell while ignoring keyboard input, and input is
15999 pending. Suggested by Jan Djärv (Bug#8869).
16000
16001 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
16002
16003 Use gnulib's dup2 module instead of rolling our own.
16004 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
16005
16006 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16007
16008 * dispnew.c (scrolling_window): Before scrolling, turn off a
16009 mouse-highlight in the window being scrolled.
16010
16011 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
16012
16013 Move DEFSYM to lisp.h and use everywhere.
16014
16015 * character.h (DEFSYM): Move declaration...
16016 * lisp.h (DEFSYM): ...here.
16017
16018 * gnutls.c:
16019 * minibuf.c:
16020 * w32menu.c:
16021 * w32proc.c:
16022 * w32select.c: Don't include character.h.
16023
16024 * alloc.c (syms_of_alloc):
16025 * buffer.c (syms_of_buffer):
16026 * bytecode.c (syms_of_bytecode):
16027 * callint.c (syms_of_callint):
16028 * casefiddle.c (syms_of_casefiddle):
16029 * casetab.c (init_casetab_once):
16030 * category.c (init_category_once, syms_of_category):
16031 * ccl.c (syms_of_ccl):
16032 * cmds.c (syms_of_cmds):
16033 * composite.c (syms_of_composite):
16034 * dbusbind.c (syms_of_dbusbind):
16035 * dired.c (syms_of_dired):
16036 * dispnew.c (syms_of_display):
16037 * doc.c (syms_of_doc):
16038 * editfns.c (syms_of_editfns):
16039 * emacs.c (syms_of_emacs):
16040 * eval.c (syms_of_eval):
16041 * fileio.c (syms_of_fileio):
16042 * fns.c (syms_of_fns):
16043 * frame.c (syms_of_frame):
16044 * fringe.c (syms_of_fringe):
16045 * insdel.c (syms_of_insdel):
16046 * keymap.c (syms_of_keymap):
16047 * lread.c (init_obarray, syms_of_lread):
16048 * macros.c (syms_of_macros):
16049 * msdos.c (syms_of_msdos):
16050 * print.c (syms_of_print):
16051 * process.c (syms_of_process):
16052 * search.c (syms_of_search):
16053 * sound.c (syms_of_sound):
16054 * syntax.c (init_syntax_once, syms_of_syntax):
16055 * terminal.c (syms_of_terminal):
16056 * textprop.c (syms_of_textprop):
16057 * undo.c (syms_of_undo):
16058 * w32.c (globals_of_w32):
16059 * window.c (syms_of_window):
16060 * xdisp.c (syms_of_xdisp):
16061 * xfaces.c (syms_of_xfaces):
16062 * xfns.c (syms_of_xfns):
16063 * xmenu.c (syms_of_xmenu):
16064 * xsettings.c (syms_of_xsettings):
16065 * xterm.c (syms_of_xterm): Use DEFSYM.
16066
16067 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
16068
16069 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
16070
16071 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
16072
16073 Integer and buffer overflow fixes (Bug#8873).
16074
16075 * print.c (printchar, strout): Check for string overflow.
16076 (PRINTPREPARE, printchar, strout):
16077 Don't set size unless allocation succeeds.
16078
16079 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
16080 for sizes. Check for string overflow more accurately.
16081 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
16082
16083 * macros.c: Integer and buffer overflow fixes.
16084 * keyboard.h (struct keyboard.kbd_macro_bufsize):
16085 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
16086 Use ptrdiff_t, not int, for sizes.
16087 Don't increment bufsize until after realloc succeeds.
16088 Check for size-calculation overflow.
16089 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
16090
16091 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
16092
16093 * lread.c: Integer overflow fixes.
16094 (read_integer): Radix is now EMACS_INT, not int,
16095 to improve quality of diagnostics for out-of-range radices.
16096 Calculate buffer size correctly for out-of-range radices.
16097 (read1): Check for integer overflow in radices, and in
16098 read-circle numbers.
16099 (read_escape): Avoid int overflow.
16100 (Fload, openp, read_buffer_size, read1)
16101 (substitute_object_recurse, read_vector, read_list, map_obarray):
16102 Use ptrdiff_t, not int, for sizes.
16103 (read1): Use EMACS_INT, not int, for sizes.
16104 Check for size overflow.
16105
16106 * image.c (cache_image): Check for size arithmetic overflow.
16107
16108 * lread.c: Integer overflow issues.
16109 (saved_doc_string_size, saved_doc_string_length)
16110 (prev_saved_doc_string_size, prev_saved_doc_string_length):
16111 Now ptrdiff_t, not int.
16112 (read1): Don't assume doc string length fits in int. Check for
16113 out-of-range doc string lengths.
16114 (read_list): Don't assume file position fits in int.
16115 (read_escape): Check for hex character overflow.
16116
16117 2011-06-22 Leo Liu <sdl.web@gmail.com>
16118
16119 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
16120 Move to minibuffer.el.
16121
16122 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16123
16124 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
16125 The following patches are for when GLYPH_DEBUG && !XASSERT.
16126 * dispextern.h (trace_redisplay_p, dump_glyph_string):
16127 * dispnew.c (flush_stdout):
16128 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
16129 Mark as externally visible.
16130 * dispnew.c (check_window_matrix_pointers): Now static.
16131 * dispnew.c (window_to_frame_vpos):
16132 * xfns.c (unwind_create_frame):
16133 * xterm.c (x_check_font): Remove unused local.
16134 * scroll.c (CHECK_BOUNDS):
16135 * xfaces.c (cache_fache): Rename local to avoid shadowing.
16136 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
16137 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
16138 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
16139 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
16140 Now static.
16141 (debug_method_add): Use va_list and vsprintf rather than relying
16142 on undefined behavior with wrong number of arguments.
16143 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
16144 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
16145 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
16146 since we're not interested in debugging glyphs with old libraries.
16147 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
16148 GCC 4.6.0's static checking.
16149
16150 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16151
16152 Integer overflow and signedness fixes (Bug#8873).
16153 A few related buffer overrun fixes, too.
16154
16155 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
16156
16157 * dispextern.h (struct face.stipple):
16158 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
16159 (x_bitmap_mask, x_allocate_bitmap_record)
16160 (x_create_bitmap_from_data, x_create_bitmap_from_file)
16161 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
16162 (x_create_bitmap_from_xpm_data):
16163 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
16164 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
16165 (.bitmaps_last):
16166 * xfaces.c (load_pixmap):
16167 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
16168 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
16169 (.bitmaps_last, struct x_output.icon_bitmap):
16170 Use ptrdiff_t, not int, for bitmap indexes.
16171 (x_allocate_bitmap_record): Check for size overflow.
16172 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
16173
16174 Use ptrdiff_t, not int, for overlay counts.
16175 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
16176 * editfns.c (overlays_around, get_pos_property):
16177 * textprop.c (get_char_property_and_overlay):
16178 * xdisp.c (next_overlay_change, note_mouse_highlight):
16179 * xfaces.c (face_at_buffer_position):
16180 * buffer.c (OVERLAY_COUNT_MAX): New macro.
16181 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
16182 (Fnext_overlay_change, Fprevious_overlay_change)
16183 (mouse_face_overlay_overlaps, Foverlays_in):
16184 Use ptrdiff_t, not int, for sizes.
16185 (overlays_at, overlays_in): Check for size-calculation overflow.
16186
16187 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
16188
16189 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
16190 (x_session_initialize): Do not assume string length fits in int.
16191
16192 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
16193 This is unlikely, but can occur if DPI is outlandish.
16194
16195 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
16196 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
16197
16198 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
16199 * xrdb.c (magic_file_p, search_magic_path):
16200 Omit last arg SUFFIX; it was always 0. All callers changed.
16201 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
16202
16203 * xfont.c (xfont_match): Avoid need for strlen.
16204
16205 * xfns.c: Don't assume strlen fits in int.
16206 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
16207
16208 * xdisp.c (message_log_check_duplicate): Return intmax_t,
16209 not unsigned long, as we prefer signed integers. All callers changed.
16210 Detect integer overflow in repeat count.
16211 (message_dolog): Don't assume print length fits in 39 bytes.
16212 (display_mode_element): Don't assume strlen fits in int.
16213
16214 * termcap.c: Don't assume sizes fit in int and never overflow.
16215 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
16216 (gobble_line): Check for size-calculation overflow.
16217
16218 * minibuf.c (Fread_buffer):
16219 * lread.c (intern, intern_c_string):
16220 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
16221 Don't assume string length fits in int.
16222
16223 * keyboard.c (parse_tool_bar_item):
16224 * gtkutil.c (style_changed_cb): Avoid need for strlen.
16225
16226 * font.c: Don't assume string length fits in int.
16227 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
16228 Use ptrdiff_t, not int.
16229 (font_intern_prop): Don't assume string length fits in int.
16230 Don't assume integer property fits in fixnum.
16231 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
16232
16233 * filelock.c: Fix some buffer overrun and integer overflow issues.
16234 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
16235 Reformulate so as not to need the command string.
16236 Invoke gzip -cd rather than gunzip, as it's more portable.
16237 (lock_info_type, lock_file_1, lock_file):
16238 Don't assume pid_t and time_t fit in unsigned long.
16239 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
16240 (current_lock_owner): Prefer signed type for sizes.
16241 Use memcpy, not strncpy, where memcpy is what is really wanted.
16242 Don't assume (via atoi) that time_t and pid_t fit in int.
16243 Check for time_t and/or pid_t out of range, e.g., via a network share.
16244 Don't alloca where an auto var works fine.
16245
16246 * fileio.c: Fix some integer overflow issues.
16247 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
16248 Don't assume string length fits in int.
16249 (directory_file_name): Don't assume string length fits in long.
16250 (make_temp_name): Don't assume pid fits in int, or that its print
16251 length is less than 20.
16252
16253 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
16254
16255 * coding.c (make_subsidiaries): Don't assume string length fits in int.
16256
16257 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
16258
16259 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
16260 We prefer signed integers, even for size calculations.
16261
16262 * emacs.c: Don't assume string length fits in 'int'.
16263 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
16264 (main): Don't invoke strlen when not needed.
16265
16266 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
16267 (XD_DEBUG_MESSAGE): Don't waste a byte.
16268
16269 * callproc.c (getenv_internal_1, getenv_internal)
16270 (Fgetenv_internal):
16271 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
16272
16273 * lread.c (invalid_syntax): Omit length argument.
16274 All uses changed. This doesn't fix a bug, but it simplifies the
16275 code away from its former Hollerith-constant appearance, and it's
16276 one less 'int' to worry about when looking at integer-overflow issues.
16277 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
16278
16279 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
16280 This didn't break anything, but it didn't help either.
16281 It's confusing to put a bogus integer in a place where the actual
16282 value does not matter.
16283 (LIST_END_P): Remove unused macro and its bogus comment.
16284 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
16285
16286 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
16287 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
16288 implementation.
16289 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
16290 We prefer signed types, and the value cannot exceed the EMACS_INT
16291 range anyway (because otherwise the length would not be representable).
16292 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
16293 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
16294 This avoids a GCC warning when WIDE_EMACS_INT.
16295
16296 * indent.c (sane_tab_width): New function.
16297 (current_column, scan_for_column, Findent_to, position_indentation)
16298 (compute_motion): Use it. This is just for clarity.
16299 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
16300
16301 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
16302
16303 * lisp.h (lint_assume): New macro.
16304 * composite.c (composition_gstring_put_cache):
16305 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
16306
16307 * editfns.c, insdel.c:
16308 Omit unnecessary forward decls, to simplify future changes.
16309
16310 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
16311
16312 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
16313
16314 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
16315 Use much-faster test for byte-length change.
16316 Don't assume string byte-length fits in 'int'.
16317 Check that character arg fits in 'int'.
16318 (mapcar1): Declare byte as byte, for clarity.
16319
16320 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
16321
16322 * fns.c (concat): Catch string overflow earlier.
16323 Do not rely on integer wraparound.
16324
16325 * dispextern.h (struct it.overlay_strings_charpos)
16326 (struct it.selective): Now EMACS_INT, not int.
16327 * xdisp.c (forward_to_next_line_start)
16328 (back_to_previous_visible_line_start)
16329 (reseat_at_next_visible_line_start, next_element_from_buffer):
16330 Don't arbitrarily truncate the value of 'selective' to int.
16331
16332 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
16333
16334 * composite.c: Don't truncate sizes to 'int'.
16335 (composition_gstring_p, composition_reseat_it)
16336 (composition_adjust_point): Use EMACS_INT, not int.
16337 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
16338 not EMACS_UINT, for indexes.
16339
16340 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
16341
16342 * buffer.c: Include <verify.h>.
16343 (struct sortvec.priority, struct sortstr.priority):
16344 Now EMACS_INT, not int.
16345 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
16346 (struct sortstr.size, record_overlay_string)
16347 (struct sortstrlist.size, struct sortlist.used):
16348 Don't truncate size to int.
16349 (record_overlay_string): Check for size-calculation overflow.
16350 (init_buffer_once): Check at compile-time, not run-time.
16351
16352 2011-06-22 Jim Meyering <meyering@redhat.com>
16353
16354 Don't leak an XBM-image-sized buffer
16355 * image.c (xbm_load): Free the image buffer after using it.
16356
16357 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
16358
16359 Port to Sun C.
16360 * composite.c (find_automatic_composition): Omit needless 'return 0;'
16361 that Sun C diagnosed.
16362 * fns.c (secure_hash): Fix pointer signedness issue.
16363 * intervals.c (static_offset_intervals): New function.
16364 (offset_intervals): Use it.
16365
16366 2011-06-21 Leo Liu <sdl.web@gmail.com>
16367
16368 * deps.mk (fns.o):
16369 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
16370 sha512.h.
16371
16372 * fns.c (secure_hash): Rename from crypto_hash_function and change
16373 the first arg to accept symbols.
16374 (Fsecure_hash): New primitive.
16375 (syms_of_fns): New symbols.
16376
16377 2011-06-20 Deniz Dogan <deniz@dogan.se>
16378
16379 * process.c (Fset_process_buffer): Clarify return value in
16380 docstring.
16381
16382 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
16383
16384 * dispnew.c (add_window_display_history): Use BVAR.
16385
16386 * xdisp.c (debug_method_add): Use BVAR.
16387 (check_window_end, dump_glyph_matrix, dump_glyph)
16388 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16389
16390 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16391 Likewise.
16392
16393 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16394 check till after the cache is created in init_frame_faces.
16395
16396 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16397
16398 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16399
16400 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16401
16402 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16403 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16404 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16405
16406 Improve buffer-overflow checking (Bug#8873).
16407 * fileio.c (Finsert_file_contents):
16408 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16409 Remove the old (too-loose) buffer overflow checks.
16410 They weren't needed, since make_gap checks for buffer overflow.
16411 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16412 The old code merely checked for Emacs fixnum overflow, and relied
16413 on undefined (wraparound) behavior. The new code avoids undefined
16414 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16415
16416 * editfns.c (Finsert_char): Don't dump core with very negative counts.
16417 Tune. Don't use wider integers than needed. Don't use alloca.
16418 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
16419
16420 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16421
16422 * insdel.c, lisp.h (buffer_overflow): New function.
16423 (insert_from_buffer_1, replace_range, replace_range_2):
16424 * insdel.c (make_gap_larger):
16425 * editfns.c (Finsert_char):
16426 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16427
16428 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16429
16430 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16431
16432 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
16433
16434 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16435 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16436
16437 * fileio.c: Don't assume EMACS_INT fits in off_t.
16438 (emacs_lseek): New static function.
16439 (Finsert_file_contents, Fwrite_region): Use it.
16440 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16441
16442 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16443
16444 * fns.c: Don't overflow int when computing a list length.
16445 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16446 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16447 truncation on 64-bit hosts. Check for QUIT every
16448 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16449 faster and is responsive enough.
16450 (Flength): Report an error instead of overflowing an integer.
16451 (Fsafe_length): Return a float if the value is not representable
16452 as a fixnum. This shouldn't happen except in contrived situations.
16453 (Fnthcdr, Fsort): Don't assume list length fits in int.
16454 (Fcopy_sequence): Don't assume vector length fits in int.
16455
16456 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16457 (header_size, word_size): New constants.
16458 (allocate_vectorlike): Don't check size overflow here.
16459 (allocate_vector): Check it here instead, since this is the only
16460 caller of allocate_vectorlike that could cause overflow.
16461 Check that the new vector's length is representable as a fixnum.
16462
16463 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16464 The previous code was bogus. For example, next_almost_prime (32)
16465 returned 39, which is undesirable as it is a multiple of 3; and
16466 next_almost_prime (24) returned 25, which is a multiple of 5 so
16467 why was the code bothering to check for multiples of 7?
16468
16469 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16470
16471 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16472
16473 Variadic C functions now count arguments with ptrdiff_t.
16474 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16475 Back then I didn't know that the Emacs coding style prefers signed int.
16476 Also, in the meantime I found a few more instances where arguments
16477 were being counted with int, which may truncate counts on 64-bit
16478 machines, or EMACS_INT, which may be unnecessarily wide.
16479 * lisp.h (struct Lisp_Subr.function.aMANY)
16480 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16481 Arg counts are now ptrdiff_t, not size_t.
16482 All variadic functions and their callers changed accordingly.
16483 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16484 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16485 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16486 * callint.c (Fcall_interactively): Check arg count for overflow,
16487 to avoid potential buffer overrun. Use signed char, not 'int',
16488 for 'varies' array, so that we needn't bother to check its size
16489 calculation for overflow.
16490 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16491 * eval.c (apply_lambda):
16492 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16493 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16494 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16495
16496 * callint.c (Fcall_interactively): Don't use index var as event count.
16497
16498 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16499 * mem-limits.h (SIZE): Remove; no longer used.
16500
16501 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
16502
16503 Remove unnecessary casts.
16504 * xterm.c (x_term_init):
16505 * xfns.c (x_set_border_pixel):
16506 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16507 These aren't needed now that we assume ANSI C.
16508
16509 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16510 It's more likely to cause problems (due to unsigned overflow)
16511 than to cure them.
16512
16513 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16514
16515 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16516
16517 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16518
16519 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16520
16521 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16522
16523 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16524
16525 GLYPH_CODE_FACE returns EMACS_INT, not int.
16526 * dispextern.h (merge_faces):
16527 * xfaces.c (merge_faces):
16528 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16529 Don't assume EMACS_INT fits in int.
16530
16531 * character.h (CHAR_VALID_P): Remove unused parameter.
16532 * fontset.c, lisp.h, xdisp.c: All uses changed.
16533
16534 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16535
16536 * fns.c (concat): Minor tuning based on overflow analysis.
16537 This doesn't fix any bugs. Use int to hold character, instead
16538 of constantly refetching from Emacs object. Use XFASTINT, not
16539 XINT, for value known to be a character. Don't bother comparing
16540 a single byte to 0400, as it's always less.
16541
16542 * floatfns.c (Fexpt):
16543 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16544
16545 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16546 for characters.
16547
16548 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16549
16550 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16551 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16552 incorrectly succeed when S was a string, because 4294967386 was
16553 truncated before it was used.
16554
16555 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16556 Otherwise, an out-of-range integer could cause undefined behavior
16557 on a 64-bit host.
16558
16559 * composite.c: Use int, not EMACS_INT, for characters.
16560 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16561 EMACS_INT, for values that are known to be in character range.
16562 This doesn't fix any bugs but is the usual style inside Emacs and
16563 may generate better code on 32-bit machines.
16564
16565 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16566 This is for reasons similar to the recent CHAR_STRING fix.
16567 * charset.c (Fencode_char): Check that character arg is actually
16568 a character. Pass an int to ENCODE_CHAR.
16569 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16570 wider than 'int', as a compile-time check to prevent future regressions
16571 in this area.
16572
16573 * character.c (char_string): Remove unnecessary casts.
16574
16575 Make sure a 64-bit char is never passed to CHAR_STRING.
16576 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16577 by silently ignoring the top 32 bits, allowing some values
16578 that were far too large to be valid characters.
16579 * character.h: Include <verify.h>.
16580 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16581 arguments are no wider than unsigned, as a compile-time check
16582 to prevent future regressions in this area.
16583 * data.c (Faset):
16584 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
16585 (Fsubst_char_in_region):
16586 * fns.c (concat):
16587 * xdisp.c (decode_mode_spec_coding):
16588 Adjust to CHAR_STRING's new requirement.
16589 * editfns.c (Finsert_char, Fsubst_char_in_region):
16590 * fns.c (concat): Check that character args are actually
16591 characters. Without this test, these functions did the wrong
16592 thing with wildly out-of-range values on 64-bit hosts.
16593
16594 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16595 These casts should not be needed on 32-bit hosts, either.
16596 * keyboard.c (read_char):
16597 * lread.c (Fload): Remove casts to unsigned.
16598
16599 * lisp.h (UNSIGNED_CMP): New macro.
16600 This fixes comparison bugs on 64-bit hosts.
16601 (ASCII_CHAR_P): Use it.
16602 * casefiddle.c (casify_object):
16603 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
16604 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16605 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16606 * dispextern.h (FACE_FROM_ID):
16607 * keyboard.c (read_char): Use UNSIGNED_CMP.
16608
16609 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16610 not to EMACS_INT, to avoid GCC warning.
16611
16612 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16613
16614 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16615 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16616 isn't needed on 32-bit machines.
16617
16618 * buffer.c (Fgenerate_new_buffer_name):
16619 Use EMACS_INT for count, not int.
16620 (advance_to_char_boundary): Return EMACS_INT, not int.
16621
16622 * data.c (Qcompiled_function): Now static.
16623
16624 * window.c (window_body_lines): Now static.
16625
16626 * image.c (gif_load): Rename local to avoid shadowing.
16627
16628 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16629 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16630 * alloc.c (make_save_value): Integer argument is now of type
16631 ptrdiff_t, not int.
16632 (mark_object): Use ptrdiff_t, not int.
16633 * lisp.h (pD): New macro.
16634 * print.c (print_object): Use it.
16635
16636 * alloc.c: Use EMACS_INT, not int, to count objects.
16637 (total_conses, total_markers, total_symbols, total_vector_size)
16638 (total_free_conses, total_free_markers, total_free_symbols)
16639 (total_free_floats, total_floats, total_free_intervals)
16640 (total_intervals, total_strings, total_free_strings):
16641 Now EMACS_INT, not int. All uses changed.
16642 (Fgarbage_collect): Compute overall total using a double, so that
16643 integer overflow is less likely to be a problem. Check for overflow
16644 when converting back to an integer.
16645 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16646 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16647 These were 'int' variables that could overflow on 64-bit hosts;
16648 they were never used, so remove them instead of repairing them.
16649 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16650 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16651 Previously, this ceilinged at INT_MAX, but that doesn't work on
16652 64-bit machines.
16653 (allocate_pseudovector): Don't use EMACS_INT when int would do.
16654
16655 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16656 (allocate_vectorlike): Check for ptrdiff_t overflow.
16657 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16658 when a (possibly-narrower) signed value would do just as well.
16659 We prefer using signed arithmetic, to avoid comparison confusion.
16660
16661 * alloc.c: Catch some string size overflows that we were missing.
16662 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16663 for convenience in STRING_BYTES_MAX.
16664 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16665 The definition here is exact; the one in lisp.h was approximate.
16666 (allocate_string_data): Check for string overflow. This catches
16667 some instances we weren't catching before. Also, it catches
16668 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16669 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16670 and ptrdiff_t and EMACS_INT are both 64 bits.
16671
16672 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16673 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16674 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16675
16676 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16677
16678 * alloc.c (Fmake_string): Check for out-of-range init.
16679
16680 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16681
16682 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16683
16684 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16685
16686 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16687 xg_get_default_scrollbar_width.
16688
16689 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16690 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16691 (style_changed_cb): Call update_theme_scrollbar_width and call
16692 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16693 all frames (Bug#8505).
16694 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16695 Call gtk_window_set_resizable if HAVE_GTK3.
16696 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16697 and height if HAVE_GTK3 (Bug#8505).
16698 (scroll_bar_width_for_theme): New variable.
16699 (update_theme_scrollbar_width): New function.
16700 (xg_get_default_scrollbar_width): Move code to
16701 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16702 (xg_initialize): Call update_theme_scrollbar_width.
16703
16704 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16705
16706 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16707
16708 2011-06-12 Martin Rudalics <rudalics@gmx.at>
16709
16710 * frame.c (make_frame): Call other_buffer_safely instead of
16711 other_buffer.
16712
16713 * window.c (temp_output_buffer_show): Call display_buffer with
16714 second argument Vtemp_buffer_show_specifiers and reset latter
16715 immediately after the call.
16716 (Vtemp_buffer_show_specifiers): New variable.
16717 (auto_window_vscroll_p, next_screen_context_lines)
16718 (Vscroll_preserve_screen_position): Remove leading asterisks from
16719 doc-strings.
16720
16721 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
16722
16723 Fix minor problems found by GCC 4.6.0 static checking.
16724 * buffer.c (Qclone_number): Remove for now, as it's unused.
16725 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16726 (record_buffer): Remove unused local.
16727 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16728 (set_frame_buffer_list): Remove; unused.
16729 * frame.h (other_visible_frames): Remove decl.
16730 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16731 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16732 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16733 if HAVE_GPM.
16734 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16735 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16736 Define only if HAVE_GPM.
16737 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16738 (update_hints_inhibit): Remove; never set. All uses removed.
16739 * widgetprv.h (emacsFrameClassRec): Remove decl.
16740 * window.c (delete_deletable_window): Now returns void, since it
16741 wasn't returning anything.
16742 (compare_window_configurations): Remove unused locals.
16743 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16744 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16745 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16746 the same widths as pointers. This follows up on the 2011-05-06 patch.
16747 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16748 * xterm.h: Likewise.
16749 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16750
16751 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
16752
16753 * makefile.w32-in: Update dependencies.
16754 (LISP_H): Add lib/intprops.h.
16755
16756 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16757
16758 * image.c (gif_load): Add animation frame delay to the metadata.
16759 (syms_of_image): Use DEFSYM. New symbol `delay'.
16760
16761 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16762
16763 * window.c (delete_deletable_window): Re-add.
16764 (Fset_window_configuration): Rewrite to handle dead buffers and
16765 consequently deletable windows.
16766 (window_tree, Fwindow_tree): Remove. Supply functionality in
16767 window.el.
16768 (compare_window_configurations): Simplify code.
16769
16770 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16771
16772 * image.c (imagemagick_load_image): Fix type mismatch.
16773 (Fimagemagick_types): Likewise.
16774
16775 * window.h (replace_buffer_in_windows): Declare.
16776
16777 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16778
16779 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16780 Qclone_number. Remove external declaration of Qdelete_window.
16781 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16782 code.
16783 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16784 Run Qbuffer_list_update_hook if allowed.
16785 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16786 buffer list implementation.
16787 (other_buffer_safely): New function.
16788 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16789 calls to replace_buffer_in_windows and
16790 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16791 if allowed.
16792 (record_buffer): Inhibit quitting and rewrite using quittable
16793 functions. Run Qbuffer_list_update_hook if allowed.
16794 (Frecord_buffer, Funrecord_buffer): New functions.
16795 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16796 Move switch-to-buffer to window.el.
16797 (bury-buffer): Move to window.el.
16798 (Vbuffer_list_update_hook): New variable.
16799
16800 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16801 section.
16802
16803 * window.h (resize_frame_windows): Move up in code.
16804 (Fwindow_frame): Remove EXFUN.
16805 (replace_buffer_in_all_windows): Remove prototype.
16806 (replace_buffer_in_windows_safely): Add prototype.
16807
16808 * window.c: Declare Qdelete_window static again. Move down
16809 declaration of select_count.
16810 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16811 (Fother_window): Move to window.el.
16812 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16813 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16814 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16815 window.el.
16816 (replace_buffer_in_windows): Implement by calling
16817 Qreplace_buffer_in_windows.
16818 (replace_buffer_in_all_windows): Remove with some functionality
16819 moved into replace_buffer_in_windows_safely.
16820 (replace_buffer_in_windows_safely): New function.
16821 (select_window_norecord, select_frame_norecord): Move in front
16822 of run_window_configuration_change_hook. Remove now obsolete
16823 declarations.
16824 (Fset_window_buffer): Rewrite doc-string.
16825 Call Qrecord_window_buffer.
16826 (keys_of_window): Move binding for other-window to window.el.
16827
16828 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16829
16830 * dispextern.h (struct image): Replace data member, whose int_val
16831 and ptr_val fields were not used by anything, with a single
16832 lisp_val object.
16833
16834 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16835 (gif_clear_image, gif_load, imagemagick_load_image)
16836 (gs_clear_image, gs_load): Callers changed.
16837
16838 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16839
16840 * buffer.h: Include <time.h>, for time_t.
16841 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16842
16843 Fix minor problems found by static checking.
16844
16845 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16846
16847 Make identifiers static if they are not used in other modules.
16848 * data.c (Qcompiled_function, Qframe, Qvector):
16849 * image.c (QimageMagick, Qsvg):
16850 * minibuf.c (Qmetadata):
16851 * window.c (resize_window_check, resize_root_window): Now static.
16852 * window.h (resize_window_check, resize_root_window): Remove decls.
16853
16854 * window.c (window_deletion_count, delete_deletable_window):
16855 Remove; unused.
16856 (window_body_lines): Now static.
16857 (Fdelete_other_windows_internal): Mark vars as initialized.
16858 Make sure 'resize_failed' is initialized.
16859 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16860 (resize_window_apply): Remove unused local.
16861 * window.h (delete_deletable_window): Remove decl.
16862
16863 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16864 (imagemagick_load_image): Fix pointer signedness problem by changing
16865 last arg from unsigned char * to char *. All uses changed.
16866 Also, fix a local for similar reasons.
16867 Remove unused locals. Remove locals to avoid shadowing.
16868 (fn_rsvg_handle_free): Remove; unused.
16869 (svg_load, svg_load_image): Fix pointer signedness problem.
16870 (imagemagick_load_image): Don't use garbage pointer image_wand.
16871
16872 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16873
16874 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16875
16876 * image.c (gif_load): Fix omitted cast error introduced by
16877 2011-06-06 change.
16878
16879 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16880
16881 * window.h (resize_proportionally, orig_total_lines)
16882 (orig_top_line): Remove from window structure.
16883 (set_window_height, set_window_width, change_window_heights)
16884 (Fdelete_window): Remove prototypes.
16885 (resize_frame_windows): Remove duplicate declaration.
16886
16887 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16888
16889 * window.h (resize_frame_windows, resize_window_check)
16890 (delete_deletable_window, resize_root_window)
16891 (resize_frame_windows): Declare prototypes.
16892
16893 * window.c (resize_window_apply): Make definition be "static" to
16894 match the prototype.
16895
16896 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16897
16898 * window.c: Remove declarations of Qwindow_size_fixed,
16899 window_min_size_1, window_min_size_2, window_min_size,
16900 size_window, window_fixed_size_p, enlarge_window, delete_window.
16901 Remove static from declaration of Qdelete_window, it's
16902 temporarily needed by Fbury_buffer.
16903 (replace_window): Don't assign orig_top_line and
16904 orig_total_lines.
16905 (Fdelete_window, delete_window): Remove. Window deletion is
16906 handled by window.el.
16907 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16908 Replace Fdelete_window calls with calls to Qdelete_window.
16909 (Fdelete_other_windows): Remove. Deleting other windows is
16910 handled by window.el.
16911 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16912 handled in window.el.
16913 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16914 Window minimum sizes are handled in window.el.
16915 (shrink_windows, size_window, set_window_height)
16916 (set_window_width, change_window_heights, window_height)
16917 (window_width, CURBEG, CURSIZE, enlarge_window)
16918 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16919 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16920 handled in window.el.
16921 (make_dummy_parent): Rename to make_parent_window and give it a
16922 second argument horflag.
16923 (make_window): Don't set resize_proportionally any more.
16924 (Fsplit_window): Remove. Windows are split in window.el.
16925 (save_restore_action, save_restore_orig_size)
16926 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16927 Resize mini windows in window.el.
16928 (grow_mini_window, shrink_mini_window): Implement by calling
16929 Qresize_root_window_vertically, resize_window_check and
16930 resize_window_apply.
16931 (saved_window, Fset_window_configuration, save_window_save):
16932 Do not handle orig_top_line, orig_total_lines, and
16933 resize_proportionally.
16934 (window_min_height, window_min_width): Move to window.el.
16935 (keys_of_window): Move bindings for delete-other-windows,
16936 split-window, delete-window and enlarge-window to window.el.
16937
16938 * buffer.c: Temporarily extern Qdelete_window.
16939 (Fbury_buffer): Temporarily call Qdelete_window instead of
16940 Fdelete_window (Fbury_buffer will move to window.el soon).
16941
16942 * frame.c (set_menu_bar_lines_1): Remove code handling
16943 orig_top_line and orig_total_lines.
16944
16945 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16946 set_window_height but set heights directly.
16947 (change_frame_size_1): Use resize_frame_windows.
16948
16949 * xdisp.c (init_xdisp): Don't use set_window_height but set
16950 heights directly.
16951
16952 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16953 Use resize_frame_windows instead of change_window_heights and run
16954 run_window_configuration_change_hook.
16955
16956 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16957 instead of change_window_heights and run
16958 run_window_configuration_change_hook.
16959
16960 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16961
16962 * window.c (replace_window): Rename second argument REPLACEMENT to
16963 NEW. New third argument SETFLAG. Rewrite.
16964 (delete_window, make_dummy_parent): Call replace_window with
16965 third argument 1.
16966 (window_list_1): Move down in code.
16967 (run_window_configuration_change_hook): Move set_buffer part
16968 before select_frame_norecord part in order to unwind correctly.
16969 Rename count1 to count.
16970 (recombine_windows, delete_deletable_window, resize_root_window)
16971 (Fdelete_other_windows_internal)
16972 (Frun_window_configuration_change_hook, make_parent_window)
16973 (resize_window_check, resize_window_apply, Fresize_window_apply)
16974 (resize_frame_windows, Fsplit_window_internal)
16975 (Fdelete_window_internal, Fresize_mini_window_internal):
16976 New functions.
16977 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16978
16979 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16980
16981 * window.h (window): Add some new members to window structure -
16982 normal_lines, normal_cols, new_total, new_normal, clone_number,
16983 splits, nest, prev_buffers, next_buffers.
16984 (WINDOW_TOTAL_SIZE): Move here from window.c.
16985 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16986
16987 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16988 Remove.
16989 (make_dummy_parent): Set new members of windows structure.
16990 (make_window): Move down in code. Handle new members of window
16991 structure.
16992 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16993 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16994 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16995 (Fset_window_prev_buffers, Fwindow_next_buffers)
16996 (Fset_window_next_buffers, Fset_window_clone_number):
16997 New functions.
16998 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16999 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
17000 Doc-string fixes.
17001 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
17002 Argument WINDOW can be now internal window too.
17003 (Fwindow_use_time): Move up in code.
17004 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
17005 Rewrite doc-string.
17006 (Fset_window_configuration, saved_window)
17007 (Fcurrent_window_configuration, save_window_save): Handle new
17008 members of window structure.
17009 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
17010 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
17011 (syms_of_window): New Lisp objects Qrecord_window_buffer,
17012 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
17013 Qget_mru_window, Qresize_root_window,
17014 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
17015 Qauto_buffer_name; staticpro them.
17016
17017 2011-06-07 Martin Rudalics <rudalics@gmx.at>
17018
17019 * window.c (Fwindow_total_size, Fwindow_left_column)
17020 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
17021 (Fwindow_list_1): New functions.
17022 (window_box_text_cols): Replace with window_body_cols.
17023 (Fwindow_width, Fscroll_left, Fscroll_right):
17024 Use window_body_cols instead of window_box_text_cols.
17025 (delete_window, Fset_window_configuration):
17026 Call delete_all_subwindows with window as argument.
17027 (delete_all_subwindows): Take a window as argument and not a
17028 structure. Rewrite.
17029 (window_loop): Remove handling of GET_LRU_WINDOW and
17030 GET_LARGEST_WINDOW.
17031 (Fget_lru_window, Fget_largest_window): Move to window.el.
17032
17033 * window.h: Extern window_body_cols instead of
17034 window_box_text_cols. delete_all_subwindows now takes a
17035 Lisp_Object as argument.
17036
17037 * indent.c (compute_motion, Fcompute_motion):
17038 Use window_body_cols instead of window_box_text_cols.
17039
17040 * frame.c (delete_frame): Call delete_all_subwindows with root
17041 window as argument.
17042
17043 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
17044
17045 * fns.c (Fputhash): Document return value.
17046
17047 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
17048
17049 * image.c (gif_load): Implement gif89a spec "no disposal" method.
17050
17051 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17052
17053 Cons<->int and similar integer overflow fixes (Bug#8794).
17054
17055 Check for overflow when converting integer to cons and back.
17056 * charset.c (Fdefine_charset_internal, Fdecode_char):
17057 Use cons_to_unsigned to catch overflow.
17058 (Fencode_char): Use INTEGER_TO_CONS.
17059 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
17060 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
17061 * data.c (long_to_cons, cons_to_long): Remove.
17062 (cons_to_unsigned, cons_to_signed): New functions.
17063 These signal an error for invalid or out-of-range values.
17064 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
17065 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
17066 * font.c (Ffont_variation_glyphs):
17067 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
17068 * lisp.h: Include <intprops.h>.
17069 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
17070 (cons_to_signed, cons_to_unsigned): New decls.
17071 (long_to_cons, cons_to_long): Remove decls.
17072 * undo.c (record_first_change): Use INTEGER_TO_CONS.
17073 (Fprimitive_undo): Use CONS_TO_INTEGER.
17074 * xfns.c (Fx_window_property): Likewise.
17075 * xselect.c: Include <limits.h>.
17076 (x_own_selection, selection_data_to_lisp_data):
17077 Use INTEGER_TO_CONS.
17078 (x_handle_selection_request, x_handle_selection_clear)
17079 (x_get_foreign_selection, Fx_disown_selection_internal)
17080 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
17081 (lisp_data_to_selection_data): Use cons_to_unsigned.
17082 (x_fill_property_data): Use cons_to_signed.
17083 Report values out of range.
17084
17085 Check for buffer and string overflow more precisely.
17086 * buffer.h (BUF_BYTES_MAX): New macro.
17087 * lisp.h (STRING_BYTES_MAX): New macro.
17088 * alloc.c (Fmake_string):
17089 * character.c (string_escape_byte8):
17090 * coding.c (coding_alloc_by_realloc):
17091 * doprnt.c (doprnt):
17092 * editfns.c (Fformat):
17093 * eval.c (verror):
17094 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
17095 since they may not be the same number.
17096 * editfns.c (Finsert_char):
17097 * fileio.c (Finsert_file_contents):
17098 Likewise for BUF_BYTES_MAX.
17099
17100 * image.c: Use ptrdiff_t, not int, for sizes.
17101 (slurp_file): Switch from int to ptrdiff_t.
17102 All uses changed.
17103 (slurp_file): Check that file size fits in both size_t (for
17104 malloc) and ptrdiff_t (for sanity and safety).
17105
17106 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
17107 if b->modtime has its maximal value.
17108
17109 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
17110
17111 Don't assume time_t can fit into int.
17112 * buffer.h (struct buffer.modtime): Now time_t, not int.
17113 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
17114 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
17115
17116 Minor fixes for signed vs unsigned integers.
17117 * character.h (MAYBE_UNIFY_CHAR):
17118 * charset.c (maybe_unify_char):
17119 * keyboard.c (read_char, reorder_modifiers):
17120 XINT -> XFASTINT, since the integer must be nonnegative.
17121 * ftfont.c (ftfont_spec_pattern):
17122 * keymap.c (access_keymap, silly_event_symbol_error):
17123 XUINT -> XFASTINT, since the integer must be nonnegative.
17124 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
17125 since it makes no difference and we prefer signed.
17126 * keyboard.c (record_char): Use XUINT when all the neighbors do.
17127 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
17128 nonnegative.
17129
17130 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
17131
17132 * window.h (Fwindow_frame): Declare.
17133
17134 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17135
17136 * alloc.c: Simplify handling of large-request failures (Bug#8800).
17137 (SPARE_MEMORY): Always define.
17138 (LARGE_REQUEST): Remove.
17139 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
17140
17141 2011-06-06 Martin Rudalics <rudalics@gmx.at>
17142
17143 * lisp.h: Move EXFUNS for Fframe_root_window,
17144 Fframe_first_window and Fset_frame_selected_window to window.h.
17145
17146 * window.h: Move EXFUNS for Fframe_root_window,
17147 Fframe_first_window and Fset_frame_selected_window here from
17148 lisp.h.
17149
17150 * frame.c (Fwindow_frame, Fframe_first_window)
17151 (Fframe_root_window, Fframe_selected_window)
17152 (Fset_frame_selected_window): Move to window.c.
17153 (Factive_minibuffer_window): Move to minibuf.c.
17154 (Fother_visible_frames_p): New function.
17155
17156 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
17157
17158 * window.c (decode_window, decode_any_window): Move up in code.
17159 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
17160 (inhibit_frame_unsplittable): Remove unused variable.
17161 (Fwindow_buffer): Move up and rewrite doc-string.
17162 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
17163 (Fwindow_prev): New functions.
17164 (Fwindow_frame): Move here from frame.c. Accept any window as
17165 argument.
17166 (Fframe_root_window, Fframe_first_window)
17167 (Fframe_selected_window): Move here from frame.c. Accept frame
17168 or arbitrary window as argument. Update doc-strings.
17169 (Fminibuffer_window): Move up in code.
17170 (Fwindow_minibuffer_p): Move up in code and simplify.
17171 (Fset_frame_selected_window): Move here from frame.c.
17172 Marginal rewrite.
17173 (Fselected_window, select_window, Fselect_window): Move up in
17174 code. Minor doc-string fixes.
17175
17176 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17177
17178 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
17179 Do not assume that spare memory exists; that assumption is valid
17180 only if SYSTEM_MALLOC.
17181 (LARGE_REQUEST): New macro, so that the issue of large requests
17182 is separated from the issue of spare memory.
17183
17184 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
17185
17186 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
17187 format. (Bug#8806)
17188
17189 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
17190
17191 * xfns.c (x_set_scroll_bar_default_width): Move declarations
17192 before statements.
17193
17194 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
17195
17196 * gtkutil.c (xg_get_default_scrollbar_width): New function.
17197
17198 * gtkutil.h: Declare xg_get_default_scrollbar_width.
17199
17200 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
17201 min width by calling x_set_scroll_bar_default_width (Bug#8505).
17202
17203 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
17204
17205 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
17206
17207 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
17208
17209 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
17210 (x_clipboard_manager_save): Add return value.
17211 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
17212 New error handlers.
17213 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
17214 Obey Vx_select_enable_clipboard_manager. Catch errors in
17215 x_clipboard_manager_save (Bug#8779).
17216 (Vx_select_enable_clipboard_manager): New variable.
17217 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
17218
17219 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
17220
17221 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
17222
17223 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17224
17225 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
17226 in the current matrix if keep_current_p is non-zero.
17227
17228 2011-06-04 Eli Zaretskii <eliz@gnu.org>
17229
17230 * bidi.c (bidi_level_of_next_char): Fix last change.
17231
17232 2011-06-03 Eli Zaretskii <eliz@gnu.org>
17233
17234 Support bidi reordering of text covered by display properties.
17235
17236 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
17237 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
17238 (bidi_cache_search, bidi_cache_iterator_state)
17239 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
17240 (bidi_level_of_next_char, bidi_move_to_visually_next):
17241 Support character positions inside a run of characters covered by a
17242 display string.
17243 (bidi_paragraph_init, bidi_resolve_explicit_1)
17244 (bidi_level_of_next_char): Call bidi_fetch_char and
17245 bidi_fetch_char_advance instead of FETCH_CHAR and
17246 FETCH_CHAR_ADVANCE.
17247 (bidi_init_it): Initialize new members.
17248 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
17249 definitions.
17250 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
17251 instead of using explicit *_CHAR codes.
17252 (bidi_resolve_explicit, bidi_resolve_weak):
17253 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
17254 bidirectional text is supported only in multibyte buffers.
17255 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
17256 it to initialize the frame_window_p member of struct bidi_it.
17257 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
17258 (bidi_resolve_explicit, bidi_resolve_weak)
17259 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
17260 bidi_it->nchars is non-positive.
17261 (bidi_level_of_next_char): Don't try to lookup the cache for the
17262 next/previous character if nothing is cached there yet, or if we
17263 were just reseat()'ed to a new position.
17264
17265 * xdisp.c (set_cursor_from_row): Set start and stop points
17266 according to the row's direction when priming the loop that looks
17267 for the glyph on which to display cursor.
17268 (single_display_spec_intangible_p): Function deleted.
17269 (display_prop_intangible_p): Reimplement to call
17270 handle_display_spec instead of single_display_spec_intangible_p.
17271 Accept 3 additional arguments needed by handle_display_spec.
17272 This fixes incorrect cursor motion across display property with complex
17273 values: lists, `(when COND...)' forms, etc.
17274 (single_display_spec_string_p): Support property values that are
17275 lists with the argument STRING its top-level element.
17276 (display_prop_string_p): Fix the condition for processing a
17277 property that is a list to be consistent with handle_display_spec.
17278 (handle_display_spec): New function, refactored from the
17279 last portion of handle_display_prop.
17280 (compute_display_string_pos): Accept additional argument
17281 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
17282 value of a `display' property is a "replacing spec".
17283 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
17284 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
17285 the display property, but just return a value indicating whether
17286 the display property will replace the characters it covers.
17287 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
17288 frame_window_p members of struct bidi_it.
17289 (compute_display_string_pos, compute_display_string_end):
17290 New functions.
17291 (push_it): Accept second argument POSITION, where pop_it should
17292 jump to continue iteration.
17293 (reseat_1): Initialize bidi_it.disp_pos.
17294
17295 * keyboard.c (adjust_point_for_property): Adjust the call to
17296 display_prop_intangible_p to its new signature.
17297
17298 * dispextern.h (struct bidi_it): New member frame_window_p.
17299 (bidi_init_it): Update prototypes.
17300 (display_prop_intangible_p): Update prototype.
17301 (compute_display_string_pos, compute_display_string_end):
17302 Declare prototypes.
17303 (struct bidi_it): New members nchars and disp_pos. ch_len is now
17304 EMACS_INT.
17305
17306 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
17307
17308 Malloc failure behavior now depends on size of allocation.
17309 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
17310 * lisp.h: Change signatures accordingly.
17311 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
17312 All callers changed. (Bug#8762)
17313
17314 * gnutls.c: Use Emacs's memory allocators.
17315 Without this change, the gnutls library would invoke malloc etc.
17316 directly, which causes problems on non-SYNC_INPUT hosts, and which
17317 runs afoul of improving memory_full behavior. (Bug#8761)
17318 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
17319 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
17320 xfree instead of the default malloc, realloc, free.
17321 (Fgnutls_boot): No need to check for memory allocation failure,
17322 since xmalloc does that for us.
17323
17324 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
17325 * category.c (hash_get_category_set):
17326 * ccl.c (ccl_driver):
17327 * charset.c (Fdefine_charset_internal):
17328 * charset.h (struct charset.hash_index):
17329 * composite.c (get_composition_id, gstring_lookup_cache)
17330 (composition_gstring_put_cache):
17331 * composite.h (struct composition.hash_index):
17332 * dispextern.h (struct image.hash):
17333 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
17334 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
17335 (hashfn_equal, hashfn_user_defined, make_hash_table)
17336 (maybe_resize_hash_table, hash_lookup, hash_put)
17337 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
17338 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
17339 (Fsxhash, Fgethash, Fputhash, Fmaphash):
17340 * image.c (make_image, search_image_cache, lookup_image)
17341 (xpm_put_color_table_h):
17342 * lisp.h (struct Lisp_Hash_Table):
17343 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
17344 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
17345 for hashes and hash indexes, instead of 'unsigned' and 'int'.
17346 * alloc.c (allocate_vectorlike):
17347 Check for overflow in vector size calculations.
17348 * ccl.c (ccl_driver):
17349 Check for overflow when converting EMACS_INT to int.
17350 * fns.c, image.c: Remove unnecessary static decls that would otherwise
17351 need to be updated by these changes.
17352 * fns.c (make_hash_table, maybe_resize_hash_table):
17353 Check for integer overflow with large hash tables.
17354 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
17355 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
17356 (SXHASH_REDUCE): New macro.
17357 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
17358 Use it instead of discarding useful hash info with large hash values.
17359 (sxhash_float): New function.
17360 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
17361 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
17362 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
17363 Rewrite to use FIXNUM_BITS, as this simplifies things.
17364 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
17365 Adjust signatures to match updated version of code.
17366 (consing_since_gc): Now EMACS_INT, since a single hash table can
17367 use more than INT_MAX bytes.
17368
17369 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
17370
17371 Make it possible to build with GCC-4.6+ -O2 -flto.
17372
17373 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
17374
17375 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
17376
17377 * minibuf.c (get_minibuffer, read_minibuf_unwind):
17378 Call minibuffer-inactive-mode.
17379
17380 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
17381
17382 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
17383 Update dependencies.
17384
17385 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17386
17387 * data.c (init_data): Remove code for UTS, this system is not
17388 supported anymore.
17389
17390 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17391
17392 Don't force ./temacs to start in terminal mode.
17393
17394 * frame.c (make_initial_frame): Initialize faces in all cases, not
17395 only when CANNOT_DUMP is defined.
17396 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17397
17398 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17399
17400 * dispnew.c (add_window_display_history): Use const for the string
17401 pointer. Remove declaration, not needed.
17402
17403 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17404
17405 Use 'inline', not 'INLINE'.
17406 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
17407 * alloc.c, fontset.c (INLINE): Remove.
17408 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17409 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17410 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17411 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17412 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17413
17414 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17415
17416 Make it possible to run ./temacs.
17417
17418 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17419 syms_of_callproc does the same thing. Remove test for
17420 "initialized", do it in the caller.
17421 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17422
17423 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17424
17425 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
17426 (read_minibuf): Use get_minibuffer.
17427 (syms_of_minibuf): Use DEFSYM.
17428 (Qmetadata): New var.
17429 * data.c (Qbuffer): Don't make it static.
17430 (syms_of_data): Use DEFSYM.
17431
17432 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17433
17434 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17435 (CCL_CODE_MIN): New macro.
17436
17437 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17438
17439 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17440
17441 * eval.c (Qdebug): Now static.
17442 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17443 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17444 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17445
17446 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17447
17448 * image.c: Various fixes to ImageMagick code comments.
17449 (Fimagemagick_types): Doc fix.
17450
17451 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17452
17453 Minor fixes prompted by GCC 4.6.0 warnings.
17454
17455 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17456
17457 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17458 (x_clipboard_manager_save_all): Move extern decl to ...
17459 * xterm.h: ... here, so that it can be checked for consistency.
17460
17461 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17462
17463 * xselect.c (x_clipboard_manager_save_frame)
17464 (x_clipboard_manager_save_all): New functions.
17465 (Fx_clipboard_manager_save): Lisp function deleted.
17466
17467 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17468 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17469
17470 * xterm.h: Update prototype.
17471
17472 2011-05-28 William Xu <william.xwl@gmail.com>
17473
17474 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17475 exiting (Bug#8239).
17476
17477 2011-05-28 Jim Meyering <meyering@redhat.com>
17478
17479 Avoid a sign-extension bug in crypto_hash_function.
17480 * fns.c (to_uchar): Define.
17481 (crypto_hash_function): Use it to convert some newly-signed
17482 variables to unsigned, to avoid sign-extension bugs. For example,
17483 without this change, (md5 "truc") would evaluate to
17484 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17485 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
17486 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
17487
17488 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17489
17490 Integer overflow fixes.
17491
17492 * dbusbind.c: Serial number integer overflow fixes.
17493 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
17494 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17495 to hold a serial number that is too large for a fixnum.
17496 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17497 Check for serial numbers out of range. Decode any serial number
17498 that was so large that it became a float. (Bug#8722)
17499
17500 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17501 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17502 Use XFASTINT rather than XUINT when numbers are nonnegative.
17503 (xd_append_arg, Fdbus_method_return_internal):
17504 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17505 arguments, check that Lisp number is nonnegative, rather than
17506 silently wrapping negative numbers around. (Bug#8722)
17507 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
17508 (Bug#8722)
17509
17510 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17511
17512 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17513
17514 ccl: Add integer overflow checks.
17515 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17516 (IN_INT_RANGE): New macros.
17517 (ccl_driver): Use them to check for integer overflow when
17518 decoding a CCL program. Many of the new checks are whether XINT (x)
17519 fits in int; it doesn't always, on 64-bit hosts. The new version
17520 doesn't catch all possible integer overflows, but it's an
17521 improvement. (Bug#8719)
17522
17523 * alloc.c (make_event_array): Use XINT, not XUINT.
17524 There's no need for unsigned here.
17525
17526 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17527 This follows up to the 2011-05-06 change that substituted uintptr_t
17528 for EMACS_INT. This case wasn't caught back then.
17529
17530 Rework Fformat to avoid integer overflow issues.
17531 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17532 now (part of C89). Include <verify.h>.
17533 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17534 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17535 (Fformat): Avoid the prepass trying to compute sizes; it was only
17536 approximate and thus did not catch overflow reliably. Instead, walk
17537 through the format just once, formatting and computing sizes as we go,
17538 checking for integer overflow at every step, and allocating a larger
17539 buffer as needed. Keep track separately whether the format is
17540 multibyte. Keep only the most-recently calculated precision, rather
17541 than them all. Record whether each argument has been converted to
17542 string. Use EMACS_INT, not int, for byte and char and arg counts.
17543 Support field widths and precisions larger than INT_MAX. Avoid
17544 sprintf's undefined behavior with conversion specifications such as %#d
17545 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17546 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17547 formatting out-of-range floating point numbers with int
17548 formats. (Bug#8668)
17549
17550 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17551
17552 * data.c: Avoid integer truncation in expressions involving floats.
17553 * data.c: Include <intprops.h>.
17554 (arith_driver): When there's an integer overflow in an expression
17555 involving floating point, convert the integers to floating point
17556 so that the resulting value does not suffer from catastrophic
17557 integer truncation. For example, on a 64-bit host (* 4
17558 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17559 Do not rely on undefined behavior after integer overflow.
17560
17561 merge count_size_as_multibyte, parse_str_to_multibyte
17562 * character.c, character.h (count_size_as_multibyte):
17563 Rename from parse_str_to_multibyte; all uses changed.
17564 Check for integer overflow.
17565 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17566 since it's now a duplicate of the other. This is more of
17567 a character than a buffer op, so better that it's in character.c.
17568 * fns.c, print.c: Adjust to above changes.
17569
17570 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17571
17572 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17573
17574 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17575
17576 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17577 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17578 (x_clipboard_manager_save): Now static.
17579 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17580
17581 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17582 (crypto_hash_function): Now static.
17583 Fix pointer signedness problems. Avoid unnecessary initializations.
17584
17585 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
17586
17587 * termhooks.h (Vselection_alist): Make it terminal-local.
17588
17589 * terminal.c (create_terminal): Initialize it.
17590
17591 * xselect.c: Support for clipboard managers.
17592 (Vselection_alist): Move to termhooks.h as terminal-local var.
17593 (LOCAL_SELECTION): New macro.
17594 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17595 (symbol_to_x_atom): Remove gratuitous arg.
17596 (x_handle_selection_request, lisp_data_to_selection_data)
17597 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
17598 (x_own_selection, x_get_local_selection, x_convert_selection):
17599 New arg, specifying work frame. Use terminal-local Vselection_alist.
17600 (some_frame_on_display): Delete unused function.
17601 (Fx_own_selection_internal, Fx_get_selection_internal)
17602 (Fx_disown_selection_internal, Fx_selection_owner_p)
17603 (Fx_selection_exists_p): New optional frame arg.
17604 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17605 (x_handle_selection_clear): Don't treat other terminals with the
17606 same keyboard specially. Use the terminal-local Vselection_alist.
17607 (x_clear_frame_selections): Use Frun_hook_with_args.
17608
17609 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17610
17611 * xterm.h: Add support for those atoms.
17612
17613 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
17614
17615 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17616 (converted_selections, conversion_fail_tag): New global variables.
17617 (x_selection_request_lisp_error): Free the above.
17618 (x_get_local_selection): Remove unnecessary code.
17619 (x_reply_selection_request): Args changed; handle arbitrary array
17620 of converted selections stored in converted_selections.
17621 Separate the XChangeProperty and SelectionNotify steps.
17622 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17623 (x_convert_selection): New function.
17624 (x_handle_selection_event): Simplify.
17625 (x_get_foreign_selection): Don't ignore incoming requests while
17626 waiting for an answer; this will fail when we implement
17627 SAVE_TARGETS, and seems unnecessary anyway.
17628 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17629 (Vx_sent_selection_functions): Doc fix.
17630
17631 2011-05-26 Leo Liu <sdl.web@gmail.com>
17632
17633 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17634
17635 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17636
17637 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17638
17639 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17640 for fringe update if it has periodic bitmap.
17641 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
17642 and fringe_bitmap_periodic_p.
17643
17644 * fringe.c (get_fringe_bitmap_data): New function.
17645 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17646 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17647 row. Mark glyph row for fringe update if periodicity changed.
17648
17649 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17650 for fringe update unless it has periodic bitmap.
17651
17652 2011-05-25 Kenichi Handa <handa@m17n.org>
17653
17654 * xdisp.c (get_next_display_element): Set correct it->face_id for
17655 a static composition.
17656
17657 2011-05-24 Leo Liu <sdl.web@gmail.com>
17658
17659 * deps.mk (fns.o):
17660 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17661
17662 * fns.c (crypto_hash_function, Fsha1): New function.
17663 (Fmd5): Use crypto_hash_function.
17664 (syms_of_fns): Add Ssha1.
17665
17666 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17667
17668 * gnutls.c: Remove unused macros.
17669 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17670 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17671 Remove macros that are defined and never used.
17672 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17673
17674 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17675
17676 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17677 (Fx_get_selection_internal): Minor cleanup.
17678 (Fx_own_selection_internal): Rename arguments for consistency with
17679 select.el.
17680
17681 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17682
17683 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17684
17685 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17686
17687 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17688
17689 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17690
17691 * dispnew.c (scrolling_window): Don't exclude the case that the
17692 last enabled row in the desired matrix touches the bottom boundary.
17693
17694 2011-05-21 Glenn Morris <rgm@gnu.org>
17695
17696 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17697 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17698 and add some more files.
17699
17700 2011-05-20 Eli Zaretskii <eliz@gnu.org>
17701
17702 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17703 report_file_error introduced by the change from 2011-05-07.
17704
17705 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17706
17707 * systime.h (Time): Define only if emacs is defined.
17708 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17709 where the include path doesn't have X11/X.h by default. See
17710 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17711
17712 2011-05-20 Kenichi Handa <handa@m17n.org>
17713
17714 * composite.c (find_automatic_composition): Fix previous change.
17715
17716 2011-05-20 Glenn Morris <rgm@gnu.org>
17717
17718 * lisp.mk: New file, split from Makefile.in.
17719 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17720 (shortlisp): Remove.
17721 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17722
17723 2011-05-19 Glenn Morris <rgm@gnu.org>
17724
17725 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17726 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17727 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17728 (lisp): Set the order to that of loadup.el.
17729 (shortlisp): Make it a copy of $lisp.
17730 (SOME_MACHINE_LISP): Remove.
17731 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17732 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17733
17734 2011-05-18 Kenichi Handa <handa@m17n.org>
17735
17736 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17737 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17738 (find_automatic_composition): Mostly rewrite for efficiency.
17739
17740 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
17741
17742 * makefile.w32-in: Update dependencies.
17743
17744 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17745
17746 * menu.c: Include limits.h (fixes the MS-Windows build broken by
17747 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17748
17749 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
17750
17751 Fix some integer overflow issues, such as string length overflow.
17752
17753 * insdel.c (count_size_as_multibyte): Check for string overflow.
17754
17755 * character.c (lisp_string_width): Check for string overflow.
17756 Use EMACS_INT, not int, for string indexes and lengths; in
17757 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17758 the resulting string length overflows an EMACS_INT; instead,
17759 report a string overflow if no precision given. When checking for
17760 precision exhaustion, use a check that cannot possibly have
17761 integer overflow. (Bug#8675)
17762 * character.h (lisp_string_width): Adjust to new signature.
17763
17764 * alloc.c (string_overflow): New function.
17765 (Fmake_string): Use it. This doesn't change behavior, but saves
17766 a few bytes and will simplify future changes.
17767 * character.c (string_escape_byte8): Likewise.
17768 * lisp.h (string_overflow): New decl.
17769
17770 Fixups, following up to the user-interface timestamp change.
17771 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17772 for UI timestamps, instead of unsigned long.
17773 * msdos.c (mouse_get_pos): Likewise.
17774 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17775 * w32gui.h (Time): Define by including "systime.h" rather than by
17776 declaring it ourselves. (Bug#8664)
17777
17778 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17779 * image.c (clear_image_cache): Likewise.
17780
17781 * term.c (term_mouse_position): Don't assume time_t wraparound.
17782
17783 Be more systematic about user-interface timestamps.
17784 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17785 and sometimes 'EMACS_UINT', to represent these timestamps.
17786 This change causes it to use 'Time' uniformly, as that's what X uses.
17787 This makes the code easier to follow, and makes it easier to catch
17788 integer overflow bugs such as Bug#8664.
17789 * frame.c (Fmouse_position, Fmouse_pixel_position):
17790 Use Time, not unsigned long, for user-interface timestamps.
17791 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17792 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17793 * keyboard.h (last_event_timestamp): Likewise.
17794 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17795 * menu.h (xmenu_show): Likewise.
17796 * term.c (term_mouse_position): Likewise.
17797 * termhooks.h (struct input_event.timestamp): Likewise.
17798 (struct terminal.mouse_position_hook): Likewise.
17799 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17800 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17801 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17802 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17803 what it was before.
17804 * menu.h, termhooks.h: Include "systime.h", for Time.
17805
17806 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17807 Don't assume that the difference between two unsigned long values
17808 can fit into an integer. At this point, we know button_down_time
17809 <= event->timestamp, so the difference must be nonnegative, so
17810 there's no need to cast the result if double-click-time is
17811 nonnegative, as it should be; check that it's nonnegative, just in
17812 case. This bug is triggered when events are more than 2**31 ms
17813 apart (about 25 days). (Bug#8664)
17814
17815 * xselect.c (last_event_timestamp): Remove duplicate decl.
17816 (x_own_selection): Remove needless cast to unsigned long.
17817
17818 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17819 that always fit in int. Use a sentinel instead of a counter, to
17820 avoid a temp and to allay GCC's concerns about possible int overflow.
17821 * frame.h (struct frame): Use int for menu_bar_items_used
17822 instead of EMACS_INT, since it always fits in int.
17823
17824 * menu.c (grow_menu_items): Check for int overflow.
17825
17826 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17827
17828 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17829 Before, the code was not consistent. These values cannot exceed
17830 2**31 - 1 so there's no need to make them unsigned.
17831 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17832 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17833 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17834 as modifiers.
17835 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17836
17837 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17838 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17839 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17840 presumably because the widths might not match.
17841
17842 * window.c (size_window): Avoid needless test at loop start.
17843
17844 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17845
17846 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17847
17848 2011-05-12 Drew Adams <drew.adams@oracle.com>
17849
17850 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17851
17852 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17853
17854 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17855 `width' to `bar_area_x' and `bar_area_width', respectively.
17856 (x_scroll_run): Take account of fringe background extension.
17857
17858 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17859 Rename local vars `left' and `width' to `bar_area_x' and
17860 `bar_area_width', respectively.
17861 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17862 background extension.
17863
17864 2011-05-10 Jim Meyering <meyering@redhat.com>
17865
17866 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17867
17868 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17869
17870 * image.c (Finit_image_library): Return t for built-in image types,
17871 like pbm and xbm. (Bug#8640)
17872
17873 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17874
17875 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17876
17877 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17878
17879 * w32console.c (Fset_screen_color): Doc fix.
17880 (Fget_screen_color): New function.
17881 (syms_of_ntterm): Defsubr it.
17882
17883 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17884 unlink the temporary file if Fcall_process didn't create it in the
17885 first place.
17886 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17887 child process will be redirected to a file specified with `:file'.
17888 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17889 cue to call_process_cleanup not to close that handle.
17890
17891 2011-05-07 Ben Key <bkey76@gmail.com>
17892
17893 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17894 one of two shell specific rules, either bootstrap-temacs-CMD or
17895 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17896 to the previous implementation of the bootstrap-temacs rule.
17897 The bootstrap-temacs-CMD rule is similar to the previous
17898 implementation of the bootstrap-temacs rule except that it
17899 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17900 variable.
17901
17902 These changes, along with some changes to nt/configure.bat,
17903 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17904 earlier fix to add support for --cflags and --ldflags options
17905 that include quotes so that it works whether make uses cmd or
17906 sh as the shell.
17907
17908 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17909
17910 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17911 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17912 is a constant.
17913 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17914 a string. Handle both cases.
17915 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17916 (Fdbus_register_method): Use Qinvalid_function.
17917
17918 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17919
17920 * makefile.w32-in: Update dependencies.
17921 (LISP_H): Add inttypes.h and stdin.h.
17922 (PROCESS_H): Add unistd.h.
17923
17924 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17925
17926 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17927 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17928
17929 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17930
17931 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17932
17933 * term.c (vfatal): Remove stray call to va_end.
17934 It's not needed and the C Standard doesn't allow it here anyway.
17935
17936 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17937 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17938
17939 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17940 bytes.
17941
17942 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17943
17944 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17945
17946 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17947
17948 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17949
17950 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17951
17952 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17953 * charset.c (Fdefine_charset_internal): Don't initialize
17954 charset.code_space[15]. The value was garbage, on hosts with
17955 32-bit int (Bug#8600).
17956
17957 * lread.c (read_integer): Be more consistent with string-to-number.
17958 Use string_to_number to do the actual conversion; this avoids
17959 rounding errors and fixes some other screwups. Without this fix,
17960 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17961 (digit_to_number): Move earlier, for benefit of read_integer.
17962 Return -1 if the digit is out of range for the base, -2 if it is
17963 not a digit in any supported base. (Bug#8602)
17964
17965 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17966
17967 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17968 to match comment at start of function. This also removes a
17969 GCC warning about overflow in a 32+64-bit port.
17970
17971 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17972
17973 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17974 Reported by Stefan Monnier in
17975 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17976 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17977 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17978
17979 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17980 (EMACS_UINTPTR): Likewise, with uintptr_t.
17981
17982 * lisp.h: Prefer 64-bit EMACS_INT if available.
17983 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17984 on 32-bit hosts that have 64-bit int, so that they can access
17985 large files.
17986 However, temporarily disable this change unless the temporary
17987 symbol WIDE_EMACS_INT is defined.
17988
17989 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17990
17991 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17992 This removes an assumption that EMACS_INT and long are the same
17993 width as pointers. The assumption is true for Emacs porting targets
17994 now, but we want to make other targets possible.
17995 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17996 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17997 In the rest of the code, change types of integers that hold casted
17998 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17999 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
18000 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
18001 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
18002 No need to cast type when ORing.
18003 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
18004 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
18005 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
18006 assume EMACS_INT is the same width as char *.
18007 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
18008 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
18009 Remove no-longer-needed casts.
18010 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
18011 (xg_tool_bar_help_callback, xg_make_tool_item):
18012 Use EMACS_INTPTR to hold an integer
18013 that will be cast to void *; this can avoid a GCC warning
18014 if EMACS_INT is not the same width as void *.
18015 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
18016 * xdisp.c (display_echo_area_1, resize_mini_window_1):
18017 (current_message_1, set_message_1):
18018 Use a local to convert to proper width without a cast.
18019 * xmenu.c (dialog_selection_callback): Likewise.
18020
18021 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
18022 Also, don't assume VALBITS / RAND_BITS is less than 5,
18023 and don't rely on undefined behavior when shifting a 1 left into
18024 the sign bit.
18025 * lisp.h (get_random): Change signature to match.
18026
18027 * lread.c (hash_string): Use size_t, not int, for hash computation.
18028 Normally we prefer signed values; but hashing is special, because
18029 it's better to use unsigned division on hash table sizes so that
18030 the remainder is nonnegative. Also, size_t is the natural width
18031 for hashing into memory. The previous code used 'int', which doesn't
18032 retain enough info to hash well into very large tables.
18033 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
18034
18035 * dbusbind.c: Don't possibly lose pointer info when converting.
18036 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18037 Use XPNTR rather than XHASH, so that the high-order bits of
18038 the pointer aren't lost when converting through void *.
18039
18040 * eval.c (Fautoload): Don't double-shift a pointer.
18041
18042 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
18043
18044 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
18045
18046 * gnutls.c (DEF_GNUTLS_FN):
18047 * image.c (DEF_IMGLIB_FN): Make function pointers static.
18048
18049 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
18050
18051 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
18052 marker. (Bug#8610)
18053
18054 2011-05-05 Eli Zaretskii <eliz@gnu.org>
18055
18056 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
18057 New version that can reserve upto 2GB of heap space.
18058
18059 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
18060
18061 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
18062
18063 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
18064
18065 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
18066 `gnutls_certificate_set_x509_key_file'.
18067
18068 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
18069
18070 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
18071 Update dependencies.
18072
18073 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18074
18075 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
18076 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
18077 Remove unused parameter `fildes'.
18078 * process.c (read_process_output, send_process): Don't pass it.
18079
18080 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18081
18082 Fix previous change: the library cache is defined in w32.c.
18083 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
18084 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
18085
18086 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18087
18088 Implement dynamic loading of GnuTLS on Windows.
18089
18090 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
18091 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
18092 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18093 Declare.
18094
18095 * gnutls.c (Qgnutls_dll): Define.
18096 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
18097 (gnutls_*): Declare function pointers.
18098 (init_gnutls_functions): New function to initialize function pointers.
18099 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
18100 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
18101 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18102 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
18103 (emacs_gnutls_write, emacs_gnutls_read)
18104 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
18105 (Fgnutls_available_p): New function.
18106 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
18107 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
18108 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
18109
18110 * image.c: Include w32.h.
18111 (Vimage_type_cache): Delete.
18112 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
18113 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
18114 (w32_delayed_load): Move to w32.c.
18115
18116 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
18117
18118 * w32.c (QCloaded_from, Vlibrary_cache): Define.
18119 (w32_delayed_load): Move from image.c. When loading a library, record
18120 its filename in the :loaded-from property of the library id.
18121 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
18122 Initialize and staticpro them.
18123 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
18124
18125 * process.c: Include lisp.h before w32.h, not after.
18126 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
18127 instead of gnutls_record_check_pending.
18128
18129 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
18130
18131 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
18132
18133 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
18134 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
18135 as passed in.
18136
18137 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
18138
18139 * xterm.c (x_set_frame_alpha): Do not set property on anything
18140 else than FRAME_X_OUTER_WINDOW (Bug#8608).
18141
18142 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
18143
18144 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
18145
18146 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
18147
18148 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
18149 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
18150 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
18151 (gnutls_global_initialized, Qgnutls_bootprop_priority)
18152 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
18153 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
18154 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
18155 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
18156 (Qgnutls_bootprop_callbacks_verify): Make static.
18157
18158 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
18159
18160 * callproc.c: Indentation fixup.
18161
18162 * sysdep.c (wait_for_termination_1): Make static.
18163 (wait_for_termination, interruptible_wait_for_termination):
18164 Move after wait_for_termination_1.
18165
18166 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
18167
18168 * sysdep.c (interruptible_wait_for_termination): New function
18169 which is like wait_for_termination, but allows keyboard
18170 interruptions.
18171
18172 * callproc.c (Fcall_process): Add (:file "file") as an option for
18173 the STDOUT buffer.
18174 (Fcall_process_region): Ditto.
18175
18176 2011-04-30 Eli Zaretskii <eliz@gnu.org>
18177
18178 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
18179 rather than `XVECTOR (FOO)->size'.
18180
18181 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
18182 inttypes.h, as a gnulib replacement is used if it not available in
18183 system headers.
18184
18185 2011-04-21 Eli Zaretskii <eliz@gnu.org>
18186
18187 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
18188 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
18189 of MOST_POSITIVE_FIXNUM. (Bug#8528)
18190
18191 * coding.c (coding_alloc_by_realloc): Error out if destination
18192 will grow beyond MOST_POSITIVE_FIXNUM.
18193 (decode_coding_emacs_mule): Abort if there isn't enough place in
18194 charbuf for the composition carryover bytes. Reserve an extra
18195 space for up to 2 characters produced in a loop.
18196 (decode_coding_iso_2022): Abort if there isn't enough place in
18197 charbuf for the composition carryover bytes.
18198
18199 2011-04-21 Eli Zaretskii <eliz@gnu.org>
18200
18201 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
18202 aborting when %lld or %lll format is passed.
18203 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
18204 %llo or %llx format is passed. (Bug#8545)
18205
18206 * window.c (window_scroll_line_based): Use a marker instead of
18207 simple variables to record original value of point. (Bug#7952)
18208
18209 * doprnt.c (doprnt): Fix the case where a multibyte sequence
18210 produced by %s or %c overflows available buffer space. (Bug#8545)
18211
18212 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
18213
18214 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
18215 (SIZE_MAX): Move defn after all includes, as they might #define it.
18216
18217 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18218
18219 * w32.c (init_environment): Warn about defaulting HOME to C:\.
18220
18221 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18222
18223 * keyboard.c (Qdelayed_warnings_hook): Define.
18224 (command_loop_1): Run `delayed-warnings-hook'
18225 if Vdelayed_warnings_list is non-nil.
18226 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
18227 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
18228
18229 2011-04-28 Eli Zaretskii <eliz@gnu.org>
18230
18231 * doprnt.c (doprnt): Don't return value smaller than the buffer
18232 size if the message was truncated. (Bug#8545).
18233
18234 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18235
18236 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
18237 (Fx_window_property): #if-0 the whole functions, not just the bodies.
18238
18239 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18240
18241 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
18242
18243 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
18244
18245 * makefile.w32-in: Update dependencies.
18246
18247 2011-04-27 Eli Zaretskii <eliz@gnu.org>
18248
18249 Improve `doprnt' and its usage. (Bug#8545)
18250 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
18251 `format_end'. Remove support for %l as a conversion specifier.
18252 Don't use xrealloc. Improve diagnostics when the %l size modifier
18253 is used. Update the commentary.
18254
18255 * eval.c (verror): Simplify calculation of size_t.
18256
18257 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
18258 messages.
18259
18260 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
18261
18262 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
18263 change.
18264
18265 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18266
18267 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
18268 This makes this file independent of the recent pseudovector change.
18269
18270 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
18271
18272 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
18273
18274 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
18275 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
18276 Remove unused local.
18277 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
18278
18279 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
18280 GCC 4.6.0 optimizes based on type-based alias analysis.
18281 For example, if b is of type struct buffer * and v of type struct
18282 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
18283 != &v->size, and therefore "v->size = 1; b->size = 2; return
18284 v->size;" must therefore return 1. This assumption is incorrect
18285 for Emacs, since it type-puns struct Lisp_Vector * with many other
18286 types. To fix this problem, this patch adds a new type struct
18287 vectorlike_header that documents the constraints on layout of vectors
18288 and pseudovectors, and helps optimizing compilers not get fooled
18289 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
18290 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
18291 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
18292 the size member.
18293 (XSETPVECTYPE): Rewrite in terms of new macro.
18294 (XSETPVECTYPESIZE): New macro, specifying both type and size.
18295 This is a bit clearer, and further avoids the possibility of
18296 undesirable aliasing.
18297 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
18298 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
18299 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
18300 since Lisp_Subr is a special case (no "next" field).
18301 (ASIZE): Now uses header.size rather than size.
18302 All previous uses of XVECTOR (foo)->size replaced to use this macro,
18303 to avoid the hassle of writing XVECTOR (foo)->header.size.
18304 (struct vectorlike_header): New type.
18305 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
18306 object, to help avoid aliasing.
18307 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
18308 (SUBRP): Likewise, since Lisp_Subr is a special case.
18309 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
18310 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
18311 (struct Lisp_Hash_Table): Combine first two members into a single
18312 struct vectorlike_header member. All uses of "size" and "next" members
18313 changed to be "header.size" and "header.next".
18314 * buffer.h (struct buffer): Likewise.
18315 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
18316 * frame.h (struct frame): Likewise.
18317 * process.h (struct Lisp_Process): Likewise.
18318 * termhooks.h (struct terminal): Likewise.
18319 * window.c (struct save_window_data, struct saved_window): Likewise.
18320 * window.h (struct window): Likewise.
18321 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
18322 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
18323 * buffer.c (init_buffer_once): Likewise.
18324 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
18325 special case.
18326 * process.c (Fformat_network_address): Use local var for size,
18327 for brevity.
18328
18329 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
18330
18331 Make the Lisp reader and string-to-float more consistent (Bug#8525)
18332 * data.c (atof): Remove decl; no longer used or needed.
18333 (digit_to_number): Move to lread.c.
18334 (Fstring_to_number): Use new string_to_number function, to be
18335 consistent with how the Lisp reader treats infinities and NaNs.
18336 Do not assume that floating-point numbers represent EMACS_INT
18337 without losing information; this is not true on most 64-bit hosts.
18338 Avoid double-rounding errors, by insisting on integers when
18339 parsing non-base-10 numbers, as the documentation specifies.
18340 * lisp.h (string_to_number): New decl, replacing ...
18341 (isfloat_string): Remove.
18342 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
18343 (read1): Do not accept +. and -. as integers; this
18344 appears to have been a coding error. Similarly, do not accept
18345 strings like +-1e0 as floating point numbers. Do not report
18346 overflow for integer overflows unless the base is not 10 which
18347 means we have no simple and reliable way to continue.
18348 Break out the floating-point parsing into a new
18349 function string_to_number, so that Fstring_to_number parses
18350 floating point numbers consistently with the Lisp reader.
18351 (digit_to_number): Move here from data.c. Make it static inline.
18352 (E_CHAR, EXP_INT): Remove, replacing with ...
18353 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
18354 (string_to_number): New function, replacing isfloat_string.
18355 This function checks for valid syntax and produces the resulting
18356 Lisp float number too. Rework it so that string-to-number
18357 no longer mishandles examples like "1.0e+". Use strtoumax,
18358 so that overflow for non-base-10 numbers is reported only when
18359 there's no portable and simple way to convert to floating point.
18360
18361 * textprop.c (set_text_properties_1): Rewrite for clarity,
18362 and to avoid GCC warning about integer overflow.
18363
18364 * intervals.h (struct interval): Use EMACS_INT for members
18365 where EMACS_UINT might cause problems. See
18366 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
18367 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
18368 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
18369 All uses changed.
18370 (offset_intervals): Tell GCC not to worry about length overflow
18371 when negating a negative length.
18372
18373 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
18374 (overrun_check_free): Likewise.
18375
18376 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
18377 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
18378 word size.
18379
18380 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18381 (gnutls_make_error): Rename local to avoid shadowing.
18382 (gnutls_emacs_global_deinit): ifdef out; not used.
18383 (Fgnutls_boot): Use const for pointer to readonly storage.
18384 Comment out unused local. Fix pointer signedness problems.
18385
18386 * lread.c (openp): Don't stuff size_t into an 'int'.
18387 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
18388 about possible signed overflow.
18389
18390 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18391 (GDK_KEY_g): Don't define if already defined.
18392 (xg_prepare_tooltip): Avoid pointer signedness problem.
18393 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18394
18395 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18396 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18397
18398 * xfns.c (Fx_window_property): Simplify a bit,
18399 to make a bit faster and to avoid GCC 4.6.0 warning.
18400 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18401
18402 * fns.c (internal_equal): Don't assume size_t fits in int.
18403
18404 * alloc.c (compact_small_strings): Tighten assertion a little.
18405
18406 Replace pEd with more-general pI, and fix some printf arg casts.
18407 * lisp.h (pI): New macro, generalizing old pEd macro to other
18408 conversion specifiers. For example, use "...%"pI"d..." rather
18409 than "...%"pEd"...".
18410 (pEd): Remove. All uses replaced with similar uses of pI.
18411 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
18412 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18413 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18414 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18415 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18416 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18417 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18418 64-bit hosts.
18419 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18420 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18421 * print.c (safe_debug_print, print_object): Likewise.
18422 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18423 to int.
18424 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18425 avoiding the 0 flag, which is not portable.
18426 * process.c (Fmake_network_process): Use pI to avoid cast.
18427 * region-cache.c (pp_cache): Likewise.
18428 * xdisp.c (decode_mode_spec): Likewise.
18429 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18430 behavior on 64-bit hosts with printf arg.
18431 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
18432 (x_stop_queuing_selection_requests): Likewise.
18433 (x_get_window_property): Don't truncate byte count to an 'int'
18434 when tracing.
18435
18436 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18437 here, since it parses constructs like leading '-' and spaces,
18438 which are not wanted; and it overflows with large numbers.
18439 Instead, simply match F[0-9]+, which is what is wanted anyway.
18440
18441 * alloc.c: Remove unportable assumptions about struct layout.
18442 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18443 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18444 (allocate_vectorlike, make_pure_vector): Use the new macros,
18445 plus offsetof, to remove unportable assumptions about struct layout.
18446 These assumptions hold on all porting targets that I know of, but
18447 they are not guaranteed, they're easy to remove, and removing them
18448 makes further changes easier.
18449
18450 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18451 This doesn't fix a bug but makes the code clearer.
18452 (string_overrun_cookie): Now const. Use initializers that
18453 don't formally overflow signed char, to avoid warnings.
18454 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18455 can cause Emacs to crash when string overrun checking is enabled.
18456 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18457 multiple of sizeof (EMACS_INT); it need not be, if
18458 alignof(EMACS_INT) < sizeof (EMACS_INT).
18459 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
18460
18461 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
18462
18463 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18464
18465 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18466
18467 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
18468 supposed to be handshaking. (Bug#8556)
18469 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18470
18471 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
18472
18473 * lisp.h (Qdebug): List symbol.
18474 * eval.c (Qdebug): Restore global linkage.
18475 * keyboard.c (debug-on-event): New variable.
18476 (handle_user_signal): Break into debugger when debug-on-event
18477 matches the current signal symbol.
18478
18479 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18480
18481 * alloc.c (check_sblock, check_string_bytes)
18482 (check_string_free_list): Convert to standard C.
18483
18484 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18485
18486 * w32.c (emacs_gnutls_push): Fix typo.
18487
18488 2011-04-25 Eli Zaretskii <eliz@gnu.org>
18489
18490 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18491 "cast to pointer from integer of different size".
18492
18493 Improve doprnt and its use in verror. (Bug#8545)
18494 * doprnt.c (doprnt): Document the set of format control sequences
18495 supported by the function. Use SAFE_ALLOCA instead of always
18496 using `alloca'.
18497
18498 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18499 is one byte too soon. Don't use xrealloc; instead xfree and
18500 xmalloc anew.
18501
18502 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18503
18504 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18505 callbacks stage.
18506
18507 * gnutls.c: Renamed global_initialized to
18508 gnutls_global_initialized. Added internals for the
18509 :verify-hostname-error, :verify-error, and :verify-flags
18510 parameters of `gnutls-boot' and documented those parameters in the
18511 docstring. Start callback support.
18512 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18513 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18514 on error. Return error code.
18515 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18516 (emacs_gnutls_read): Likewise.
18517 (Fgnutls_boot): Return handshake error code.
18518 (emacs_gnutls_handle_error): New function.
18519 (wsaerror_to_errno): Likewise.
18520
18521 * w32.h (emacs_gnutls_pull): Add prototype.
18522 (emacs_gnutls_push): Likewise.
18523
18524 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18525 (emacs_gnutls_push): Likewise.
18526
18527 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18528
18529 * process.c (wait_reading_process_output): Check if GnuTLS
18530 buffered some data internally if no FDs are set for TLS
18531 connections.
18532
18533 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18534 (LIBS): Link to USER_LIBS.
18535 ($(BLD)/gnutls.$(0)): New target.
18536
18537 2011-04-24 Eli Zaretskii <eliz@gnu.org>
18538
18539 * xdisp.c (handle_single_display_spec): Rename the
18540 display_replaced_before_p argument into display_replaced_p, to
18541 make it consistent with the commentary. Fix typos in the
18542 commentary.
18543
18544 * textprop.c (syms_of_textprop): Remove dead code.
18545 (copy_text_properties): Delete obsolete commentary about an
18546 interface that was deleted long ago. Fix typos in the description
18547 of arguments.
18548
18549 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18550 to changes in oldXMenu/XMenu.h from 2011-04-16.
18551 <menu_help_message, prev_menu_help_message>: Constify.
18552 (IT_menu_make_room): menu->help_text is now `const char **';
18553 adjust.
18554
18555 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18556 to changes in oldXMenu/XMenu.h from 2011-04-16.
18557 (struct XMenu): Declare `help_text' `const char **'.
18558
18559 * xfaces.c <Qunspecified>: Make extern again.
18560
18561 * syntax.c: Include sys/types.h before including regex.h, as
18562 required by POSIX.
18563
18564 * doc.c (get_doc_string): Improve the format passed to `error'.
18565
18566 * doprnt.c (doprnt): Improve commentary.
18567
18568 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18569
18570 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18571 them with etags.
18572
18573 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18574 changes in globals.h immediately force recompilation.
18575 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18576 $(CURDIR)/s/ms-w32.h.
18577 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
18578
18579 * character.c (Fchar_direction): Function deleted.
18580 (syms_of_character): Don't defsubr it.
18581 <char-direction-table>: Deleted.
18582
18583 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18584
18585 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18586 * doprnt.c: Include limits.h.
18587 (SIZE_MAX): New macro.
18588 (doprnt): Return a size_t value. 2nd arg is now size_t.
18589 Many local variables are now size_t instead of int or unsigned.
18590 Improve overflow protection. Support `l' modifier for integer
18591 conversions. Support %l conversion. Don't assume an EMACS_INT
18592 argument for integer conversions and for %c.
18593
18594 * lisp.h (doprnt): Restore prototype.
18595
18596 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18597 $(SRC)/character.h.
18598
18599 * Makefile.in (base_obj): Add back doprnt.o.
18600
18601 * deps.mk (doprnt.o): Add back prerequisites.
18602 (callint.o): Depend on character.h.
18603
18604 * eval.c (internal_lisp_condition_case): Include the handler
18605 representation in the error message.
18606 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18607 when breaking from the loop.
18608
18609 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18610
18611 * callint.c (Fcall_interactively): When displaying error message
18612 about invalid control letter, pass the character's codepoint, not
18613 a pointer to its multibyte form. Improve display of the character
18614 in octal and display also its hex code.
18615
18616 * character.c (char_string): Use %x to display the (unsigned)
18617 codepoint of an invalid character, to avoid displaying a bogus
18618 negative value.
18619
18620 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18621 `error', not SYMBOL_NAME itself.
18622
18623 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18624 character arguments to `error'.
18625
18626 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18627 to `error' in error message about FINAL_CHAR argument. Make sure
18628 FINAL_CHAR is a character, and use %c when it is passed as
18629 argument to `error'.
18630
18631 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18632
18633 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18634
18635 * w32.c: Include <time.h>.
18636 (sys_localtime): New function.
18637
18638 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
18639
18640 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18641
18642 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
18643
18644 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
18645
18646 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18647 zombies (Bug#8467).
18648
18649 2011-04-19 Eli Zaretskii <eliz@gnu.org>
18650
18651 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18652 gl_state.e_property when gl_state.object is Qt.
18653
18654 * insdel.c (make_gap_larger): Remove limitation of buffer size
18655 to <= INT_MAX.
18656
18657 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
18658
18659 * xdisp.c (lookup_glyphless_char_display)
18660 (produce_glyphless_glyph): Handle cons cell entry in
18661 glyphless-char-display.
18662 (Vglyphless_char_display): Document it.
18663
18664 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18665 glyphless-char-display.
18666
18667 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
18668
18669 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18670
18671 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18672
18673 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18674 definition for no-X builds.
18675
18676 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
18677
18678 Static checks with GCC 4.6.0 and non-default toolkits.
18679
18680 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18681
18682 * process.c (keyboard_bit_set): Define only if SIGIO.
18683 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18684 (send_process): Repair possible setjmp clobbering.
18685
18686 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18687
18688 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18689
18690 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18691
18692 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18693 Define only if needed.
18694
18695 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18696 by pacifying GCC about it. Maybe it's time to retire it?
18697 * xfaces.c (USG, __TIMEVAL__): Likewise.
18698
18699 * dispextern.h (struct redisplay_interface): Rename param
18700 to avoid shadowing.
18701 * termhooks.h (struct terminal): Likewise.
18702 * xterm.c (xembed_send_message): Likewise.
18703
18704 * insdel.c (make_gap_smaller): Define only if
18705 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18706
18707 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18708 it.
18709
18710 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18711 so that we aren't warned about unused symbols.
18712
18713 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18714
18715 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18716
18717 * xfns.c (x_real_positions): Mark locals as initialized.
18718
18719 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18720
18721 * xterm.c: Fix problems found by static analysis with other toolkits.
18722 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18723 (x_dispatch_event): Declare static if USE_GTK, and
18724 define if USE_GTK || USE_X_TOOLKIT.
18725 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18726 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18727 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18728 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18729
18730 * xmenu.c (menu_help_callback): Pointer type fixes.
18731 Use const pointers when pointing at readonly data. Avoid pointer
18732 signedness clashes.
18733 (FALSE): Remove unused macro.
18734 (update_frame_menubar): Remove unused decl.
18735
18736 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18737
18738 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18739 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18740 (single_menu_item): Rename local to avoid shadowing.
18741
18742 * keyboard.c (make_lispy_event): Remove unused local var.
18743
18744 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18745 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18746
18747 * bitmaps: Change bitmaps from unsigned char back to the X11
18748 compatible char. Avoid the old compiler warnings about
18749 out-of-range initializers by using, for example, '\xab' rather
18750 than 0xab.
18751
18752 * xgselect.c (xgselect_initialize): Check vs interface
18753 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18754
18755 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18756
18757 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18758 to read-only memory.
18759
18760 * fns.c (vector): Remove; this old hack is no longer needed.
18761
18762 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18763 Remove unused var.
18764 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18765
18766 * xrdb.c (x_load_resources): Omit unused local.
18767
18768 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18769 (x_window): Rename locals to avoid shadowing.
18770 (USG): Use the kludged USG macro, to pacify gcc.
18771
18772 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18773 (x_term_init): Remove local to avoid shadowing.
18774
18775 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18776
18777 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18778 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18779
18780 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18781
18782 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18783
18784 Fix regex.c, syntax.c and friends for buffers > 2GB.
18785 * syntax.h (struct gl_state_s): Declare character position members
18786 EMACS_INT.
18787
18788 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18789
18790 * textprop.c (verify_interval_modification, interval_of):
18791 Declare arguments EMACS_INT.
18792
18793 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18794 EMACS_INT.
18795
18796 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18797
18798 * indent.c (Fvertical_motion): Local variable it_start is now
18799 EMACS_INT.
18800
18801 * regex.c (re_match, re_match_2, re_match_2_internal)
18802 (bcmp_translate, regcomp, regexec, print_double_string)
18803 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18804 (re_compile_pattern, re_exec): Declare arguments and local
18805 variables `size_t' and `ssize_t' and return values `regoff_t', as
18806 appropriate.
18807 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18808 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18809 <compile_stack_type>: `size' and `avail' are now `size_t'.
18810
18811 * regex.h <regoff_t>: Use ssize_t, not int.
18812 (re_search, re_search_2, re_match, re_match_2): Arguments that
18813 specify buffer/string position and length are now ssize_t and
18814 size_t. Return type is regoff_t.
18815
18816 2011-04-16 Ben Key <bkey76@gmail.com>
18817
18818 * nsfont.m: Fixed bugs in ns_get_family and
18819 ns_descriptor_to_entity that were caused by using free to
18820 deallocate memory blocks that were allocated by xmalloc (via
18821 xstrdup). This caused Emacs to crash when compiled with
18822 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18823 --enable-checking=xmallocoverrun). xfree is now used to
18824 deallocate these memory blocks.
18825
18826 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18827
18828 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18829
18830 emacs_write: Accept and return EMACS_INT for sizes.
18831 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18832 et seq.
18833 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18834 Accept and return EMACS_INT.
18835 (emacs_gnutls_write): Return the number of bytes written on
18836 partial writes.
18837 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18838 (emacs_read, emacs_write): Remove check for negative size, as the
18839 Emacs source code has been audited now.
18840 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18841 (emacs_read, emacs_write): Use it.
18842 * process.c (send_process): Adjust to the new signatures of
18843 emacs_write and emacs_gnutls_write. Do not attempt to store
18844 a byte offset into an 'int'; it might overflow.
18845 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18846
18847 * sound.c: Don't assume sizes fit in 'int'.
18848 (struct sound_device.period_size, alsa_period_size):
18849 Return EMACS_INT, not int.
18850 (struct sound_device.write, vox_write, alsa_write):
18851 Accept EMACS_INT, not int.
18852 (wav_play, au_play): Use EMACS_INT to store sizes and to
18853 record read return values.
18854
18855 2011-04-15 Ben Key <bkey76@gmail.com>
18856
18857 * keyboard.c (Qundefined): Don't declare static since it is used
18858 in nsfns.m.
18859 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18860 static since they are used in nsfont.m.
18861
18862 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18863
18864 * process.c (Qprocessp): Don't declare static.
18865 * lisp.h (Qprocessp): Declare again.
18866
18867 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18868
18869 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18870
18871 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18872
18873 Improve C-level modularity by making more things 'static'.
18874
18875 Don't publish debugger-only interfaces to other modules.
18876 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18877 (verify_bytepos, count_markers): Move decls to the only modules
18878 that need them.
18879 * region-cache.h (pp_cache): Likewise.
18880 * window.h (check_all_windows): Likewise.
18881 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18882
18883 * sysdep.c (croak): Now static, if
18884 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18885 * syssignal.h (croak): Declare only if not static.
18886
18887 * alloc.c (refill_memory_reserve): Now static if
18888 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18889 * lisp.h (refill_memory_reserve): Declare only if not static.
18890
18891 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18892 Define only if USE_LUCID.
18893
18894 * xrdb.c (x_customization_string, x_rm_string): Now static.
18895
18896 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18897 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18898
18899 * xdisp.c (draw_row_with_mouse_face): Now static.
18900 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18901
18902 * window.h (check_all_windows): Mark externally visible.
18903
18904 * window.c (window_deletion_count): Now static.
18905
18906 * undo.c: Make symbols static if they're not exported.
18907 (last_undo_buffer, last_boundary_position, pending_boundary):
18908 Now static.
18909
18910 * textprop.c (interval_insert_behind_hooks): Now static.
18911 (interval_insert_in_front_hooks): Likewise.
18912
18913 * term.c: Make symbols static if they're not exported.
18914 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18915 (max_frame_lines, tty_set_terminal_modes):
18916 (tty_reset_terminal_modes, tty_turn_off_highlight):
18917 (get_tty_terminal): Now static.
18918 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18919 * termhooks.h (term_mouse_moveto): Do not declare if
18920 HAVE_WINDOW_SYSTEM.
18921 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18922 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18923
18924 * sysdep.c: Make symbols static if they're not exported.
18925 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18926 Now static.
18927 (sigprocmask_set, full_mask): Remove; unused.
18928 (wait_debugging): Mark as visible.
18929 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18930 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18931
18932 * syntax.c (syntax_temp): Define only if !__GNUC__.
18933
18934 * sound.c (current_sound_device, current_sound): Now static.
18935
18936 * search.c (searchbufs, searchbuf_head): Now static.
18937
18938 * scroll.c (scroll_cost): Remove; unused.
18939 * dispextern.h (scroll_cost): Remove decl.
18940
18941 * region-cache.h (pp_cache): Mark as externally visible.
18942
18943 * process.c: Make symbols static if they're not exported.
18944 (process_tick, update_tick, create_process, chan_process):
18945 (Vprocess_alist, proc_buffered_char, datagram_access):
18946 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18947 (deactivate_process): Mark defn as static, as well as decl.
18948 * lisp.h (create_process): Remove decl.
18949 * process.h (chan_process, Vprocess_alist): Remove decls.
18950
18951 * print.c: Make symbols static if they're not exported.
18952 (print_depth, new_backquote_output, being_printed, print_buffer):
18953 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18954 (print_interval, print_number_index, initial_stderr_stream):
18955 Now static.
18956 * lisp.h (Fprinc): Remove decl.
18957 (debug_output_compilation_hack): Mark as externally visible.
18958
18959 * sysdep.c (croak): Move decl from here to syssignal.h.
18960 * syssignal.h (croak): Put it here, so the API can be checked when
18961 'croak' is called from dissociate_if_controlling_tty.
18962
18963 * minibuf.c: Make symbols static if they're not exported.
18964 (minibuf_save_list, choose_minibuf_frame): Now static.
18965 * lisp.h (choose_minibuf_frame): Remove decl.
18966
18967 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18968
18969 * lread.c: Make symbols static if they're not exported.
18970 (read_objects, initial_obarray, oblookup_last_bucket_number):
18971 Now static.
18972 (make_symbol): Remove; unused.
18973 * lisp.h (initial_obarray, make_symbol): Remove decls.
18974
18975 * keyboard.c: Make symbols static if they're not exported.
18976 (single_kboard, recent_keys_index, total_keys, recent_keys):
18977 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18978 (this_single_command_key_start, echoing, last_auto_save):
18979 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18980 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18981 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18982 (Vlispy_mouse_stem, double_click_count):
18983 Now static.
18984 (force_auto_save_soon): Define only if SIGDANGER.
18985 (ignore_mouse_drag_p): Now static if
18986 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18987 (print_help): Remove; unused.
18988 (stop_character, last_timer_event): Mark as externally visible.
18989 * keyboard.h (ignore_mouse_drag_p): Declare only if
18990 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18991 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18992 * lisp.h (echoing): Remove decl.
18993 (force_auto_save_soon): Declare only if SIGDANGER.
18994 * xdisp.c (redisplay_window): Simplify code, to make it more
18995 obvious that ignore_mouse_drag_p is not accessed if !defined
18996 USE_GTK && !defined HAVE_NS.
18997
18998 * intervals.c: Make symbols static if they're not exported.
18999 (merge_properties_sticky, merge_interval_right, delete_interval):
19000 Now static.
19001 * intervals.h (merge_interval_right, delete_interval): Remove decls.
19002
19003 * insdel.c: Make symbols static if they're not exported.
19004 However, leave prepare_to_modify_buffer alone. It's never
19005 called from outside this function, but that appears to be a bug.
19006 (combine_after_change_list, combine_after_change_buffer):
19007 (adjust_after_replace, signal_before_change): Now static.
19008 (adjust_after_replace_noundo): Remove; unused.
19009 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
19010 (signal_before_change): Remove decls.
19011
19012 * indent.c (val_compute_motion, val_vmotion): Now static.
19013
19014 * image.c: Make symbols static if they're not exported.
19015 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
19016 if USE_GTK.
19017 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
19018 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
19019
19020 * fringe.c (standard_bitmaps): Now static.
19021 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
19022
19023 * frame.c: Make symbols static if they're not exported.
19024 (x_report_frame_params, make_terminal_frame): Now static.
19025 (get_frame_param): Now static, unless HAVE_NS.
19026 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
19027 (x_get_resource_string): Remove; not used.
19028 * frame.h (make_terminal_frame, x_report_frame_params):
19029 (x_get_resource_string); Remove decls.
19030 (x_fullscreen_adjust): Declare only if WINDOWSNT.
19031 * lisp.h (get_frame_param): Declare only if HAVE_NS.
19032
19033 * font.c, fontset.c: Make symbols static if they're not exported.
19034 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
19035 (FACE_SUITABLE_FOR_CHAR_P): Use it.
19036 * font.c (font_close_object): Now static.
19037 * font.h (font_close_object): Remove.
19038 * fontset.c (FONTSET_OBJLIST): Remove.
19039 (free_realized_fontset) #if-0 the body, which does nothing.
19040 (face_suitable_for_char_p): #if-0, as it's never called.
19041 * fontset.h (face_suitable_for_char_p): Remove decl.
19042 * xfaces.c (face_at_string_position):
19043 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
19044 since 0 is always ASCII.
19045
19046 * fns.c (weak_hash_tables): Now static.
19047
19048 * fileio.c: Make symbols static if they're not exported.
19049 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
19050 (Vwrite_region_annotation_buffers): Now static.
19051
19052 * eval.c: Make symbols static if they're not exported.
19053 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
19054 * lisp.h (backtrace_list): Remove decl.
19055
19056 * emacs.c: Make symbols static if they're not exported.
19057 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
19058 (fatal_error_code, fatal_error_signal_hook, standard_args):
19059 Now static.
19060 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
19061 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
19062 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
19063 * lisp.h (fatal_error_signal_hook): Remove decl.
19064 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
19065
19066 * editfns.c: Move a (normally-unused) function to its only use.
19067 * editfns.c, lisp.h (get_operating_system_release): Remove.
19068 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
19069 worth the hassle of breaking this out.
19070
19071 * xterm.c: Make symbols static if they're not exported.
19072 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
19073 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
19074 (x_destroy_window, x_delete_display):
19075 Now static.
19076 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
19077 (x_mouse_leave): Remove; unused.
19078 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
19079 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
19080 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
19081 Remove decls.
19082 (x_mouse_leave): Declare only if WINDOWSNT.
19083 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
19084 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
19085 USE_X_TOOLKIT.
19086
19087 * ftxfont.c: Make symbols static if they're not exported.
19088 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
19089 HAVE_FREETYPE.
19090 * font.h (ftxfont_driver): Likewise.
19091
19092 * xfns.c: Make symbols static if they're not exported.
19093 (x_last_font_name, x_display_info_for_name):
19094 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
19095 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
19096 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
19097 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
19098 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
19099 (last_show_tip_args): Now static.
19100 (xic_defaut_fontset, xic_create_fontsetname): Define only if
19101 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
19102 (x_screen_planes): Remove; unused.
19103 * dispextern.h (x_screen_planes): Remove decl.
19104
19105 * dispnew.c: Make symbols static if they're not exported.
19106 * dispextern.h (redraw_garbaged_frames, scrolling):
19107 (increment_row_positions): Remove.
19108 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
19109 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
19110 Now static.
19111 (redraw_garbaged_frames): Remove; unused.
19112
19113 * xfaces.c: Make symbols static if they're not exported.
19114 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
19115 Remove decls.
19116 * xterm.h (defined_color): Remove decls.
19117 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
19118 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
19119 (menu_face_changed_default, defined_color, free_realized_face):
19120 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
19121 (ascii_face_of_lisp_face): Remove; unused.
19122
19123 * xdisp.c: Make symbols static if they're not exported.
19124 * dispextern.h (scratch_glyph_row, window_box_edges):
19125 (glyph_to_pixel_coords, set_cursor_from_row):
19126 (get_next_display_element, set_iterator_to_next):
19127 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
19128 (show_mouse_face): Remove decls
19129 * frame.h (message_buf_print): Likewise.
19130 * lisp.h (pop_message, set_message, check_point_in_composition):
19131 Likewise.
19132 * xterm.h (set_vertical_scroll_bar): Likewise.
19133 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
19134 (message_buf_print, scratch_glyph_row, displayed_buffer):
19135 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
19136 (get_next_display_element, show_mouse_face, window_box_edges):
19137 (frame_to_window_pixel_xy, check_point_in_composition):
19138 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
19139 (glyph_to_pixel_coords): Remove; unused.
19140
19141 * dired.c (file_name_completion): Now static.
19142
19143 * dbusbind.c (xd_in_read_queued_messages): Now static.
19144
19145 * lisp.h (circular_list_error, FOREACH): Remove; unused.
19146 * data.c (circular_list_error): Remove.
19147
19148 * commands.h (last_point_position, last_point_position_buffer):
19149 (last_point_position_window): Remove decls.
19150 * keyboard.c: Make these variables static.
19151
19152 * coding.h (coding, code_convert_region, encode_coding_gap):
19153 Remove decls.
19154 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
19155 (iso_code_class, detect_coding, code_convert_region): Now static.
19156 (encode_coding_gap): Remove; unused.
19157
19158 * chartab.c (chartab_chars, chartab_bits): Now static.
19159
19160 * charset.h (charset_iso_8859_1): Remove decl.
19161 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
19162 Now static.
19163
19164 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
19165 * ccl.c (Vccl_program_table): Now static.
19166 (check_ccl_update): Remove; unused.
19167
19168 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
19169 * category.h: ... from here.
19170 * category.c (check_category_table, set_category_set): Now static.
19171
19172 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
19173 * lisp.h: Remove these decls.
19174
19175 * buffer.c (buffer_count): Remove unused var.
19176
19177 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
19178 so that it's not optimized away.
19179 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
19180 * dispextern.h (bidi_dump_cached_states): Remove, since it's
19181 exported only to the debugger.
19182
19183 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
19184 * atimer.h (run_all_atimers): Remove; not exported.
19185
19186 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
19187 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
19188 was inaccessible from Lisp.
19189 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
19190 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
19191
19192 alloc.c: Import and export fewer symbols, and remove unused items.
19193 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
19194 is defined.
19195 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
19196 it's not optimized away by whole-program optimization.
19197 (message_enable_multibyte, free_misc): Remove.
19198 (catchlist, handlerlist, mark_backtrace):
19199 Declare only if BYTE_MARK_STACK.
19200 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
19201 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
19202 (message_enable_multibyte): Remove decl.
19203 (free_misc, interval_free_list, float_block, float_block_index):
19204 (n_float_blocks, float_free_list, cons_block, cons_block_index):
19205 (cons_free_list, last_marked_index):
19206 Now static.
19207 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
19208 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
19209 (mark_backtrace): Define only if BYTE_MARK_STACK.
19210 * xdisp.c (message_enable_multibyte): Now static.
19211
19212 Declare Lisp_Object Q* variables to be 'static' if not exported.
19213 This makes it easier for human readers (and static analyzers)
19214 to see whether these variables are used from other modules.
19215 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
19216 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
19217 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
19218 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
19219 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
19220 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
19221 * xmenu.c, xselect.c:
19222 Declare Q* vars static if they are not used in other modules.
19223 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
19224 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
19225 Remove decls of unexported vars.
19226 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
19227
19228 * lisp.h (DEFINE_FUNC): Make sname 'static'.
19229
19230 Make Emacs functions such as Fatom 'static' by default.
19231 This makes it easier for human readers (and static analyzers)
19232 to see whether these functions can be called from other modules.
19233 DEFUN now defines a static function. To make the function external
19234 so that it can be used in other C modules, use the new macro DEFUE.
19235 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
19236 (Finit_image_library):
19237 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
19238 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
19239 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
19240 Remove decls, since these functions are now static.
19241 (Funintern, Fget_internal_run_time): New decls, since these functions
19242 were already external.
19243
19244 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
19245 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
19246 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
19247 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
19248 * keyboard.c, keymap.c, lread.c:
19249 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
19250 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
19251 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
19252 Mark functions with DEFUE instead of DEFUN,
19253 if they are used in other modules.
19254 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
19255 decls for now-static functions.
19256 * buffer.h (Fdelete_overlay): Remove decl.
19257 * callproc.c (Fgetenv_internal): Mark as internal.
19258 * composite.c (Fremove_list_of_text_properties): Remove decl.
19259 (Fcomposition_get_gstring): New forward static decl.
19260 * composite.h (Fcomposite_get_gstring): Remove decl.
19261 * dired.c (Ffile_attributes): New forward static decl.
19262 * doc.c (Fdocumntation_property): New forward static decl.
19263 * eval.c (Ffetch_bytecode): New forward static decl.
19264 (Funintern): Remove extern decl; now in .h file where it belongs.
19265 * fileio.c (Fmake_symbolic_link): New forward static decl.
19266 * image.c (Finit_image_library): New forward static decl.
19267 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
19268 * intervals.h (Fprevious_property_change):
19269 (Fremove_list_of_text_properties): Remove decls.
19270 * keyboard.c (Fthis_command_keys): Remove decl.
19271 (Fcommand_execute): New forward static decl.
19272 * keymap.c (Flookup_key): New forward static decl.
19273 (Fcopy_keymap): Now static.
19274 * keymap.h (Flookup_key): Remove decl.
19275 * process.c (Fget_process): New forward static decl.
19276 (Fprocess_datagram_address): Mark as internal.
19277 * syntax.c (Fsyntax_table_p): New forward static decl.
19278 (skip_chars): Remove duplicate decl.
19279 * textprop.c (Fprevious_property_change): New forward static decl.
19280 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
19281 Now internal.
19282 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
19283 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
19284
19285 * editfns.c (Fformat): Remove unreachable code.
19286
19287 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
19288
19289 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
19290 change. (Bug#8496)
19291
19292 2011-04-13 Eli Zaretskii <eliz@gnu.org>
19293
19294 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
19295 when at ZV. (Bug#8487)
19296
19297 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
19298
19299 * charset.c (Fclear_charset_maps): Use xfree instead of free.
19300 (Bug#8437)
19301 * keyboard.c (parse_tool_bar_item): Likewise.
19302 * sound.c (sound_cleanup, alsa_close): Likewise.
19303 * termcap.c (tgetent): Likewise.
19304 * xfns.c (x_default_font_parameter): Likewise.
19305 * xsettings.c (read_and_apply_settings): Likewise.
19306
19307 * alloc.c (overrun_check_malloc, overrun_check_realloc)
19308 (overrun_check_free): Protoize.
19309
19310 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
19311
19312 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
19313 since callers should never pass a negative size.
19314 Change the signature to match that of plain 'read' and 'write'; see
19315 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
19316 * lisp.h: Update prototypes of emacs_write and emacs_read.
19317
19318 2011-04-11 Eli Zaretskii <eliz@gnu.org>
19319
19320 * xdisp.c (redisplay_window): Don't try to determine the character
19321 position of the scroll margin if the window start point w->startp
19322 is outside the buffer's accessible region. (Bug#8468)
19323
19324 2011-04-10 Eli Zaretskii <eliz@gnu.org>
19325
19326 Fix write-region and its subroutines for buffers > 2GB.
19327 * fileio.c (a_write, e_write): Modify declaration of arguments and
19328 local variables to support buffers larger than 2GB.
19329 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
19330
19331 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
19332 argument, local variables, and return value.
19333
19334 * lisp.h: Update prototypes of emacs_write and emacs_read.
19335
19336 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
19337
19338 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
19339
19340 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
19341
19342 Fix more problems found by GCC 4.6.0's static checks.
19343
19344 * xdisp.c (vmessage): Use a better test for character truncation.
19345
19346 * charset.c (load_charset_map): <, not <=, for optimization,
19347 and to avoid potential problems with integer overflow.
19348 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
19349 * casetab.c (set_identity, shuffle): Likewise.
19350 * editfns.c (Fformat): Likewise.
19351 * syntax.c (skip_chars): Likewise.
19352
19353 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
19354 This also lets GCC 4.6.0 generate slightly better loop code.
19355
19356 * callint.c (Fcall_interactively): <, not <=, for optimization.
19357 (Fcall_interactively): Count the number of arguments produced,
19358 not the number of arguments given. This is simpler and lets GCC
19359 4.6.0 generate slightly better code.
19360
19361 * ftfont.c: Distingish more carefully between FcChar8 and char.
19362 The previous code passed unsigned char * to a functions like
19363 strlen and xstrcasecmp that expect char *, which does not
19364 conform to the C standard.
19365 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
19366 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
19367 char * when the C standard requires it.
19368
19369 * keyboard.c (read_char): Remove unused var.
19370
19371 * eval.c: Port to Windows vsnprintf (Bug#8435).
19372 Include <limits.h>.
19373 (SIZE_MAX): Define if the headers do not.
19374 (verror): Do not give up if vsnprintf returns a negative count.
19375 Instead, grow the buffer. This ports to Windows vsnprintf, which
19376 does not conform to C99. Problem reported by Eli Zaretskii.
19377 Also, simplify the allocation scheme, by avoiding the need for
19378 calling realloc, and removing the ALLOCATED variable.
19379
19380 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
19381
19382 Remove invocations of doprnt, as Emacs now uses vsnprintf.
19383 But keep the doprint source code for now, as we might revamp it
19384 and use it again (Bug#8435).
19385 * lisp.h (doprnt): Remove.
19386 * Makefile.in (base_obj): Remove doprnt.o.
19387 * deps.mk (doprnt.o): Remove.
19388
19389 error: Print 32- and 64-bit integers portably (Bug#8435).
19390 Without this change, on typical 64-bit hosts error ("...%d...", N)
19391 was used to print both 32- and 64-bit integers N, which relied on
19392 undefined behavior.
19393 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
19394 * lisp.h (error, verror): Mark as printf-like functions.
19395 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19396 Report overflow in size calculations when allocating printf buffer.
19397 Do not truncate output string at its first null byte.
19398 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19399 Truncate the output at a character boundary, since vsnprintf does not
19400 do that.
19401 * charset.c (check_iso_charset_parameter): Convert internal
19402 character to string before calling 'error', since %c now has the
19403 printf meaning.
19404 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19405 overflow when computing char to be passed to 'error'. Do not
19406 pass Lisp_Object to 'error'; pass the integer instead.
19407 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19408 formatted with plain %d.
19409
19410 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19411
19412 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19413
19414 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19415
19416 * xterm.c (x_catch_errors): Remove duplicate declaration.
19417
19418 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19419
19420 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19421
19422 2011-04-10 Jim Meyering <meyering@redhat.com>
19423
19424 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19425 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
19426 return ssize_t not "int", and use size_t as the buffer length.
19427 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19428 * gnutls.h: Update declarations.
19429 * process.c (read_process_output): Use ssize_t, to match.
19430 (send_process): Likewise.
19431
19432 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19433
19434 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19435
19436 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19437
19438 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19439 Use unsigned char, to match FcChar8 type definition.
19440
19441 * xterm.c (handle_one_xevent):
19442 * xmenu.c (create_and_show_popup_menu):
19443 * xselect.c (x_decline_selection_request)
19444 (x_reply_selection_request): Avoid type-punned deref of X events.
19445
19446 2011-04-09 Eli Zaretskii <eliz@gnu.org>
19447
19448 Fix some uses of `int' instead of EMACS_INT.
19449 * search.c (string_match_1, fast_string_match)
19450 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19451 (scan_buffer, find_next_newline_no_quit)
19452 (find_before_next_newline, search_command, Freplace_match)
19453 (Fmatch_data): Make some `int' variables be EMACS_INT.
19454
19455 * xdisp.c (display_count_lines): 3rd argument and return value now
19456 EMACS_INT. All callers changed.
19457 (pint2hrstr): Last argument is now EMACS_INT.
19458
19459 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19460 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19461 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19462 (decode_coding_utf_16, decode_coding_emacs_mule)
19463 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19464 (decode_coding_ccl, decode_coding_charset)
19465 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19466 (decode_coding_iso_2022, decode_coding_emacs_mule)
19467 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19468 <char_offset, last_offset>: Declare EMACS_INT.
19469 (encode_coding_utf_8, encode_coding_utf_16)
19470 (encode_coding_emacs_mule, encode_invocation_designation)
19471 (encode_designation_at_bol, encode_coding_iso_2022)
19472 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19473 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19474 Declare EMACS_INT.
19475 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19476 (encode_invocation_designation): Last argument P_NCHARS is now
19477 EMACS_INT.
19478 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19479 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19480
19481 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19482 All users changed.
19483
19484 * ccl.c (Fccl_execute_on_string): Declare some variables
19485 EMACS_INT.
19486
19487 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
19488
19489 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19490
19491 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19492
19493 * process.c (Fformat_network_address): Doc fix.
19494
19495 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19496
19497 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
19498
19499 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
19500
19501 * keyboard.c (read_char): Call Lisp function help-form-show,
19502 instead of using internal_with_output_to_temp_buffer.
19503 (Qhelp_form_show): New var.
19504 (syms_of_keyboard): Use DEFSYM macro.
19505
19506 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19507
19508 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19509
19510 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
19511
19512 * process.c (Flist_processes): Remove to Lisp.
19513 (list_processes_1): Delete.
19514
19515 2011-04-06 Eli Zaretskii <eliz@gnu.org>
19516
19517 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19518
19519 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19520
19521 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
19522
19523 Fix more problems found by GCC 4.6.0's static checks.
19524
19525 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19526
19527 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19528
19529 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
19530
19531 * xdisp.c (vmessage): Mark as a printf-like function.
19532
19533 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19534
19535 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19536
19537 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19538 printf-like functions.
19539 (tiff_load): Add casts to remove these marks before passing them
19540 to system-supplied API.
19541
19542 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19543
19544 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19545 This avoids several warnings with gcc -Wstrict-overflow.
19546 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19547 directly, rather than having caller test rule sign. This avoids
19548 some unnecessary tests.
19549 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19550 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19551 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
19552
19553 * xfont.c (xfont_text_extents): Remove var that was set but not used.
19554 (xfont_open): Avoid unnecessary tests.
19555
19556 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19557
19558 * composite.h, composite.c (composition_gstring_put_cache):
19559 Use EMACS_INT, not int, for length.
19560
19561 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19562 breaking out part of COMPOSITION_DECODE_RULE.
19563 (COMPOSITION_DECODE_RULE): Use it.
19564 * composite.c (get_composition_id): Remove unused local vars,
19565 by using the new macro.
19566
19567 * textprop.c (set_text_properties_1): Change while to do-while,
19568 since the condition is always true at first.
19569
19570 * intervals.c (graft_intervals_into_buffer): Mark var as used.
19571 (interval_deletion_adjustment): Return unsigned value.
19572 All uses changed.
19573
19574 * process.c (list_processes_1, create_pty, read_process_output):
19575 (exec_sentinel): Remove vars that were set but not used.
19576 (create_pty): Remove unnecessary "volatile"s.
19577 (Fnetwork_interface_info): Avoid possibility of int overflow.
19578 (read_process_output): Do adaptive read buffering even if carryover.
19579 (read_process_output): Simplify nbytes computation if buffered.
19580
19581 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19582
19583 * syntax.c (scan_words): Remove var that was set but not used.
19584 (update_syntax_table): Use unsigned instead of int.
19585
19586 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
19587 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
19588 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
19589
19590 * print.c (print_error_message): Avoid int overflow.
19591
19592 * font.c (font_list_entities): Redo for clarity,
19593 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19594
19595 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
19596 (font_score): Avoid potential overflow in diff calculation.
19597
19598 * fns.c (substring_both): Remove var that is set but not used.
19599 (sxhash): Redo loop for clarity and to avoid wraparound warning.
19600
19601 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19602
19603 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19604 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19605 can always succeed if overflow has undefined behavior.
19606
19607 * search.c (boyer_moore, wordify): Remove vars set but not used.
19608 (wordify): Omit three unnecessary tests.
19609
19610 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19611 All callers changed. This avoids the need for an unused var.
19612
19613 * casefiddle.c (casify_region): Remove var that is set but not used.
19614
19615 * dired.c (file_name_completion): Remove var that is set but not used.
19616
19617 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19618
19619 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
19620 (Finsert_file_contents): Remove unnecessary code checking fd.
19621
19622 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19623 Check for integer overflow on size calculations.
19624
19625 * buffer.c (Fprevious_overlay_change): Remove var that is set
19626 but not used.
19627
19628 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19629 Remove vars that are set but not used.
19630 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
19631 (timer_check_2): Mark vars as initialized.
19632
19633 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19634
19635 * image.c (lookup_image): Remove var that is set but not used.
19636 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
19637
19638 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19639 that are set but not used.
19640
19641 * xfns.c (make_invisible_cursor): Don't return garbage
19642 if XCreateBitmapFromData fails (Bug#8410).
19643
19644 * xselect.c (x_get_local_selection, x_handle_property_notify):
19645 Remove vars that are set but not used.
19646
19647 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19648 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19649
19650 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19651 Remove var that is set but not used.
19652 (scroll_bar_windows_size): Now size_t, not int.
19653 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19654 Check for overflow.
19655
19656 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19657 (map_tty_color) [!defined MSDOS]: Likewise.
19658
19659 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19660
19661 * coding.c: Remove vars that are set but not used.
19662 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19663 All callers changed.
19664 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19665 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19666 (decode_coding_charset): Remove vars that are set but not used.
19667
19668 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19669 that is set but not used.
19670
19671 * print.c (print_object): Remove var that is set but not used.
19672
19673 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19674 The gnulib version avoids calling malloc in the usual case,
19675 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19676 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19677 * filelock.c (current_lock_owner): Likewise.
19678 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19679 * sysdep.c: Include allocator.h, careadlinkat.h.
19680 (emacs_no_realloc_allocator): New static constant.
19681 (emacs_readlink): New function.
19682 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19683 ../lib/careadlinkat.h.
19684
19685 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19686
19687 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19688 first non-nil return value).
19689
19690 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19691
19692 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19693 if not defined (Bug#8403).
19694
19695 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19696
19697 * xdisp.c (display_count_lines): Remove parameter `start',
19698 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19699 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19700 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19701 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19702 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19703 and thereabouts. All callers changed.
19704 (get_per_char_metric): Remove parameter `f', unused since
19705 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19706
19707 2011-04-02 Jim Meyering <meyering@redhat.com>
19708
19709 do not dereference NULL upon failed strdup
19710 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19711 (ns_get_family): Likewise.
19712
19713 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19714
19715 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19716
19717 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19718
19719 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19720 later (Bug#8403).
19721
19722 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19723
19724 Add lexical binding.
19725
19726 * window.c (Ftemp_output_buffer_show): New fun.
19727 (Fsave_window_excursion):
19728 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19729
19730 * lread.c (lisp_file_lexically_bound_p): New function.
19731 (Fload): Bind Qlexical_binding.
19732 (readevalloop): Remove `evalfun' arg.
19733 Bind Qinternal_interpreter_environment.
19734 (Feval_buffer): Bind Qlexical_binding.
19735 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19736 Mark as dynamic.
19737 (syms_of_lread): Declare `lexical-binding'.
19738
19739 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19740
19741 * keyboard.c (eval_dyn): New fun.
19742 (menu_item_eval_property): Use it.
19743
19744 * image.c (parse_image_spec): Use Ffunctionp.
19745
19746 * fns.c (concat, mapcar1): Accept byte-code-functions.
19747
19748 * eval.c (Fsetq): Handle lexical vars.
19749 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19750 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19751 (FletX, Flet): Obey lexical binding.
19752 (Fcommandp): Handle closures.
19753 (Feval): New `lexical' arg.
19754 (eval_sub): New function extracted from Feval. Use it almost
19755 everywhere where Feval was used. Look up vars in lexical env.
19756 Handle closures.
19757 (Ffunctionp): Move from subr.el.
19758 (Ffuncall): Handle closures.
19759 (apply_lambda): Remove `eval_flags'.
19760 (funcall_lambda): Handle closures and new byte-code-functions.
19761 (Fspecial_variable_p): New function.
19762 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19763 but without exporting it to Lisp.
19764
19765 * doc.c (Fdocumentation, store_function_docstring):
19766 * data.c (Finteractive_form): Handle closures.
19767
19768 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19769 interactive spec.
19770
19771 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19772 New byte-codes.
19773 (exec_byte_code): New function extracted from Fbyte_code to handle new
19774 calling convention for byte-code-functions. Add new byte-codes.
19775
19776 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19777
19778 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19779
19780 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19781
19782 * xdisp.c (redisplay_internal): Fix prototype.
19783
19784 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19785
19786 * xdisp.c (SCROLL_LIMIT): New macro.
19787 (try_scrolling): Use it when setting scroll_limit.
19788 Limit scrolling to 100 screen lines.
19789 (redisplay_window): Even when falling back on "recentering",
19790 position point in the window according to scroll-conservatively,
19791 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19792
19793 (try_scrolling): When point is above the window, allow searching
19794 as far as scroll_max, or one screenful, to compute vertical
19795 distance from PT to the scroll margin position. This prevents
19796 try_scrolling from unnecessarily failing when
19797 scroll-conservatively is set to a value slightly larger than the
19798 window height. Clean up the case of PT below the margin at bottom
19799 of window: scroll_max can no longer be INT_MAX. When aggressive
19800 scrolling is in use, don't let point enter the opposite scroll
19801 margin as result of the scroll.
19802 (syms_of_xdisp) <scroll-conservatively>: Document the
19803 threshold of 100 lines for never-recentering scrolling.
19804
19805 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19806
19807 * dispextern.h (move_it_by_lines):
19808 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19809 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19810 (message_log_check_duplicate): Remove parameters `prev_bol' and
19811 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19812 (redisplay_internal): Remove parameter `preserve_echo_area',
19813 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19814
19815 * indent.c (Fvertical_motion):
19816 * window.c (window_scroll_pixel_based, Frecenter):
19817 Don't pass `need_y_p' to `move_it_by_lines'.
19818
19819 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19820
19821 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19822 steal a few bits to be more compact.
19823 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19824 Remove unneeded casts.
19825
19826 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19827
19828 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19829
19830 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19831 binding" message (bug#7967).
19832
19833 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19834
19835 Fix more problems found by GCC 4.6.0's static checks.
19836
19837 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19838 Remove unused local var.
19839
19840 * editfns.c (Fmessage_box): Remove unused local var.
19841
19842 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19843 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19844 Omit unused local vars.
19845 * window.c (shrink_windows): Omit unused local var.
19846 * menu.c (digest_single_submenu): Omit unused local var.
19847 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19848 Omit unused local var.
19849
19850 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19851 Don't assume string length fits in int.
19852 (keyremap_step, read_key_sequence): Use size_t for sizes.
19853 (read_key_sequence): Don't check last_real_key_start redundantly.
19854
19855 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19856 instead of alloca (Bug#8344).
19857
19858 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19859 (Fbacktrace_frame): Don't assume nframes fits in int.
19860
19861 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19862
19863 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19864 concerns.
19865
19866 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19867
19868 * cm.c (calccost): Turn while-do into do-while, for clarity.
19869
19870 * keyboard.c (syms_of_keyboard): Use the same style as later
19871 in this function when indexing through an array. This also
19872 works around GCC bug 48267.
19873
19874 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19875
19876 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19877
19878 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19879 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19880
19881 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19882 This avoids undefined behavior on integer overflow, and is a bit
19883 more convenient anyway since it is compared to a size_t variable.
19884
19885 Variadic C functions now count arguments with size_t, not int.
19886 This avoids an unnecessary limitation on 64-bit machines, which
19887 caused (substring ...) to crash on large vectors (Bug#8344).
19888 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19889 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19890 All variadic functions and their callers changed accordingly.
19891 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19892 * data.c (arith_driver, float_arith_driver): Likewise.
19893 * editfns.c (general_insert_function): Likewise.
19894 * eval.c (struct backtrace.nargs, interactive_p)
19895 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19896 (funcall_lambda, mark_backtrace): Likewise.
19897 * fns.c (concat): Likewise.
19898 * frame.c (x_set_frame_parameters): Likewise.
19899 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19900 0 if not found, not -1. All callers changed.
19901
19902 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19903 (stack_copy_size): Now size_t, not int.
19904 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19905
19906 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19907
19908 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19909 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19910 All callers changed.
19911
19912 * lisp.h (multibyte_char_to_unibyte):
19913 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19914 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19915 * character.h (CHAR_TO_BYTE8):
19916 * cmds.c (internal_self_insert):
19917 * editfns.c (general_insert_function):
19918 * keymap.c (push_key_description):
19919 * search.c (Freplace_match):
19920 * xdisp.c (message_dolog, set_message_1): All callers changed.
19921
19922 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19923
19924 * keyboard.c (safe_run_hook_funcall): New function.
19925 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19926 don't set the hook to nil, but remove the offending function instead.
19927 (Qcommand_hook_internal): Remove, unused.
19928 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19929 Vcommand_hook_internal.
19930
19931 * eval.c (enum run_hooks_condition): Remove.
19932 (funcall_nil, funcall_not): New functions.
19933 (run_hook_with_args): Call each function through a `funcall' argument.
19934 Remove `cond' argument, now redundant.
19935 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19936 (Frun_hook_with_args_until_failure): Adjust accordingly.
19937 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19938
19939 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19940
19941 * dispextern.h (string_buffer_position): Remove declaration.
19942
19943 * print.c (strout): Remove parameter `multibyte', unused since
19944 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19945
19946 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19947 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19948 All callers changed.
19949
19950 * w32.c (_wsa_errlist): Use braces for struct initializers.
19951
19952 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19953 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19954 All callers changed.
19955 (string_buffer_position): Likewise. Also, make static (it's never
19956 used outside xdisp.c).
19957 (cursor_row_p): Remove parameter `w', unused since
19958 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19959 (decode_mode_spec): Remove parameter `precision', introduced during
19960 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19961 All callers changed.
19962
19963 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19964
19965 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19966
19967 2011-03-27 Anders Lindgren <andlind@gmail.com>
19968
19969 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19970 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19971 (ns_update_auto_hide_menu_bar): New functions.
19972 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19973 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19974 ns_constrain_all_frames.
19975 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19976 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19977
19978 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19979
19980 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19981
19982 2011-03-27 Glenn Morris <rgm@gnu.org>
19983
19984 * syssignal.h: Replace RETSIGTYPE with void.
19985 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19986 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19987 Replace SIGTYPE with void everywhere.
19988 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19989 * s/template.h (SIGTYPE): Remove commented out definition.
19990
19991 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19992
19993 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19994 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19995
19996 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19997
19998 * w32.c (read_unc_volume): Use parameter `henum', instead of
19999 global variable `wget_enum_handle'.
20000
20001 * keymap.c (describe_vector): Remove parameters `indices' and
20002 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
20003 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
20004
20005 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
20006
20007 * keyboard.c (timer_check): Remove parameter `do_it_now',
20008 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
20009 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
20010 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
20011
20012 * keyboard.c (read_char):
20013 * w32menu.c (w32_menu_display_help):
20014 * xmenu.c (show_help_event, menu_help_callback):
20015 Adjust calls to `show_help_echo'.
20016
20017 * gtkutil.c (xg_maybe_add_timer):
20018 * keyboard.c (readable_events):
20019 * process.c (wait_reading_process_output):
20020 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
20021
20022 * insdel.c (adjust_markers_gap_motion):
20023 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
20024 (gap_left, gap_right): Don't call it.
20025
20026 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
20027
20028 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
20029 incurred during fontification.
20030
20031 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
20032
20033 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
20034 (DEFVAR_PER_BUFFER): Don't pass it.
20035
20036 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
20037 (scrolling_window): Don't pass it.
20038
20039 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
20040
20041 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
20042
20043 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
20044 and `suffix'.
20045 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
20046 of variables specific to SELinux and computation of `encoded_absname'.
20047
20048 * image.c (XPutPixel): Remove unused variable `height'.
20049
20050 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
20051
20052 * unexw32.c (get_section_info): Remove unused variable `section'.
20053
20054 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
20055 (system_process_attributes): Remove unused variable `sess'.
20056 (sys_read): Remove unused variable `err'.
20057
20058 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
20059 (w32_wnd_proc): Remove unused variable `isdead'.
20060 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
20061 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
20062 (x_create_tip_frame): Remove unused variable `tem'.
20063
20064 * w32inevt.c (w32_console_read_socket):
20065 Remove unused variable `no_events'.
20066
20067 * w32term.c (x_draw_composite_glyph_string_foreground):
20068 Remove unused variable `width'.
20069
20070 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
20071
20072 * w32term.c (x_set_glyph_string_clipping):
20073 Don't pass uninitialized region to CombineRgn.
20074
20075 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
20076
20077 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
20078 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
20079 (Fx_close_connection): Remove unused variable `i'.
20080
20081 * w32font.c (w32font_draw): Return number of glyphs.
20082 (w32font_open_internal): Remove unused variable `i'.
20083 (w32font_driver): Add missing initializer.
20084
20085 * w32menu.c (utf8to16): Remove unused variable `utf16'.
20086 (fill_in_menu): Remove unused variable `items_added'.
20087
20088 * w32term.c (last_mouse_press_frame): Remove static global variable.
20089 (w32_clip_to_row): Remove unused variable `f'.
20090 (x_delete_terminal): Remove unused variable `i'.
20091
20092 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
20093 (NOTHING): Remove unused static global variable.
20094 (uniscribe_check_otf): Remove unused variable `table'.
20095 (uniscribe_font_driver): Add missing initializers.
20096
20097 2011-03-23 Julien Danjou <julien@danjou.info>
20098
20099 * term.c (Fsuspend_tty, Fresume_tty):
20100 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
20101 * window.c (temp_output_buffer_show):
20102 * insdel.c (signal_before_change):
20103 * frame.c (Fhandle_switch_frame):
20104 * fileio.c (Fdo_auto_save):
20105 * emacs.c (Fkill_emacs):
20106 * editfns.c (save_excursion_restore):
20107 * cmds.c (internal_self_insert):
20108 * callint.c (Fcall_interactively):
20109 * buffer.c (Fkill_all_local_variables):
20110 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
20111 Use Frun_hooks.
20112 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
20113 unconditionally since it does the check itself.
20114
20115 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
20116
20117 Fix more problems found by GCC 4.5.2's static checks.
20118
20119 * coding.c (encode_coding_raw_text): Avoid unnecessary test
20120 the first time through the loop, since we know p0 < p1 then.
20121 This also avoids a gcc -Wstrict-overflow warning.
20122
20123 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
20124 leading to a memory leak, possible in functions like
20125 load_charset_map_from_file that can allocate an unbounded number
20126 of objects (Bug#8318).
20127
20128 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
20129 that could (at least in theory) be that large.
20130
20131 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
20132 This is less likely to overflow, and avoids undefined behavior if
20133 overflow does occur. All callers changed. Use strtoul to scan
20134 for the unsigned long integer.
20135 (pint2hrstr): Simplify and tune code slightly.
20136 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
20137
20138 * scroll.c (do_scrolling): Work around GCC bug 48228.
20139 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
20140
20141 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
20142 This also avoids a warning with gcc -Wstrict-overflow.
20143 (validate_x_resource_name): Simplify count usage.
20144 This also avoids a warning with gcc -Wstrict-overflow.
20145
20146 * fileio.c (Fcopy_file): Report error if fchown or fchmod
20147 fail (Bug#8306).
20148
20149 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
20150
20151 * process.c (Fmake_network_process): Use socklen_t, not int,
20152 where POSIX says socklen_t is required in portable programs.
20153 This fixes a porting bug on hosts like 64-bit HP-UX, where
20154 socklen_t is wider than int (Bug#8277).
20155 (Fmake_network_process, server_accept_connection):
20156 (wait_reading_process_output, read_process_output):
20157 Likewise.
20158
20159 * process.c: Rename or move locals to avoid shadowing.
20160 (list_processes_1, Fmake_network_process):
20161 (read_process_output_error_handler, exec_sentinel_error_handler):
20162 Rename or move locals.
20163 (Fmake_network_process): Define label "retry_connect" only if needed.
20164 (Fnetwork_interface_info): Fix pointer signedness.
20165 (process_send_signal): Add cast to avoid pointer signedness problem.
20166 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
20167 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
20168
20169 Make tparam.h and terminfo.c consistent.
20170 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
20171 Include tparam.h instead, since it declares them.
20172 * cm.h (PC): Remove extern decl; tparam.h now does this.
20173 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
20174 * terminfo.c: Include tparam.h, to check interfaces.
20175 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
20176 (tparam): Adjust signature to match interface in tparam.h;
20177 this removes some undefined behavior. Check that outstring and len
20178 are zero, which they always are with Emacs.
20179 * tparam.h (PC, BC, UP): New extern decls.
20180
20181 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
20182 (xftfont_open): Rename locals to avoid shadowing.
20183
20184 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
20185 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
20186 (OTF_TAG_SYM): Omit macro if not needed.
20187 (ftfont_list): Remove unused local.
20188 (get_adstyle_property, ftfont_pattern_entity):
20189 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
20190 Rename locals to avoid shadowing.
20191
20192 * xfont.c (xfont_list_family): Mark var as initialized.
20193
20194 * xml.c (make_dom): Now static.
20195
20196 * composite.c (composition_compute_stop_pos): Rename local to
20197 avoid shadowing.
20198 (composition_reseat_it): Remove unused locals.
20199 (find_automatic_composition, composition_adjust_point): Likewise.
20200 (composition_update_it): Mark var as initialized.
20201 (find_automatic_composition): Mark vars as initialized,
20202 with a FIXME (Bug#8290).
20203
20204 character.h: Rename locals to avoid shadowing.
20205 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
20206 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
20207 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
20208 (BUF_DEC_POS): Be more systematic about renaming local temporaries
20209 to avoid shadowing.
20210
20211 * textprop.c (property_change_between_p): Remove; unused.
20212
20213 * intervals.c (interval_start_pos): Now static.
20214
20215 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
20216
20217 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
20218 Rename locals to avoid shadowing.
20219
20220 * sound.c (wav_play, au_play, Fplay_sound_internal):
20221 Fix pointer signedness.
20222 (alsa_choose_format): Remove unused local var.
20223 (wav_play): Initialize a variable to 0, to prevent undefined
20224 behavior (Bug#8278).
20225
20226 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
20227
20228 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
20229
20230 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
20231 clobbering (Bug#8298).
20232 * sysdep.c (sys_subshell): Likewise.
20233 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
20234
20235 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
20236 This should get cleaned up, so that child_setup has the
20237 same signature on all platforms.
20238
20239 * callproc.c (call_process_cleanup): Now static.
20240 (relocate_fd): Rename locals to avoid shadowing.
20241
20242 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
20243
20244 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
20245 not to be necessary, and produces flickering.
20246
20247 2011-03-20 Glenn Morris <rgm@gnu.org>
20248
20249 * config.in: Remove file.
20250
20251 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
20252
20253 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
20254 are now in src/globals.h.
20255 (syms_of_minibuf): Remove spurious & from previous change.
20256
20257 2011-03-20 Leo Liu <sdl.web@gmail.com>
20258
20259 * minibuf.c (completing-read-function): New variable.
20260 (completing-read-default): Rename from completing-read.
20261 (completing-read): Call completing-read-function.
20262
20263 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
20264
20265 * xfaces.c (Fx_load_color_file):
20266 Read color file from absolute filename (bug#8250).
20267
20268 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
20269
20270 * makefile.w32-in: Update dependencies.
20271
20272 2011-03-17 Eli Zaretskii <eliz@gnu.org>
20273
20274 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
20275
20276 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
20277
20278 Fix more problems found by GCC 4.5.2's static checks.
20279
20280 * process.c (make_serial_process_unwind, send_process_trap):
20281 (sigchld_handler): Now static.
20282
20283 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
20284 That way, the code declares only the vars that it needs.
20285 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
20286 * s/cygwin.h (PTY_ITERATION): Likewise.
20287 * s/darwin.h (PTY_ITERATION): Likewise.
20288 * s/gnu-linux.h (PTY_ITERATION): Likewise.
20289
20290 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
20291 * process.c (allocate_pty): Don't declare stb unless it's needed.
20292
20293 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
20294 (CONSTANTLIM): Remove; unused.
20295 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
20296 Define only if needed.
20297
20298 * unexelf.c (unexec): Name an expression,
20299 to avoid gcc -Wbad-function-cast warning.
20300 Use a different way to cause a compilation error if anyone uses
20301 n rather than nn, a way that does not involve shadowing.
20302 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
20303
20304 * deps.mk (unexalpha.o): Remove; unused.
20305
20306 New file unexec.h, the (simple) interface for unexec (Bug#8267).
20307 * unexec.h: New file.
20308 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
20309 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
20310 Depend on unexec.h.
20311 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
20312 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
20313 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
20314 Change as necessary to match prototype in unexec.h.
20315
20316 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
20317 shadowing.
20318 (back_comment, skip_chars): Mark vars as initialized.
20319
20320 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
20321 Rename locals to avoid shadowing.
20322
20323 * lread.c (read1): Rewrite so as not to use empty "else".
20324 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
20325
20326 * print.c (Fredirect_debugging_output): Fix pointer signedess.
20327
20328 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
20329 warning when compiling print.c.
20330
20331 * font.c (font_unparse_fcname): Abort in an "impossible" situation
20332 instead of using an uninitialized var.
20333 (font_sort_entities): Mark var as initialized.
20334
20335 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
20336
20337 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
20338 pointers to constants.
20339 (font_parse_fcname): Remove unused vars.
20340 (font_delete_unmatched): Now static.
20341 (font_get_spec): Remove; unused.
20342 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
20343 (font_update_drivers, Ffont_get_glyphs, font_add_log):
20344 Rename or move locals to avoid shadowing.
20345
20346 * fns.c (require_nesting_list, require_unwind): Now static.
20347 (Ffillarray): Rename locals to avoid shadowing.
20348
20349 * floatfns.c (domain_error2): Define only if needed.
20350 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
20351
20352 * alloc.c (mark_backtrace): Move decl from here ...
20353 * lisp.h: ... to here, so that it can be checked.
20354
20355 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
20356 (Fdefvar): Rewrite so as not to use empty "else".
20357 (lisp_indirect_variable): Name an expression,
20358 to avoid gcc -Wbad-function-cast warning.
20359 (Fdefvar): Rename locals to avoid shadowing.
20360
20361 * callint.c (quotify_arg, quotify_args): Now static.
20362 (Fcall_interactively): Rename locals to avoid shadowing.
20363 Use const pointer when appropriate.
20364
20365 * lisp.h (get_system_name, get_operating_system_release):
20366 Move decls here, to check interfaces.
20367 * process.c (get_operating_system_release): Move decl to lisp.h.
20368 * xrdb.c (get_system_name): Likewise.
20369 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
20370 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
20371 some of which prompt warnings from gcc -Wbad-function-cast.
20372 (Fformat_time_string, Fencode_time, Finsert_char):
20373 (Ftranslate_region_internal, Fformat):
20374 Rename or remove local vars to avoid shadowing.
20375 (Ftranslate_region_internal): Mark var as initialized.
20376
20377 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
20378 avoid shadowing.
20379
20380 * lisp.h (eassert): Check that the argument compiles, even if
20381 ENABLE_CHECKING is not defined.
20382
20383 * data.c (Findirect_variable): Name an expression, to avoid
20384 gcc -Wbad-function-cast warning.
20385 (default_value, arithcompare, arith_driver, arith_error): Now static.
20386 (store_symval_forwarding): Rename local to avoid shadowing.
20387 (Fmake_variable_buffer_local, Fmake_local_variable):
20388 Mark variables as initialized.
20389 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
20390
20391 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
20392 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20393 Rename locals to avoid shadowing.
20394 (mark_stack): Move local variables into the #ifdef region where
20395 they're used.
20396 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20397 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20398 needed otherwise.
20399 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20400 (GC_STRING_CHARS): Remove; not used.
20401 (Fmemory_limit): Cast sbrk's returned value to char *.
20402
20403 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20404 avoids undefined behavior in theory.
20405
20406 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20407
20408 Use functions, not macros, for up- and down-casing (Bug#8254).
20409 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20410 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20411 to use the following functions instead of these macros.
20412 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20413 EMACS_INT, since callers assume the returned value fits in int.
20414 (upcase1): Likewise, for UPCASE_TABLE.
20415 (uppercasep, lowercasep, upcase): New static inline functions.
20416 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
20417 the race-condition problem in the old DOWNCASE.
20418
20419 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20420 Rename locals to avoid shadowing.
20421 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
20422 (regex_compile, re_search_2, re_match_2_internal):
20423 Remove unused local vars.
20424 (FREE_VAR): Rewrite so as not to use empty "else",
20425 which gcc can warn about.
20426 (regex_compile, re_match_2_internal): Mark locals as initialized.
20427 (RETALLOC_IF): Define only if needed.
20428 (WORDCHAR_P): Likewise. This one is never needed, but is used
20429 only in a comment talking about a compiler bug, so put inside
20430 the #if 0 of that comment.
20431 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20432 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20433 Remove; unused.
20434
20435 * search.c (boyer_moore): Rename locals to avoid shadowing.
20436 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20437 (PREV_CHAR_BOUNDARY): Likewise.
20438
20439 * search.c (simple_search): Remove unused var.
20440
20441 * dired.c (compile_pattern): Move decl from here ...
20442 * lisp.h: ... to here, so that it can be checked.
20443 (struct re_registers): New forward decl.
20444
20445 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20446
20447 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20448 All uses changed.
20449 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20450 Rename locals to avoid shadowing.
20451 (Fvertical_motion): Mark locals as initialized.
20452
20453 * casefiddle.c (casify_object, casify_region): Now static.
20454 (casify_region): Mark local as initialized.
20455
20456 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20457
20458 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20459 New macros, so that the caller can use some names other than
20460 gcpro1, gcpro2, etc.
20461 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20462 of the new macros.
20463 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20464 argument, for consistency with GCPRO2_VAR, etc: it is now the
20465 prefix of the variable, not the variable itself. All uses
20466 changed.
20467 * dired.c (directory_files_internal, file_name_completion):
20468 Rename locals to avoid shadowing.
20469
20470 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20471 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20472 dired.c's scmp function, had undefined behavior.
20473 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20474 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20475 * buffer.h: ... to here, because these macros use current_buffer,
20476 and the new implementation with inline functions needs to have
20477 current_buffer in scope now, rather than later when the macros
20478 are used.
20479 (downcase, upcase1): New static inline functions.
20480 (DOWNCASE, UPCASE1): Reimplement using these functions.
20481 This avoids undefined behavior in expressions like
20482 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20483 from race conditions in accessing the global variables
20484 case_temp1 and case_temp2.
20485 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20486 * lisp.h (case_temp1, case_temp2): Remove their decls.
20487 * character.h (ASCII_CHAR_P): Move from here ...
20488 * lisp.h: ... to here, so that the inline functions mentioned
20489 above can use them.
20490
20491 * dired.c (directory_files_internal_unwind): Now static.
20492
20493 * fileio.c (file_name_as_directory, directory_file_name):
20494 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20495 Now static.
20496 (file_name_as_directory): Use const pointers when appropriate.
20497 (Fexpand_file_name): Likewise. In particular, newdir might
20498 point at constant storage, so make it a const pointer.
20499 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
20500 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20501 signedness issues.
20502 (Fset_file_times, Finsert_file_contents, auto_save_error):
20503 Rename locals to avoid shadowing.
20504
20505 * minibuf.c (choose_minibuf_frame_1): Now static.
20506 (Ftry_completion, Fall_completions): Rename or remove locals
20507 to avoid shadowing.
20508
20509 * marker.c (bytepos_to_charpos): Remove; unused.
20510
20511 * lisp.h (verify_bytepos, count_markers): New decls,
20512 so that gcc does not warn that these functions aren't declared.
20513
20514 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20515 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
20516 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
20517 (copy_text): Remove unused local var.
20518
20519 * filelock.c (within_one_second): Now static.
20520 (lock_file_1): Rename local to avoid shadowing.
20521
20522 * buffer.c (fix_overlays_before): Mark locals as initialized.
20523 (fix_start_end_in_overlays): Likewise. This function should be
20524 simplified by using pointers-to-pointers, but that's a different
20525 matter.
20526 (switch_to_buffer_1): Now static.
20527 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20528 (report_overlay_modification): Rename locals to avoid shadowing.
20529
20530 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
20531 Fix pointer signedness issue.
20532 (sys_subshell): Mark local as volatile if checking for lint,
20533 to suppress a gcc -Wclobbered warning that does not seem to be right.
20534 (MAXPATHLEN): Define only if needed.
20535
20536 * process.c (serial_open, serial_configure): Move decls from here ...
20537 * systty.h: ... to here, so that they can be checked.
20538
20539 * fns.c (get_random, seed_random): Move extern decls from here ...
20540 * lisp.h: ... to here, so that they can be checked.
20541
20542 * sysdep.c (reset_io): Now static.
20543 (wait_for_termination_signal): Remove; unused.
20544
20545 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20546 (copy_keymap_item, append_key, push_text_char_description):
20547 Now static.
20548 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
20549 (DENSE_TABLE_SIZE): Remove; unused.
20550 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20551 (describe_map_tree):
20552 Rename locals to avoid shadowing.
20553
20554 * keyboard.c: Declare functions static if they are not used elsewhere.
20555 (echo_char, echo_dash, cmd_error, top_level_2):
20556 (poll_for_input, handle_async_input): Now static.
20557 (read_char, kbd_buffer_get_event, make_lispy_position):
20558 (make_lispy_event, make_lispy_movement, apply_modifiers):
20559 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20560 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20561 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
20562 (read_key_sequence, read_char): Mark locals as initialized.
20563 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
20564
20565 * keyboard.h (make_ctrl_char): New decl.
20566 (mark_kboards): Move decl here ...
20567 * alloc.c (mark_kboards): ... from here.
20568
20569 * lisp.h (force_auto_save_soon): New decl.
20570
20571 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
20572 (DEFINE_DUMMY_FUNCTION): New macro.
20573 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20574 Use it.
20575 (main): Add casts to avoid warnings
20576 if GCC considers string literals to be constants.
20577
20578 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20579
20580 * dbusbind.c: Pointer signedness fixes.
20581 (xd_signature, xd_append_arg, xd_initialize):
20582 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20583 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20584 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20585 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20586
20587 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20588 if GCC considers string literals to be constants.
20589 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
20590
20591 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20592
20593 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20594 (print_preprocess, print_object): New macro to fix last change.
20595
20596 * print.c (print_preprocess): Don't forget font objects.
20597
20598 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
20599
20600 * emacs.c (USAGE3): Doc fixes.
20601
20602 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20603
20604 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20605 structure.
20606
20607 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
20608
20609 * lisp.h (VWindow_system, Qfile_name_history):
20610 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20611 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20612 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20613
20614 * w32select.c: Don't #include "keyboard.h".
20615 (run_protected): Add extern declaration for waiting_for_input.
20616
20617 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20618 * w32console.c (detect_input_pending, read_input_pending)
20619 (encode_terminal_code):
20620 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20621 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20622 (w32_system_caret_y, Qfile_name_history):
20623 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20624 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20625 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20626 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20627 * w32proc.c (Qlocal, report_file_error):
20628 * w32term.c (Vwindow_system, updating_frame):
20629 * w32uniscribe.c (initialized, uniscribe_font_driver):
20630 Remove unneeded extern declarations.
20631
20632 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
20633
20634 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
20635
20636 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
20637
20638 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20639 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20640 These macros can no longer be used for assignment.
20641
20642 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20643 Assign struct members directly, instead of using BUF_BEGV etc.
20644 (record_buffer_markers, fetch_buffer_markers): New functions for
20645 recording and fetching special buffer markers.
20646 (set_buffer_internal_1, set_buffer_temp): Use them.
20647
20648 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20649
20650 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20651
20652 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20653 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20654
20655 * xdisp.c (hscroll_window_tree):
20656 (reconsider_clip_changes): Use PT instead of BUF_PT.
20657
20658 2011-03-13 Eli Zaretskii <eliz@gnu.org>
20659
20660 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20661 $(EMACS_ROOT)/lib/intprops.h.
20662
20663 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20664
20665 Fix more problems found by GCC 4.5.2's static checks.
20666
20667 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20668 to unsigned char * to avoid compiler diagnostic.
20669 (xg_free_frame_widgets): Make it clear that a local variable is
20670 needed only if USE_GTK_TOOLTIP.
20671 (gdk_window_get_screen): Make it clear that this macro is needed
20672 only if USE_GTK_TOOLTIP.
20673 (int_gtk_range_get_value): New function, which avoids a diagnostic
20674 from gcc -Wbad-function-cast.
20675 (xg_set_toolkit_scroll_bar_thumb): Use it.
20676 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20677 diagnostic from gcc -Wbad-function-cast.
20678 (get_utf8_string, xg_get_file_with_chooser):
20679 Rename locals to avoid shadowing.
20680 (create_dialog): Move locals to avoid shadowing.
20681
20682 * xgselect.c (xg_select): Remove unused var.
20683
20684 * image.c (four_corners_best): Mark locals as initialized.
20685 (gif_load): Initialize transparent_p to zero (Bug#8238).
20686 Mark another local as initialized.
20687 (my_png_error, my_error_exit): Mark with NO_RETURN.
20688
20689 * image.c (clear_image_cache): Now static.
20690 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20691 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20692 (x_edge_detection): Remove unnecessary cast that
20693 gcc -Wbad-function-cast diagnoses.
20694 (gif_load): Fix pointer signedness.
20695 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20696 (jpeg_load, gif_load): Rename locals to avoid shadowing.
20697
20698 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
20699
20700 Improve quality of tests for time stamp overflow.
20701 For example, without this patch (encode-time 0 0 0 1 1
20702 1152921504606846976) returns the obviously-bogus value (-948597
20703 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20704 reports time overflow. See
20705 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20706 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20707 * editfns.c: Include limits.h and intprops.h.
20708 (TIME_T_MIN, TIME_T_MAX): New macros.
20709 (time_overflow): Move earlier, to before first use.
20710 (hi_time, lo_time): New functions, for an accurate test for
20711 out-of-range times.
20712 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20713 (Fget_internal_run_time): Don't assume time_t fits in int.
20714 (make_time): Use list2 instead of Fcons twice.
20715 (Fdecode_time): More accurate test for out-of-range times.
20716 (check_tm_member): New function.
20717 (Fencode_time): Use it, to test for out-of-range times.
20718 (lisp_time_argument): Don't rely on undefined left-shift and
20719 right-shift behavior when checking for time stamp overflow.
20720
20721 * editfns.c (time_overflow): New function, refactoring common code.
20722 (Fformat_time_string, Fdecode_time, Fencode_time):
20723 (Fcurrent_time_string): Use it.
20724
20725 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20726 * dired.c (make_time): Move to ...
20727 * editfns.c (make_time): ... here.
20728 * systime.h: Note the move.
20729
20730 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20731
20732 * fringe.c (update_window_fringes): Remove unused variables.
20733
20734 * unexmacosx.c (copy_data_segment): Also copy __got section.
20735 (Bug#8223)
20736
20737 2011-03-12 Eli Zaretskii <eliz@gnu.org>
20738
20739 * termcap.c [MSDOS]: Include "msdos.h".
20740 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20741 Constify `char *' arguments and their references according to
20742 prototypes in tparam.h.
20743
20744 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20745
20746 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20747 Adapt all references accordingly.
20748
20749 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20750
20751 2011-03-11 Tom Tromey <tromey@redhat.com>
20752
20753 * buffer.c (syms_of_buffer): Remove obsolete comment.
20754
20755 2011-03-11 Eli Zaretskii <eliz@gnu.org>
20756
20757 * termhooks.h (encode_terminal_code): Declare prototype.
20758
20759 * msdos.c (encode_terminal_code): Don't declare prototype.
20760
20761 * term.c (encode_terminal_code): Now external again, used by
20762 w32console.c and msdos.c.
20763
20764 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20765 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20766
20767 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
20768
20769 Fix some minor problems found by GCC 4.5.2's static checks.
20770
20771 * fringe.c (update_window_fringes): Mark locals as initialized
20772 (Bug#8227).
20773 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20774
20775 * alloc.c (mark_fringe_data): Move decl from here ...
20776 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20777 to check its interface.
20778 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20779
20780 * fontset.c (free_realized_fontset): Now static.
20781 (Fset_fontset_font): Rename local to avoid shadowing.
20782 (fontset_font): Mark local as initialized.
20783 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20784
20785 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20786
20787 * xselect.c (x_disown_buffer_selections): Remove; not used.
20788 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20789 (x_own_selection, Fx_disown_selection_internal): Rename locals
20790 to avoid shadowing.
20791 (x_handle_dnd_message): Remove local to avoid shadowing.
20792
20793 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20794 so that the caller can use some name other than gcpro1.
20795 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20796 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20797 (Fx_backspace_delete_keys_p):
20798 Use them to avoid shadowing, and rename vars to avoid shadowing.
20799 (x_decode_color, x_set_name, x_window): Now static.
20800 (Fx_create_frame): Add braces to silence GCC warning.
20801 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20802 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20803 Remove unused locals.
20804 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20805 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20806 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20807 macros.
20808
20809 * xterm.h (x_mouse_leave): New decl.
20810
20811 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20812 Remove unused functions.
20813 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20814 (x_calc_absolute_position): Now static.
20815 (XTread_socket): Don't define label "out" unless it's used.
20816 Don't declare local "event" unless it's used.
20817 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20818 unless they are used.
20819 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20820 (x_fatal_error_signal): Remove; not used.
20821 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20822 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20823 (x_error_catcher, x_connection_closed, x_error_handler):
20824 (x_error_quitter, xembed_send_message, x_iconify_frame):
20825 (my_log_handler): Rename locals to avoid shadowing.
20826 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20827 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20828
20829 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20830 Rename or move locals to avoid shadowing.
20831 (tty_defined_color, merge_face_heights): Now static.
20832 (free_realized_faces_for_fontset): Remove; not used.
20833 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20834 does not deduce is never used uninitialized.
20835 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20836 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20837
20838 * terminal.c (store_terminal_param): Now static.
20839
20840 * xmenu.c (menu_highlight_callback): Now static.
20841 (set_frame_menubar): Remove unused local.
20842 (xmenu_show): Rename parameter to avoid shadowing.
20843 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20844 since they might point to immutable storage.
20845 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20846 since it's unused otherwise.
20847
20848 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20849 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20850 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20851 avoids a gcc -Wuninitialized diagnostic.
20852 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20853 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20854 does not deduce are never used uninitialized.
20855
20856 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20857
20858 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20859 * window.c (window_loop, size_window):
20860 (run_window_configuration_change_hook, enlarge_window): Likewise.
20861
20862 * window.c (display_buffer): Now static.
20863 (size_window): Mark variables that gcc -Wuninitialized
20864 does not deduce are never used uninitialized.
20865 * window.h (check_all_windows): New decl, to forestall
20866 gcc -Wmissing-prototypes diagnostic.
20867 * dispextern.h (bidi_dump_cached_states): Likewise.
20868
20869 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20870 shadowing.
20871 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20872 Include <limits.h>.
20873 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20874 and to avoid gcc -Wuninitialized warning.
20875 (load_charset_map): Mark variables that gcc -Wuninitialized
20876 does not deduce are never used uninitialized.
20877 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20878
20879 * coding.c (coding_set_source, coding_set_destination):
20880 Use "else { /* comment */ }" rather than "else /* comment */;"
20881 for clarity, and to avoid gcc -Wempty-body warning.
20882 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20883 a block, when the outer 'i' will do.
20884 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20885 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20886 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20887 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20888 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20889 Rename locals to avoid shadowing.
20890 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20891 * coding.c (emacs_mule_char, encode_invocation_designation):
20892 Now static, since they're not used elsewhere.
20893 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20894 (decode_coding_object, encode_coding_object, detect_coding_system):
20895 (decode_coding_emacs_mule): Mark variables that gcc
20896 -Wuninitialized does not deduce are never used uninitialized.
20897 (detect_coding_iso_2022): Initialize a local variable that might
20898 be used uninitialized. Leave a FIXME because it's not clear that
20899 this initialization is needed. (Bug#8211)
20900 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20901 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20902 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20903 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20904 Remove unused macros.
20905
20906 * category.c (hash_get_category_set): Remove unused local var.
20907 (copy_category_table): Now static, since it's not used elsewhere.
20908 * character.c (string_count_byte8): Likewise.
20909
20910 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20911 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20912
20913 * chartab.c (copy_sub_char_table): Now static, since it's not used
20914 elsewhere.
20915 (sub_char_table_ref_and_range, char_table_ref_and_range):
20916 Rename locals to avoid shadowing.
20917 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20918
20919 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20920 (BIDI_BOB): Remove unused macro.
20921
20922 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20923 deduce are never used uninitialized.
20924 * term.c (encode_terminal_code): Likewise.
20925
20926 * term.c (encode_terminal_code): Now static. Remove unused local.
20927
20928 * tparam.h: New file.
20929 * term.c, tparam.h: Include it.
20930 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20931 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20932 Move these decls to tparam.h, and make them agree with what
20933 is actually in tparam.c. The previous trick of using incompatible
20934 decls in different modules does not conform to the C standard.
20935 All callers of tparam changed to use tparam's actual API.
20936 * tparam.c (tparam1, tparam, tgoto):
20937 Use const pointers where appropriate.
20938
20939 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20940 * cm.h (struct cm): Likewise.
20941 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20942 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20943 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20944 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20945 (turn_on_face, init_tty): Likewise.
20946 * termchar.h (struct tty_display_info): Likewise.
20947
20948 * term.c (term_mouse_position): Rename local to avoid shadowing.
20949
20950 * alloc.c (mark_ttys): Move decl from here ...
20951 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20952
20953 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20954
20955 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20956
20957 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20958
20959 * search.c (compile_pattern_1): Remove argument regp, unused since
20960 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20961 (compile_pattern): Don't pass it.
20962
20963 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20964
20965 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20966 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20967 for ! HAVE_GTK3.
20968 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20969
20970 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20971
20972 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20973 gdk_window_get_screen, gdk_window_get_geometry,
20974 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20975 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20976 (xg_get_pixbuf_from_pixmap): New function.
20977 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20978 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20979 Call xg_get_pixbuf_from_pixmap instead of
20980 gdk_pixbuf_get_from_drawable.
20981 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20982 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20983 (xg_check_special_colors): Use GtkStyleContext and its functions
20984 for HAVE_GTK3.
20985 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20986 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20987 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20988 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20989 Call gtk_widget_get_preferred_size.
20990 (xg_frame_resized): gdk_window_get_geometry only takes 5
20991 parameters.
20992 (xg_win_to_widget, xg_event_is_for_menubar):
20993 Call gdk_x11_window_lookup_for_display.
20994 (xg_set_widget_bg): New function.
20995 (delete_cb): New function.
20996 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20997 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20998 (xg_set_background_color): Call xg_set_widget_bg.
20999 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
21000 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
21001 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
21002 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
21003 if ! HAVE_GTK3.
21004 (update_frame_tool_bar): Call gtk_widget_hide.
21005 (xg_initialize): Use GDK_KEY_g.
21006
21007 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
21008 if ! HAVE_GTK3
21009 (x_session_initialize): Call gdk_x11_set_sm_client_id.
21010
21011 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
21012 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
21013 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
21014
21015 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
21016
21017 * w32xfns.c (select_palette): Check success of RealizePalette against
21018 GDI_ERROR, not zero.
21019
21020 See ChangeLog.11 for earlier changes.
21021
21022 ;; Local Variables:
21023 ;; coding: utf-8
21024 ;; End:
21025
21026 Copyright (C) 2011-2012 Free Software Foundation, Inc.
21027
21028 This file is part of GNU Emacs.
21029
21030 GNU Emacs is free software: you can redistribute it and/or modify
21031 it under the terms of the GNU General Public License as published by
21032 the Free Software Foundation, either version 3 of the License, or
21033 (at your option) any later version.
21034
21035 GNU Emacs is distributed in the hope that it will be useful,
21036 but WITHOUT ANY WARRANTY; without even the implied warranty of
21037 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21038 GNU General Public License for more details.
21039
21040 You should have received a copy of the GNU General Public License
21041 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.