b7bb772d26694e90c1a28a41cde9d2cedbe96be9
[bpt/emacs.git] / src / ChangeLog
1 2012-12-13 Eli Zaretskii <eliz@gnu.org>
2
3 * search.c (search_buffer): Check the inverse translations of each
4 character in pattern when the buffer being searched is unibyte.
5 (Bug#13084)
6
7 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
8
9 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
10 files, fixing a regression from 24.2.
11 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
12
13 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
14
15 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
16 fstat shouldn't fail, and if it does fail copy-file should not proceed.
17 Remove unnecessary S_ISLNK test, as (contra the comments) this
18 function can't copy symlinks. Improve quality of error message
19 when attempting to copy files that are neither regular files nor
20 directories.
21
22 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
23
24 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
25 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
26 * window.c (Frecenter):
27 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
28 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
29
30 2012-12-12 Daniel Colascione <dancol@dancol.org>
31
32 * unexcw.c (fixup_executable): use posix_fallocate to ensure that
33 the dumped Emacs is not a sparse file, greatly improving Cygwin
34 "make bootstrap" performance.
35
36 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
37
38 * inotify.c (inotify_callback): Generate an Emacs event for every
39 incoming inotify event.
40
41 2012-12-11 Eli Zaretskii <eliz@gnu.org>
42
43 * xdisp.c (handle_face_prop): Fix logic of computing
44 it->start_of_box_run_p.
45 (append_space_for_newline): If the glyph row is R2L, reset the
46 iterator's end_of_box_run_p flag before prepending the space glyph.
47 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
48 iterator's start_of_box_run_p flag before prepending the stretch.
49 (append_glyph, produce_image_glyph, append_composite_glyph)
50 (append_stretch_glyph, append_glyphless_glyph): Reverse the
51 left_box_line_p and right_box_line_p flags of the glyph for R2L
52 glyph rows. (Bug#13011)
53
54 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
55
56 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
57 if changed buffer is not shown in a window.
58 * insdel.c (prepare_to_modify_buffer): Likewise.
59 * window.c (replace_buffer_in_windows_safely): Do nothing
60 if buffer is not shown in a window.
61 (Fforce_window_update): Likewise if string or buffer argument
62 is passed.
63
64 2012-12-11 Eli Zaretskii <eliz@gnu.org>
65
66 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
67 encoded_file_name, which is what it is.
68
69 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
70
71 Consistently use marker_position and marker_byte_position.
72 * fringe.c (Ffringe_bitmaps_at_pos):
73 * indent.c (Fvertical_motion):
74 * insdel.c (prepare_to_modify_buffer):
75 * keyboard.c (make_lispy_position):
76 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
77 (window_scroll_pixel_based, displayed_window_lines)
78 (Fset_window_configuration):
79 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
80 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
81 Replace direct access to marker fields with calls
82 to marker_position and/or marker_byte_position.
83
84 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
85
86 * makefile.w32-in (SIG2STR_H): New macro.
87 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
88 ($(BLD)/w32notify.$(O)): Update dependencies.
89
90 2012-12-10 Daniel Colascione <dancol@dancol.org>
91
92 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
93 Windows file notification functionality unless WINDOWSNT.
94
95 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
96 declarations.
97
98 * w32fns.c (cache_system_info): Initialize the global hinst
99 variable here so various initialization calls DTRT.
100
101 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused
102 variables.
103 (hinst): Remove unneeded extern declaration.
104 (_start): Remove initialization of above variables; remove
105 initialization of hinst, as cache_system_info now does that.
106
107 * emacs.c (main): Call cache_system_info early in startup; we
108 previously weren't calling it in Cygwin builds.
109
110 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK): Teach
111 the autoconf build system how to compile a Windows resource file
112 and link it to Emacs.
113
114 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
115
116 Per-buffer window counters.
117 * buffer.h (struct buffer): New member window_count.
118 (buffer_window_count): New function.
119 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
120 Initialize window_count.
121 (Fkill_buffer): Verify window_count for the buffer being killed.
122 (modify_overlay): Do not force redisplay if buffer is not shown
123 in any window.
124 (init_buffer_once): Initialize window_count for buffer_defaults
125 and buffer_local_symbols.
126 * window.h (buffer_shared): Remove declaration.
127 (wset_buffer): Convert from inline ...
128 * window.c (wset_buffer): ... to an ordinary function.
129 (adjust_window_count): New function.
130 (make_parent_window): Use it.
131 * xdisp.c (buffer_shared): Remove.
132 (redisplay_internal, redisplay_window): Adjust users.
133 (buffer_shared_and_changed): Use per-buffer window counter.
134
135 2012-12-10 Eli Zaretskii <eliz@gnu.org>
136
137 Support for filesystem notifications on MS-Windows.
138 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
139 and this is a TTY frame, signal the caller that keyboard input is
140 available.
141
142 * w32xfns.c (drain_message_queue): Now returns an int: an
143 indication whether any WM_EMACS_FILENOTIFY messages were found in
144 the queue.
145
146 * w32inevt.c (handle_file_notifications): New function.
147 (w32_console_read_socket): Call it to process file notifications.
148
149 * w32console.c (initialize_w32_display): Record the main thread ID
150 in dwMainThreadId.
151
152 * deps.mk (inotify.o): New dependency list.
153
154 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
155
156 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
157 (WM_EMACS_END): Bump value by 1.
158 (notification_buffer_in_use, file_notifications)
159 (notifications_size, notifications_desc): Declare.
160 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
161 Add prototypes.
162
163 * w32term.c (lispy_file_action, queue_notifications): New functions.
164 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
165 <Qrenamed_to>: New symbols.
166 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
167
168 * w32notify.c: New file, implements file event notifications for
169 MS-Windows.
170
171 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
172 by posting it to the w32_read_socket queue.
173
174 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support
175 FILE_NOTIFY_EVENT.
176
177 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
178 (GLOBAL_SOURCES): Add w32notify.c
179 ($(BLD)/w32notify.$(O)): New set of dependencies.
180
181 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
182
183 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]: Handle
184 FILE_NOTIFY_EVENT.
185 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
186 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
187 w32notify-handle-event by default.
188
189 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
190 syms_of_w32notify.
191
192 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
193
194 Support for filesystem notifications on GNU/Linux via inotify.
195 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add
196 FILE_NOTIFY_EVENT.
197
198 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
199
200 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
201 (syms_of_keyboard): DEFSYM it.
202 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
203 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
204 Qfile_inotify events.
205 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
206 special-event-map to inotify-handle-event.
207
208 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
209
210 * Makefile.in (base_obj): Add inotify.o.
211
212 * inotify.c: New file.
213
214 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
215
216 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
217
218 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
219
220 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
221 DWORD_PTR, for compatibility with 64-bit builds.
222
223 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
224 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
225 (system_process_attributes): Use SIZE_T rather than DWORD, for
226 compatibility with 64-bit builds.
227
228 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
229
230 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
231
232 2012-12-10 Eli Zaretskii <eliz@gnu.org>
233
234 * indent.c (Fvertical_motion): If a display string will be
235 displayed on the left or the right margin, don't consider it as a
236 factor in cursor positioning. (Bug#13108)
237
238 2012-12-10 Martin Rudalics <rudalics@gmx.at>
239
240 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
241
242 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
243
244 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
245 for string length.
246
247 2012-12-08 Eli Zaretskii <eliz@gnu.org>
248
249 * w32.c (unsetenv): Return 0 if the input string is too long.
250
251 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
252
253 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
254 * alloc.c (xputenv): New function.
255 * dbusbind.c (Fdbus_init_bus):
256 * emacs.c (main):
257 * xterm.c (x_term_init):
258 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
259 * editfns.c (initial_tz): Move static var decl up.
260 (tzvalbuf_in_environ): New static var.
261 (init_editfns): Initialize these two static vars.
262 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
263 Save old TZ value on stack, if it's small.
264 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
265 instead, use xputenv+unsetenv to set and restore TZ.
266 (environbuf): Remove static var. All uses removed.
267 (Fset_time_zone_rule): Do not save TZ and environ;
268 no longer needed here.
269 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
270 Move to inside set_time_zone_rule; they don't need file scope any more.
271 (set_time_zone_rule): Maintain the TZ=value string separately.
272 (syms_of_editfns): Don't initialize initial_tz;
273 init_editfns now does it.
274 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
275 * lisp.h (xputenv): New decl.
276
277 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
278
279 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
280
281 2012-12-08 Eli Zaretskii <eliz@gnu.org>
282
283 * w32.c (unsetenv, sys_putenv): New functions.
284
285 2012-12-08 Chong Yidong <cyd@gnu.org>
286
287 * editfns.c (Finsert_char): Make the error message more
288 informative (Bug#12992).
289
290 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
291
292 Simplify get_lim_data.
293 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
294 Remove USG and vlimit methods; no longer used these days.
295 Add #error catchall just in case.
296
297 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
298 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
299 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
300 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
301 (deleted_pid_list, Fdelete_process, create_process)
302 (record_child_status_change, handle_child_signal, deliver_child_signal)
303 (init_process_emacs, syms_of_process):
304 Assume SIGCHLD is defined.
305 (parse_signal): Remove. All uses removed.
306 (abbr_to_signal): New static function.
307 (Fsignal_process): Use it to convert signal names to ints.
308 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
309 kill (getpgrp (), ...).
310 (emacs_sigaction_init): Assume SIGCHLD is defined.
311 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
312 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
313 * syssignal.h (EMACS_KILLPG): Remove.
314 All uses replaced by 'kill' with a negative pid.
315 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
316 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
317
318 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
319
320 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
321 This will cause a production Emacs to dump core instead of
322 infinite-looping.
323
324 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
325
326 * frame.c (make_frame): Do not set window's buffer to t.
327 * window.c (Fsplit_window_internal): Likewise. Previously it was
328 used to indicate that the window is being set up. Now we use
329 set_window_buffer for all new windows, so the condition in ...
330 (Fset_window_buffer): ... is always true and can be removed.
331
332 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
333
334 Convenient macro to check whether the buffer is hidden.
335 * buffer.h (BUFFER_HIDDEN_P): New macro.
336 * frame.c (make_frame): Use it. Adjust comment.
337 * buffer.c (candidate_buffer): New function.
338 (Fother_buffer, other_buffer_safely): Use it.
339
340 2012-12-06 Eli Zaretskii <eliz@gnu.org>
341
342 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
343 if the child process is still running. Instead, exit the wait
344 loop and return zero. (Bug#13086)
345
346 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
347
348 * frame.h (x_char_width, x_char_height): Remove prototypes.
349 * w32term.h (x_char_width, x_char_height): Likewise.
350 * xfns.c (x_char_width, x_char_height): Remove.
351 * w32fns.c (x_char_width, x_char_height): Likewise.
352 * nsfns.c (x_char_width, x_char_height): Likewise.
353 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
354 all window frames.
355 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
356 * keyboard.c (command_loop_1): Remove prototype.
357 (command_loop_2, top_level_1): Add static to match prototype.
358
359 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
360
361 Fix a recently-introduced delete-process race condition.
362 * callproc.c, process.h (record_kill_process):
363 New function, containing part of the old call_process_kill.
364 (call_process_kill): Use it.
365 This does not change call_process_kill's behavior.
366 * process.c (Fdelete_process): Use record_kill_process to fix a
367 race condition that could cause Emacs to lose track of a child.
368
369 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
370
371 Avoid code duplication between prev_frame and next_frame.
372 * frame.c (candidate_frame): New function. Add comment.
373 (prev_frame, next_frame): Use it. Adjust comment.
374
375 2012-12-06 Eli Zaretskii <eliz@gnu.org>
376
377 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
378 fails, signal an error instead of continuing with an empty
379 string. (Bug#13079)
380 Encode expanded temp file pattern before passing it to mkstemp or
381 mktemp.
382
383 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
384 Encode the file name before passing it to dostounix_filename, in
385 case it will downcase it (under w32-downcase-file-names).
386 (Bug#12933)
387
388 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
389
390 Minor call-process cleanups.
391 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
392 at the same time as other platforms, to simplify analysis.
393 No need for fd0_volatile since we have synch_process_fd.
394 Avoid needless emacs_close; arg is always negative.
395
396 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
397
398 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
399 processes.
400
401 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
402
403 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
404 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
405 and mouse_face_hidden members to a bitfields.
406 * frame.h (struct frame): Remove set-but-not-used space_width member.
407 (FRAME_SPACE_WIDTH): Remove.
408 * nsterm.m, w32term.c, xterm.c: Adjust users.
409 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
410 member. Adjust users. Convert term_initted, delete_in_insert_mode,
411 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
412 members to a bitfields.
413
414 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
415
416 Don't let call-process be a zombie factory (Bug#12980).
417 Fixing this bug required some cleanup of the signal-handling code.
418 As a side effect, this change also fixes a longstanding rare race
419 condition whereby Emacs could mistakenly kill unrelated processes,
420 and it fixes a bug where a second C-g does not kill a recalcitrant
421 synchronous process in GNU/Linux and similar platforms.
422 The patch should also fix the last vestiges of Bug#9488,
423 a bug which has mostly been fixed on the trunk by other changes.
424 * callproc.c, process.h (synch_process_alive, synch_process_death)
425 (synch_process_termsig, sync_process_retcode):
426 Remove. All uses removed, to simplify analysis and so that
427 less consing is done inside critical sections.
428 * callproc.c (call_process_exited): Remove. All uses replaced
429 with !synch_process_pid.
430 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
431 These take the role of what used to be in unwind-protect arg.
432 All uses changed.
433 (block_child_signal, unblock_child_signal):
434 New functions, to avoid races that could kill innocent-victim processes.
435 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
436 (call_process_kill): Record killed processes as deleted, so that
437 zombies do not clutter up the system. Do this inside a critical
438 section, to avoid a race that would allow the clutter.
439 (call_process_cleanup): Fix code so that the second C-g works again
440 on common platforms such as GNU/Linux.
441 (Fcall_process): Create the child process in a critical section,
442 to fix a race condition. If creating an asynchronous process,
443 record it as deleted so that zombies do not clutter up the system.
444 Do unwind-protect for WINDOWSNT too, as that's simpler in the
445 light of these changes. Omit unnecessary call to emacs_close
446 before failure, as the unwind-protect code does that.
447 * callproc.c (call_process_cleanup):
448 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
449 * process.c (record_deleted_pid): New function, containing
450 code refactored out of Fdelete_process.
451 (Fdelete_process): Use it.
452 (process_status_retrieved): Remove. All callers changed to use
453 child_status_change.
454 (record_child_status_change): Remove, folding its contents into ...
455 (handle_child_signal): ... this signal handler. Now, this
456 function is purely a handler for SIGCHLD, and is not called after
457 a synchronous waitpid returns; the synchronous code is moved to
458 wait_for_termination. There is no need to worry about reaping
459 more than one child now.
460 * sysdep.c (get_child_status, child_status_changed): New functions.
461 (wait_for_termination): Now takes int * status and bool
462 interruptible arguments, too. Do not record child status change;
463 that's now the caller's responsibility. All callers changed.
464 Reimplement in terms of get_child_status.
465 (wait_for_termination_1, interruptible_wait_for_termination):
466 Remove. All callers changed to use wait_for_termination.
467 * syswait.h: Include <stdbool.h>, for bool.
468 (record_child_status_change, interruptible_wait_for_termination):
469 Remove decls.
470 (record_deleted_pid, child_status_changed): New decls.
471 (wait_for_termination): Adjust to API changes noted above.
472
473 * bytecode.c, lisp.h (Qbytecode): Remove.
474 No longer needed after 2012-11-20 interactive-p changes.
475
476 2012-12-03 Eli Zaretskii <eliz@gnu.org>
477
478 * xdisp.c (redisplay_window): If the cursor is visible, but inside
479 the scroll margin, move point outside the margin. (Bug#13055)
480
481 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
482
483 * gtkutil.c (my_log_handler): New function.
484 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
485
486 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
487
488 * lisp.h (modify_region): Rename to...
489 (modify_region_1): ...new prototype.
490 * textprop.c (modify_region): Now static. Adjust users.
491 * insdel.c (modify_region): Rename to...
492 (modify_region_1): ...new function to work with current buffer.
493 Adjust comment and users. Use true and false for booleans.
494
495 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
496
497 * alloc.c (free_save_value): New function.
498 (safe_alloca_unwind): Use it.
499 * lisp.h (free_save_value): New prototype.
500 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
501 Add comment.
502 (save_excursion_restore): Adjust to match saved data structure.
503 Use free_save_value to offload some work from GC. Drop obsolete
504 #if 0 code.
505
506 2012-12-03 Chong Yidong <cyd@gnu.org>
507
508 * fileio.c (Vauto_save_list_file_name): Doc fix.
509
510 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
511
512 * w32fns.c: Remove prototype of atof.
513 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
514 builds.
515 (file_dialog_callback): Declared UINT_PTR.
516
517 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
518 with 64-bit builds.
519
520 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
521 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
522 defined.
523
524 2012-12-03 Glenn Morris <rgm@gnu.org>
525
526 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
527
528 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
529
530 Fix xpalloc confusion after memory is exhausted.
531 * alloc.c (xpalloc): Comment fix.
532 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
533 and signals an error, do not clear charset_table_size, as
534 charset_table is still valid.
535 * doprnt.c (evxprintf): Clear *BUF after freeing it.
536
537 Use execve to avoid need to munge environ (Bug#13054).
538 * callproc.c (Fcall_process):
539 * process.c (create_process):
540 Don't save and restore environ; no longer needed.
541 * callproc.c (child_setup):
542 Use execve, not execvp, to preserve environ.
543
544 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
545
546 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
547
548 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
549
550 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
551 display for sliced images (Bug#10500).
552
553 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
554
555 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
556
557 * doc.c (Fdocumentation): Re-add handling of function-documentation,
558 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
559
560 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
561
562 * xdisp.c (window_outdated): Remove eassert since it hits
563 some suspicious corner cases (see Bug#13007 and Bug#13012).
564 (mode_line_update_needed): New function.
565 (redisplay_internal, redisplay_window): Use it.
566 (ensure_selected_frame): New function.
567 (redisplay_internal, unwind_redisplay): Use it.
568 (redisplay_internal): Move comment about buffer_shared...
569 (buffer_shared_and_changed): ...near to its real use.
570
571 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
572
573 * callproc.c (Fcall_process): Don't misreport vfork failure.
574
575 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
576
577 * callproc.c (Fcall_process): Fix vfork portability problems.
578 Do not assume that fd[0], count, filefd, and save_environ survive
579 vfork. Fix bug whereby wrong errno value could be reported for
580 pipe failure. Some minor cleanups, too, as follows. Move buf and
581 bufsize to the context where they're needed. Change new_argv to
582 be of type char **, as this is more convenient and avoids casts.
583 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
584 Now local constants, not macros.
585
586 2012-11-18 Kenichi Handa <handa@gnu.org>
587
588 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
589 for the variable "f".
590
591 2012-11-13 Kenichi Handa <handa@gnu.org>
592
593 * font.c (font_unparse_xlfd): Exclude special characters from the
594 generating XLFD name.
595
596 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
597
598 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
599 * dired.c (stat_uname, stat_gname):
600 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
601
602 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
603 * dired.c (directory_files_internal, file_name_completion):
604 Assume EAGAIN and EINTR are defined.
605
606 * fileio.c (Fcopy_file): Assume EISDIR is defined.
607 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
608 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
609 * lread.c (readbyte_from_file): Assume EINTR is defined.
610 * process.c (wait_reading_process_output, send_process) [subprocesses]:
611 Assume EIO and EAGAIN are defined.
612 * unexcoff.c (write_segment): Assume EFAULT is defined.
613
614 2012-11-27 Eli Zaretskii <eliz@gnu.org>
615
616 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
617 (Bug#11964)
618
619 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
620 highlighting on the frame was cleared. Prevents assertion
621 violations when repeatedly clicking on the "Top" link of the
622 "bread-crumbs" in Info buffers.
623
624 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
625
626 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
627
628 2012-11-24 Ken Brown <kbrown@cornell.edu>
629
630 * keyboard.c (HAVE_MOUSE):
631 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
632 were always defined.
633
634 2012-11-24 Eli Zaretskii <eliz@gnu.org>
635
636 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
637 between bpos_covered and bpos_max. This fixes cursor display when
638 several display strings follow each other.
639
640 * .gdbinit (pgx): If the glyph's object is a string, display the
641 pointer to string data, rather than the value of the string object
642 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
643
644 * indent.c (Fvertical_motion): If the starting position is covered
645 by a display string, return to one position before that, to avoid
646 overshooting it inside move_it_to. (Bug#12930)
647
648 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
649
650 * frame.h (struct frame): Remove display_preempted member
651 since all users are dead long ago.
652 * nsterm.h (struct x_output): Use the only dummy member.
653 * w32menu.c (pending_menu_activation): Remove since not
654 really used.
655 (set_frame_menubar): Adjust user.
656 * w32term.h (struct x_output): Drop outdated #if 0 code.
657 (struct w32_output): Use bitfields for explicit_parent,
658 asked_for_visible and menubar_active members. Drop
659 unused pending_menu_activation member.
660 * xterm.h (struct x_output): Drop outdated #if 0 code.
661 Use bitfields for explicit_parent, asked_for_visible,
662 has_been_visible and net_wm_state_hidden_seen members.
663
664 2012-11-23 Eli Zaretskii <eliz@gnu.org>
665
666 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
667 of a literal "/". (Bug#12955)
668 (gl-stamp): Invoke fc.exe directly, not through cmd.
669
670 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
671
672 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
673 * dired.c: Assume HAVE_DIRENT_H.
674 (NAMLEN): Remove, replacing with ...
675 (dirent_namelen): New function. All uses changed. Use the GNU macro
676 _D_EXACT_NAMELEN if available, as it's faster than strlen.
677 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
678 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
679 * makefile.w32-in (DIR_H): Remove. All uses replaced with
680 $(NT_INC)/dirent.h.
681 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
682 * ndir.h: Rename to ../nt/inc/dirent.h.
683 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
684 Do not include <dirent.h>; no longer needed.
685 * w32.c: Include <dirent.h> rather than "ndir.h".
686
687 2012-11-23 Chong Yidong <cyd@gnu.org>
688
689 * xftfont.c (xftfont_open): Remove duplicate assignment.
690
691 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
692
693 * alloc.c (Fgarbage_collect): Unblock input after clearing
694 gc_in_progress to avoid note_mouse_highlight glitch with GC.
695 * frame.h (FRAME_MOUSE_UPDATE): New macro.
696 * msdos.c (IT_frame_up_to_date): Use it here...
697 * w32term.c (w32_frame_up_to_date): ...here...
698 * xterm.c (XTframe_up_to_date): ...and here...
699 * nsterm.m (ns_frame_up_to_date): ...but not here.
700 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
701 Adjust users.
702 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
703 Do not check whether GC is in progress.
704
705 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
706
707 * xdisp.c (window_buffer_changed): New function.
708 (update_menu_bar, update_tool_bar): Use it to
709 simplify large 'if' statements.
710 (redisplay_internal): Generalize commonly used
711 'tail' and 'frame' local variables.
712
713 2012-11-22 Eli Zaretskii <eliz@gnu.org>
714
715 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
716 with Windows system header.
717
718 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
719
720 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
721 * alloc.c: Assume unistd.h exists.
722 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
723 * sysdep.c (get_current_dir_name): Assume getcwd exists.
724 (getwd) [USG]: Remove; no longer needed.
725 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
726 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
727 * w32.h (getcwd): Remove decl.
728
729 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
730
731 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
732 Make it set selected_window as well.
733 (update_tool_bar): Use it.
734
735 2012-11-21 Ken Brown <kbrown@cornell.edu>
736
737 * emacs.c (main): Set the G_SLICE environment variable for all
738 Cygwin builds, not just GTK builds. See
739 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
740
741 2012-11-21 Eli Zaretskii <eliz@gnu.org>
742
743 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
744 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
745 Define for the MSVC compiler.
746
747 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
748
749 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
750 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
751 dostounix_filename. Prevents crashes down the road, because
752 dostounix_filename assumes it gets a unibyte string. Reported by
753 Michel de Ruiter <michel@sentient.nl>, see
754 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
755
756 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
757
758 Conflate Qnil and Qunbound for `symbol-function'.
759 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
760 * lread.c (init_obarray): Set `function' fields to Qnil.
761 * eval.c (Fcommandp): Ignore Qunbound.
762 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
763 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
764 Test NILP rather than Qunbound.
765 (Ffmakunbound): Set to Qnil.
766 (Fsymbol_function): Never signal an error.
767 (Finteractive_form): Ignore Qunbound.
768
769 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
770
771 * eval.c (interactive_p): Remove no-longer-used decl.
772
773 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
774
775 * xdisp.c (buffer_shared): Adjust comment.
776 (buffer_shared_and_changed): New function.
777 (prepare_menu_bars, redisplay_internal): Use it to
778 decide whether all windows or frames should be updated.
779 (window_outdated): New function.
780 (text_outside_line_unchanged_p, redisplay_window): Use it.
781 (redisplay_internal): Likewise. Fix indentation.
782
783 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
784
785 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
786 (syms_of_eval): Remove corresponding defsubr.
787 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
788
789 2012-11-19 Daniel Colascione <dancol@dancol.org>
790
791 * w32fns.c (Fx_file_dialog):
792 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
793 cygwin_convert_file_name*.
794
795 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
796 Rename cygwin_convert_path* to cygwin_convert_file_name*.
797
798 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
799
800 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
801
802 2012-11-18 Eli Zaretskii <eliz@gnu.org>
803
804 * w32select.c: Include w32common.h before w32term.h, so that
805 windows.h gets included before w32term.h uses some of its
806 features, see below.
807
808 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
809 New typedefs.
810 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
811 New prototypes.
812 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
813
814 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
815
816 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
817 (ns_select): Return at once if events are held (Bug#12834).
818
819 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
820
821 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
822 Needed following 2012-10-20 change. (Bug#12902)
823
824 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
825
826 * w32proc.c (waitpid): Remove unused label get_result.
827
828 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
829
830 * makefile.w32-in (SYSWAIT_H): New macro.
831 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
832 ($(BLD)/sysdep.$(O)): Update dependencies.
833
834 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
835
836 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
837 * callproc.c (relocate_fd): Assume F_DUPFD.
838 * emacs.c, term.c (O_RDWR): Remove.
839 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
840 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
841 * nsterm.m: Assume <fcntl.h> exists.
842 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
843 (create_pty, Fmake_network_process, server_accept_connection)
844 (wait_reading_process_output, init_process_emacs):
845 Assume O_NONBLOCK.
846 (wait_reading_process_output): Put in a special case for WINDOWSNT
847 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
848 It's not clear this is needed, but it's a more-conservative change.
849 (create_process): Assume FD_CLOEXEC.
850 (create_process, create_pty): Assume O_NOCTTY.
851 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
852 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
853 Omit if not DOS_NT, since F_GETFL is not defined there.
854 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
855 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
856 (O_NOCTTY): Remove.
857 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
858 lack it, since gnulib guarantees this.
859 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
860
861 2012-11-17 Eli Zaretskii <eliz@gnu.org>
862
863 * w32.c (faccessat): Pretend that directories have the execute bit
864 set. Emacs expects that, e.g., in files.el:cd-absolute.
865
866 * w32proc.c (create_child): Don't clip the PID of the child
867 process to fit into an Emacs integer, as this is no longer a
868 restriction.
869 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
870 reaping only the process specified by PID argument, if that is
871 positive. Use PID instead of dead_child to know which process to
872 reap. Wait for the child to die only if WNOHANG is not in
873 OPTIONS.
874 (sys_select): Don't set dead_child.
875
876 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
877 as it is no longer needed.
878
879 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
880 no longer needed.
881 (record_child_status_change): Remove the setting of
882 record_at_most_one_child for the !WNOHANG case.
883
884 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
885
886 Fix problems in ns port found by static checking.
887 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
888 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
889 not to process group.
890 (ns_select): Use emacs_write, not write, as that's more robust
891 in the presence of signals.
892 (fd_handler:): Check for read errors.
893
894 2012-11-16 Glenn Morris <rgm@gnu.org>
895
896 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
897
898 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
899
900 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
901
902 2012-11-16 Eli Zaretskii <eliz@gnu.org>
903
904 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
905 use the same value of thread handle.
906 (start_timer_thread): If the timer thread exited (due to error),
907 clean up by closing the two handles it used. Duplicate the caller
908 thread's handle here, so it gets duplicated only once, when
909 launching the timer thread. Set priority of the timer thread, not
910 the caller thread.
911 (getitimer): Don't duplicate the caller thread's handle here.
912 (Bug#12832)
913
914 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
915
916 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
917 called (Bug#12834).
918
919 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
920
921 Remove no-longer-used pty_max_bytes variable.
922 * process.c (pty_max_bytes): Remove; unused.
923 (send_process): Do not set it.
924
925 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
926
927 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
928 Update dependencies.
929
930 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
931
932 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
933 This follows up on the 2012-09-29 patch that removed indirection
934 for the 'function' field. Reported by Sergey Vinokurov in
935 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
936
937 2012-11-14 Eli Zaretskii <eliz@gnu.org>
938
939 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
940 different name, as the MS runtime does not have such a function,
941 and probably never will.) All callers changed. Ignore DIRFD
942 value if PATH is an absolute file name, to match Posix spec
943 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
944 symlinks.
945
946 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
947
948 * xdisp.c (echo_area_display, redisplay_internal):
949 Omit redundant check whether frame_garbaged is set.
950
951 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
952
953 Use faccessat, not access, when checking file permissions (Bug#12632).
954 This fixes a bug that has been present in Emacs since its creation.
955 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
956 which must set some sort of record. (Torek's bug report was against
957 a predecessor of GNU Emacs, but GNU Emacs happened to have the
958 same common flaw.) See Torek's Usenet posting
959 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
960 Posted: Fri Apr 8 14:18:56 1983.
961 * Makefile.in (LIB_EACCESS): New macro.
962 (LIBES): Use it.
963 * callproc.c (init_callproc):
964 * charset.c (init_charset):
965 * fileio.c (check_existing, check_executable, check_writable)
966 (Ffile_readable_p):
967 * lread.c (openp, load_path_check):
968 * process.c (allocate_pty):
969 * xrdb.c (file_p):
970 Use effective UID when checking permissions, not real UID.
971 * callproc.c (init_callproc):
972 * charset.c (init_charset):
973 * lread.c (load_path_check, init_lread):
974 Test whether directories are accessible, not merely whether they exist.
975 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
976 * fileio.c (check_existing, check_executable, check_writable)
977 (Ffile_readable_p):
978 Use symbolic names instead of integers for the flags, as they're
979 portable now.
980 (check_writable): New arg AMODE. All uses changed.
981 Set errno on failure.
982 (Ffile_readable_p): Use faccessat, not stat + open + close.
983 (Ffile_writable_p): No need to call check_existing + check_writable.
984 Just call check_writable and then look at errno. This saves a syscall.
985 dir should never be nil; replace an unnecessary runtime check
986 with an eassert. When checking the parent directory of a nonexistent
987 file, check that the directory is searchable as well as writable, as
988 we can't create files in unsearchable directories.
989 (file_directory_p): New function, which uses 'stat' on most platforms
990 but faccessat with D_OK (for efficiency) if WINDOWSNT.
991 (Ffile_directory_p, Fset_file_times): Use it.
992 (file_accessible_directory_p): New function, which uses a single
993 syscall for efficiency.
994 (Ffile_accessible_directory_p): Use it.
995 * xrdb.c (file_p): Use file_directory_p.
996 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
997 * lread.c (openp): When opening a file, use fstat rather than
998 stat, as that avoids a permissions race. When not opening a file,
999 use file_directory_p rather than stat.
1000 (dir_warning): First arg is now a usage string, not a format.
1001 Use errno. All uses changed.
1002 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
1003 that merely introduced a race.
1004 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
1005 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
1006 and similarly for the other O_* flags.
1007 * w32.c (sys_faccessat): Rename from sys_access and switch to
1008 faccessat's API. All uses changed.
1009 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
1010 (magic_db): Rename from magic_file_p.
1011 (magic_db, search_magic_path): Return an XrmDatabase rather than a
1012 char *, so that we don't have to test for file existence
1013 separately from opening the file for reading. This removes a race
1014 fixes a permission-checking problem, and simplifies the code.
1015 All uses changed.
1016 (file_p): Remove; no longer needed.
1017
1018 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
1019
1020 Omit glyphs initialization at startup.
1021 * dispnew.c (glyphs_initialized_initially_p): Remove.
1022 (adjust_frame_glyphs_initially): Likewise. Adjust users.
1023 (Fredraw_frame): Move actual code from here...
1024 (redraw_frame): ...to here. Add eassert. Adjust comment.
1025 (Fredraw_display): Use redraw_frame.
1026 * xdisp.c (clear_garbaged_frames): Likewise.
1027
1028 2012-11-13 Eli Zaretskii <eliz@gnu.org>
1029
1030 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
1031 passed to pint2str and pint2hrstr to be at most the size of the
1032 frame's decode_mode_spec_buffer. This avoids crashes with very
1033 large values of FIELD_WIDTH argument to decode_mode_spec.
1034 (Bug#12867)
1035
1036 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
1037
1038 Fix a race with verify-visited-file-modtime (Bug#12863).
1039 Since at least 1991 Emacs has ignored an mtime difference of no
1040 more than one second, but my guess is that this was to work around
1041 file system bugs that were fixed long ago. Since the race is
1042 causing problems now, let's remove that code.
1043 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
1044 whose time stamp is off by no more than a second. Insist that the
1045 file time stamps match exactly.
1046
1047 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1048
1049 * frame.h (struct frame): Convert external_tool_bar member to
1050 1-bit unsigned bitfield.
1051 * termhooks.h (struct terminal): Remove mouse_moved member since
1052 all users are long dead. Adjust comment on mouse_position_hook.
1053
1054 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1055
1056 Simplify by using FOR_EACH_FRAME here and there.
1057 * frame.c (next_frame, prev_frame, other_visible_frames)
1058 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
1059 * w32term.c (x_window_to_scroll_bar): Likewise.
1060 * window.c (window_list): Likewise.
1061 * xdisp.c (x_consider_frame_title): Likewise.
1062 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
1063 * xfns.c (x_window_to_frame, x_any_window_to_frame)
1064 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
1065 * xmenu.c (menubar_id_to_frame): Likewise.
1066 * xselect.c (frame_for_x_selection): Likewise.
1067 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
1068 (x_window_to_menu_bar): Likewise.
1069 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
1070
1071 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
1072
1073 * data.c (Qdefalias_fset_function): Now static.
1074
1075 Another tweak to vectorlike_header change.
1076 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
1077 Remove, and replace all uses with ...
1078 (next_in_free_list, set_next_in_free_list):
1079 New functions, which respect C's aliasing rules better.
1080
1081 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
1082
1083 * window.c (list4i): Rename from 'quad'. All uses changed.
1084 Needed because <sys/types.h> defines 'quad' on Solaris 10.
1085
1086 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
1087
1088 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
1089 warning about mixing declarations and code in ISO C90.
1090
1091 2012-11-10 Martin Rudalics <rudalics@gmx.at>
1092
1093 * window.c (Fsplit_window_internal): Set combination limit of
1094 new parent window to t iff Vwindow_combination_limit is t;
1095 fixing a regression introduced with the change from 2012-09-22.
1096 (Fset_window_combination_limit): Fix doc-string.
1097
1098 2012-11-10 Eli Zaretskii <eliz@gnu.org>
1099
1100 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
1101 amount when the scroll margins are too large. When scrolling
1102 backwards in the buffer, give up if cannot reach point or the
1103 scroll margin within a reasonable number of screen lines.
1104 Fixes point position in window under scroll-up/down-aggressively when
1105 point is positioned many lines beyond the window top/bottom.
1106 (Bug#12811)
1107
1108 * ralloc.c (relinquish): If real_morecore fails to return memory
1109 to the system, don't crash; instead, leave the last heap
1110 unchanged and return. (Bug#12774)
1111
1112 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1113
1114 * lisp.h (AUTOLOADP): New macro.
1115 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
1116 * data.c (Ffset): Remove special ad-advice-info handling.
1117 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
1118 (Fsubr_arity): CSE.
1119 (Finteractive_form): Simplify.
1120 (Fquo): Don't insist on having at least 2 arguments.
1121 (Qdefalias_fset_function): New var.
1122
1123 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1124
1125 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
1126
1127 * nsfont.m (Qcondensed, Qexpanded): New variables.
1128 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
1129 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
1130
1131 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1132
1133 Fix recently introduced crash on MS-Windows (Bug#12839).
1134 * w32term.h (struct scroll_bar): Use convenient header.
1135 (SCROLL_BAR_VEC_SIZE): Remove.
1136 * w32term.c (x_scroll_bar_create): Use VECSIZE.
1137
1138 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1139
1140 Tweak last vectorlike_header change.
1141 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
1142 vectorlike object on the free list. This is introduced to avoid
1143 some (but not all) pointer casting and aliasing problems, see
1144 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
1145 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
1146 objects.
1147 (xvectype, xvecsize): Use them to examine Lisp_Object values.
1148
1149 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1150
1151 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
1152 been removed, so remove them here also.
1153
1154 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1155
1156 * doc.c (Fdocumentation): Handle new property
1157 dynamic-docstring-function to replace the old ad-advice-info.
1158
1159 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
1160
1161 * fns.c (Qeql, hashtest_eq): Now static.
1162
1163 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1164
1165 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
1166 * fns.c (hashfn_eq, hashfn_eql, sxhash):
1167 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
1168 * buffer.c (compare_overlays): Use XLI rather than XHASH.
1169
1170 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
1171
1172 Use same hash function for hashfn_profiler as for hash_string etc.
1173 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
1174 * lisp.h (sxhash_combine): New inline function, with the contents
1175 of the old SXHASH_COMBINE.
1176 * profiler.c (hashfn_profiler): Use it, instead of having a
1177 special hash function containing a comparison that always yields 1.
1178
1179 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1180
1181 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
1182 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
1183 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
1184 Remove unused vars.
1185
1186 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
1187
1188 * image.c (xpm_make_color_table_h): Fix compiler error because
1189 make_hash_table changed.
1190
1191 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
1192
1193 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
1194
1195 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1196
1197 Use ad-hoc comparison function for the profiler's hash-tables.
1198 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
1199 (make_log): Use them.
1200 (handle_profiler_signal): Don't inhibit quit any longer since we don't
1201 call Fequal any more.
1202 (Ffunction_equal): New function.
1203 (cmpfn_profiler, hashfn_profiler): New functions.
1204 (syms_of_profiler): Initialize them.
1205 * lisp.h (struct hash_table_test): New struct.
1206 (struct Lisp_Hash_Table): Use it.
1207 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
1208 * fns.c (make_hash_table): Take a struct to describe the test.
1209 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1210 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
1211 (hash_lookup, hash_remove_from_table): Move assertion checking of
1212 hashfn result here. Check hash-equality before calling cmpfn.
1213 (Fmake_hash_table): Adjust call to make_hash_table.
1214 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
1215 (syms_of_fns): Initialize them.
1216 * emacs.c (main): Move syms_of_fns earlier.
1217 * xterm.c (syms_of_xterm):
1218 * category.c (hash_get_category_set): Adjust call to make_hash_table.
1219 * print.c (print_object): Adjust to new hash-table struct.
1220 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
1221
1222 2012-11-08 Eli Zaretskii <eliz@gnu.org>
1223
1224 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
1225 value of w32-scroll-lock-modifier is neither nil nor one of the
1226 known key modifiers. (Bug#12806)
1227
1228 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1229
1230 Shrink struct vectorlike_header to the only size field.
1231 * lisp.h (enum pvec_type): Avoid explicit enum member values.
1232 Adjust comment.
1233 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
1234 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
1235 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
1236 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
1237 information from the vector header. Adjust comment.
1238 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
1239 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
1240 layout.
1241 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
1242 (struct vectorlike_header): Remove next member. Adjust comment.
1243 (struct Lisp_Subr): Add convenient header. Adjust comment.
1244 (allocate_pseudovector): Adjust prototype.
1245 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1246 (sweep_string, lisp_malloc): Remove useless prototypes.
1247 (enum mem_type): Adjust comment.
1248 (NEXT_IN_FREE_LIST): New macro.
1249 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1250 (Fmake_bool_vector): Likewise.
1251 (struct large_vector): New type to represent allocation unit for
1252 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1253 (large_vectors): Change type to struct large_vector.
1254 (allocate_vector_from_block): Simplify.
1255 (PSEUDOVECTOR_NBYTES): Replace with...
1256 (vector_nbytes): ...new function. Adjust users.
1257 (sweep_vectors): Adjust processing of large vectors.
1258 (allocate_vectorlike): Likewise.
1259 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1260 Add easserts. Adjust XSETPVECTYPESIZE usage.
1261 (allocate_buffer): Use BUFFER_PVEC_INIT.
1262 (live_vector_p): Adjust to match large vector.
1263 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1264 * buffer.h (struct buffer): Add next member.
1265 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1266 New macros.
1267 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1268 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1269 (copy_hash_table): Adjust to match vector header change.
1270 * lread.c (defsubr): Use XSETPVECTYPE.
1271 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1272 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1273 (xvecsize): New command.
1274
1275 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1276
1277 * keyboard.c (event_to_kboard): Do not dereference
1278 frame_or_window field of SELECTION_REQUEST_EVENT
1279 and SELECTION_CLEAR_EVENT events (Bug#12814).
1280 * xterm.h (struct selection_input_event): Adjust comment.
1281
1282 2012-11-07 Eli Zaretskii <eliz@gnu.org>
1283
1284 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1285 such as Scroll Lock, if the respective keys are treated as
1286 function keys, not as modifiers. This avoids destroying non-ASCII
1287 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
1288
1289 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1290
1291 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1292
1293 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1294
1295 Restore some duplicate definitions (Bug#12814).
1296 This undoes part of the 2012-11-03 changes. Some people build
1297 with plain -g rather than with -g3, and they need the duplicate
1298 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1299 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1300 Define as macros, as well as as enums or as constants.
1301
1302 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1303
1304 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1305 to keypad keys (Bug#12816).
1306
1307 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1308
1309 Minor adjustments of recently-changed frame functions.
1310 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1311 known to be a frame (we're in the FRAMEP branch).
1312 * lisp.h (Qframep): Remove decl. frame.h declares this.
1313 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1314 since they're meant for Lisp fixnum values.
1315
1316 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1317
1318 * window.c (Fwindow_combination_limit): Revert to the only
1319 required argument and adjust docstring as suggested in
1320 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1321 by Martin Rudalics <rudalics@gmx.at>.
1322
1323 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1324
1325 Widely used frame validity and checking functions.
1326 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1327 * frame.c (decode_live_frame, decode_any_frame): New functions.
1328 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1329 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1330 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1331 (Fframe_pointer_visible_p): Use decode_any_frame.
1332 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1333 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1334 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1335 (Fframe_focus): Likewise. Allow zero number of arguments.
1336 Adjust docstring.
1337 (frame_buffer_list, frame_buffer_predicate): Remove.
1338 * lisp.h (frame_buffer_predicate): Remove prototype.
1339 * buffer.c (Fother_buffer): Use decode_any_frame.
1340 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1341 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1342 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1343 (Fclose_font, Ffont_info): Use decode_live_frame.
1344 * fontset.c (check_fontset_name): Likewise.
1345 * terminal.c (Fframe_terminal): Likewise.
1346 * w32fns.c (check_x_frame): Likewise.
1347 * window.c (Fminibuffer_window, Fwindow_at)
1348 (Fcurrent_window_configuration): Likewise.
1349 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1350 Likewise. Allow zero number of arguments. Adjust docstring.
1351 * dispnew.c (Fredraw_frame): Likewise.
1352 * xfaces.c (frame_or_selected_frame): Remove.
1353 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1354 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1355 (Fframe_face_alist): Use decode_live_frame.
1356 * xfns.c (check_x_frame): Likewise.
1357
1358 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1359
1360 * window.c (quad): New function.
1361 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1362 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1363 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1364 (Fwindow_line_height): Use it.
1365 (Fwindow_fringes): Use list3.
1366 (Fwindow_scroll_bars): Use list4.
1367 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1368 (Fwindow_combination_limit): Allow zero number of arguments.
1369
1370 2012-11-05 Eli Zaretskii <eliz@gnu.org>
1371
1372 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1373
1374 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
1375 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
1376 file descriptor 2 for standard error. (Bug#12805)
1377
1378 2012-11-05 Chong Yidong <cyd@gnu.org>
1379
1380 * process.c (wait_reading_process_output): Revert previous change.
1381
1382 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1383
1384 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1385 This removes code that has been obsolete since around 1990.
1386 * callproc.c (Fcall_process):
1387 * emacs.c (main):
1388 * process.c (create_process):
1389 * term.c (dissociate_if_controlling_tty):
1390 Assume setsid exists.
1391 * callproc.c (child_setup): Assume setpgid exists and behaves as
1392 per POSIX.1-1988 or later.
1393 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1394 * emacs.c (shut_down_emacs):
1395 * sysdep.c (sys_suspend, init_foreground_group):
1396 Assume getpgrp behaves as per POSIX.1-1998 or later.
1397 * msdos.c (setpgrp): Remove.
1398 (tcgetpgrp, setpgid, setsid): New functions.
1399 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1400 * term.c (no_controlling_tty): Remove; unused.
1401 * w32proc.c (setpgrp): Remove.
1402 (setsid, tcgetpgrp): New functions.
1403
1404 Simplify by assuming __fpending.
1405 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1406 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1407 Do not assume that __fpending's result fits in int.
1408
1409 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1410
1411 Remove EMACS_OUTQSIZE+sleep hack.
1412 * dispnew.c (update_frame_1): Remove hack for terminals slower
1413 than 2400 bps, which throttled Emacs by having it sleep.
1414 This code hasn't worked since at least 2007, when the multi-tty stuff
1415 was added, and anyway those old terminals are long dead.
1416 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1417 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1418
1419 Fix data-loss with --version (Bug#9574).
1420 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1421 as we can't assume that emacs_strerror is initialized, and strerror
1422 is good enough here.
1423 (main): Invoke atexit earlier, to catch earlier instances of
1424 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1425
1426 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1427
1428 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1429 (keyDown): Remap keypad keys to X11 virtual key codes.
1430
1431 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1432
1433 Fix data-loss with --batch (Bug#9574).
1434 * emacs.c: Include <close-stream.h>.
1435 (close_output_streams): New function.
1436 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1437 and handles errors appropriately.
1438 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1439 does that now.
1440
1441 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1442 The symptom is a diagnostic "GLib-WARNING **: In call to
1443 g_spawn_sync(), exit status of a child process was requested but
1444 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1445 waitpid(), so exit status can't be returned." The diagnostic
1446 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1447 The real bug is a race condition between Emacs and glib: Emacs
1448 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1449 so that glib can't find it. Work around the bug by invoking
1450 waitpid only on subprocesses that Emacs itself creates.
1451 * process.c (create_process, record_child_status_change):
1452 Don't use special value -1 in pid field, as the caller now must
1453 know the pid rather than having the callee infer it.
1454 The inference was sometimes incorrect anyway, due to another race.
1455 (create_process): Set new 'alive' member if child is created.
1456 (process_status_retrieved): New function.
1457 (record_child_status_change): Use it.
1458 Accept negative 1st argument, which means to wait for the
1459 processes that Emacs already knows about. Move special-case code
1460 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1461 processes that have already been waited for, by testing and
1462 clearing new 'alive' member.
1463 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1464 now does this internally.
1465 (handle_child_signal): Let record_child_status_change do all
1466 the work, since we do not want to reap all exited child processes,
1467 only the child processes that Emacs itself created.
1468 * process.h (Lisp_Process): New boolean member 'alive'.
1469
1470 Omit duplicate definitions no longer needed with gcc -g3.
1471 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1472 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1473 Define only as macros. There's no longer any need to also define
1474 these symbols as enums or as constants, since we now assume
1475 gcc -g3 when debugging.
1476
1477 2012-11-03 Eli Zaretskii <eliz@gnu.org>
1478
1479 * lisp.mk: Adjust comments to the fact that term/internal is now
1480 loaded from loadup.el.
1481
1482 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1483 (msdos_fatal_signal): New function.
1484 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1485 its argument list.
1486
1487 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1488 for GCC versions before 4.
1489 (emacs_raise): Define to call msdos_fatal_signal.
1490
1491 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1492 iterator when starting in the middle of a display or overlay
1493 string. (Bug#12745)
1494
1495 2012-11-03 Chong Yidong <cyd@gnu.org>
1496
1497 * process.c (wait_reading_process_output): Clean up the last
1498 change.
1499
1500 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1501
1502 * process.c (wait_reading_process_output): Avoid a race condition
1503 with SIGIO delivery (Bug#11536).
1504
1505 2012-11-03 Chong Yidong <cyd@gnu.org>
1506
1507 * buffer.c (cursor_type): Untabify docstring.
1508
1509 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1510
1511 * frame.h (struct frame): Drop can_have_scroll_bars member
1512 which is meaningless for a long time. Adjust comments.
1513 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1514 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1515
1516 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1517
1518 * window.c (decode_next_window_args): Update window arg after
1519 calling decode_live_window and so fix crash reported at
1520 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1521 by Juanma Barranquero <lekktu@gmail.com>.
1522 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1523 * font.c (Ffont_at): Likewise.
1524
1525 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1526
1527 * widget.c (resize_cb): New function.
1528 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1529 (EmacsFrameResize): Check if all is up to date before changing frame
1530 size.
1531
1532 2012-11-02 Eli Zaretskii <eliz@gnu.org>
1533
1534 Implement backtrace output for fatal errors on MS-Windows.
1535 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1536 (BACKTRACE_LIMIT_MAX): New macro.
1537 (w32_backtrace): New function.
1538 (emacs_abort): Use w32_backtrace when the user chooses not to
1539 attach a debugger. Update the text of the abort dialog.
1540
1541 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1542
1543 Window-related stuff cleanup here and there.
1544 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1545 Use decode_any_window.
1546 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1547 * xdisp.c (Fformat_mode_line): Likewise.
1548 * font.c (Ffont_at): Use decode_live_window.
1549 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1550 * window.c (decode_next_window_args): Likewise.
1551 (decode_any_window): Remove static.
1552 * window.h (decode_any_window): Add prototype.
1553 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1554 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1555 respectively.
1556
1557 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1558
1559 Remove pad from struct input_event.
1560 * termhooks.h (struct input_event): Remove padding field.
1561 Adjust comment.
1562 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1563 member is never cons for a long time. Adjust comment.
1564 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1565 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1566 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1567 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1568
1569 2012-11-01 Eli Zaretskii <eliz@gnu.org>
1570
1571 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1572
1573 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1574
1575 Fix crash when using Emacs as commit editor for git (Bug#12697).
1576 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1577 and it is configured in conf_post.h.
1578 (Fcall_process): Don't invoke both setsid and setpgid; the former
1579 is enough, if it exists.
1580 * callproc.c (Fcall_process, child_setup):
1581 * process.c (create_process): Use setpgid.
1582 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1583 for the real thing.
1584 * dispnew.c (init_display): Initialize the foreground group
1585 if we are running a tty display.
1586 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1587 * lisp.h (init_foreground_group): New decl.
1588 * sysdep.c (inherited_pgroup): New static var.
1589 (init_foreground_group, tcsetpgrp_without_stopping)
1590 (narrow_foreground_group, widen_foreground_group): New functions.
1591 (init_sys_modes): Narrow foreground group.
1592 (reset_sys_modes): Widen foreground group.
1593
1594 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
1595
1596 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1597
1598 2012-10-31 Martin Rudalics <rudalics@gmx.at>
1599
1600 * minibuf.c (read_minibuf): Restore current buffer since
1601 choose_minibuf_frame calling Fset_frame_selected_window may
1602 change it (Bug#12766).
1603
1604 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1605
1606 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1607
1608 2012-10-30 Kenichi Handa <handa@gnu.org>
1609
1610 * font.c (Ffont_at): If WINDOW is specified and it is not
1611 displaying the current buffer, signal an error.
1612
1613 2012-10-29 Daniel Colascione <dancol@dancol.org>
1614
1615 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1616 In preparation for fixing bug#12739, move these functions from
1617 here...
1618
1619 * coding.h, coding.c: ... to here, and compile them only when
1620 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1621 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1622
1623 2012-10-28 Eli Zaretskii <eliz@gnu.org>
1624
1625 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1626 (timer_loop, getitimer, setitimer): Use it instead of
1627 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1628 'clock'.
1629 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1630 literal 10000.
1631
1632 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1633
1634 * nsterm.m (NO_APPDEFINED_DATA): New define.
1635 (last_appdefined_event_data): New variable
1636 (last_appdefined_event): Remove.
1637 (ns_select): Initialize t from last_appdefined_event_data instead
1638 of [last_appdefined_event data1].
1639 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1640 remove last_appdefined_event (Bug#12698).
1641
1642 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1643
1644 * frame.c (x_set_font): Catch internal error.
1645
1646 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1647
1648 Avoid overflow in w32 implementation of interval timers.
1649 When possible, for ITIMER_PROF count only times the main thread
1650 actually executes.
1651 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1652 'volatile ULONGLONG' types. All the other data which was
1653 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1654 (GetThreadTimes_Proc): New typedef.
1655 (w32_get_timer_time): New function, returns a suitable time value
1656 for the timer.
1657 (timer_loop): Enter critical section when accessing ULONGLONG
1658 values of the itimer_data struct, as these accesses are no longer
1659 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1660 Remove unused variable.
1661 (init_timers): Initialize s_pfn_Get_Thread_Times.
1662 (start_timer_thread): Don't assign itimer->caller_thread here.
1663 (getitimer): Assign itimer->caller_thread here.
1664 (setitimer): Always call getitimer to get the value of ticks_now.
1665 (sys_spawnve): Avoid compiler warning about format mismatch.
1666
1667 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1668
1669 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1670 mouse movement events if the menu bar is active. This avoids
1671 producing a busy "hour-glass" cursor by Windows if the mouse
1672 pointer is positioned over a tooltip shown for some menu item.
1673
1674 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1675
1676 Don't assume process IDs fit in int.
1677 * emacs.c (shut_down_emacs) [!DOS_NT]:
1678 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1679 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1680 Use pid_t, not int, to store process IDs, as 'int'
1681 is not wide enough on a few platforms (e.g., AIX and IRIX).
1682
1683 2012-10-23 Kenichi Handa <handa@gnu.org>
1684
1685 The following change is to make face-font-rescale-alist work
1686 correctly for non-ASCII fonts.
1687
1688 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1689 (font_open_for_lface): Handle Vface_font_rescale_alist.
1690
1691 2012-10-23 Chong Yidong <cyd@gnu.org>
1692
1693 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1694
1695 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1696
1697 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1698 for screen font.
1699 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1700
1701 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1702 event (Bug#12681).
1703
1704 2012-10-21 Glenn Morris <rgm@gnu.org>
1705
1706 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1707
1708 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1709
1710 Port to OpenBSD 5.1.
1711 * frame.c (Fmouse_position, Fmouse_pixel_position):
1712 * xdisp.c (produce_stretch_glyph):
1713 Declare local vars only when they're needed.
1714 This is clearer and avoids a warning on OpenBSD about unused vars.
1715 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1716 This is safer, and avoids OpenBSD warnings about unused vars.
1717 * keyboard.c (record_menu_key): Remove unnecessary decl.
1718 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1719 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1720 as our definition clashes with OpenBSD's.
1721 * xfaces.c (load_face_colors, check_lface_attrs)
1722 (get_lface_attributes_no_remap, get_lface_attributes)
1723 (lface_fully_specified_p, x_supports_face_attributes_p)
1724 (tty_supports_face_attributes_p, face_fontset, realize_face)
1725 (realize_x_face, realize_tty_face):
1726 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1727 merely Lisp_Object *. This is more informative and avoids
1728 a warning on OpenBSD about accessing beyond an object's size.
1729
1730 2012-10-20 Chong Yidong <cyd@gnu.org>
1731
1732 * lread.c (Fload): Doc fix (Bug#12592).
1733
1734 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1735
1736 * font.c (Ffont_at): Fix previous change.
1737
1738 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1739
1740 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1741 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1742 for the reasons.
1743
1744 * alloc.c (NSTATICS): Decrease to 0x800.
1745
1746 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1747
1748 * fns.c (Fnreverse): Include the problem element when signaling an
1749 error (bug#12677).
1750
1751 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1752
1753 * nsterm.m (ns_select): Check writefds before call to
1754 FD_ISSET (Bug#12668).
1755
1756 2012-10-18 Daniel Colascione <dancol@dancol.org>
1757
1758 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1759 (staticpro): If we run out of staticpro slots, die with an
1760 informative error instead of just calling emacs_abort.
1761
1762 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1763
1764 Fix two flaws reported by Dmitry Antipov.
1765 * window.c (Ftemp_output_buffer_show): Remove.
1766 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1767 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1768
1769 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1770
1771 * makefile.w32-in ($(BLD)/w32.$(O)):
1772 ($(BLD)/vm-limit.$(O)):
1773 ($(BLD)/term.$(O)):
1774 ($(BLD)/unexw32.$(O)):
1775 ($(BLD)/fileio.$(O)):
1776 ($(BLD)/dispnew.$(O)): Update dependencies.
1777
1778 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1779 Add prototypes.
1780
1781 * w32proc.c: Include ctype.h.
1782
1783 * w32.h (init_environment, check_windows_init_file)
1784 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1785 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1786 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1787 (sys_link): Add prototypes.
1788
1789 * w32.c: Include w32select.h.
1790 (sys_access, e_malloc, sys_select): Add prototypes.
1791 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1792
1793 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1794
1795 * unexw32.c: Include lisp.h and w32.h.
1796
1797 * term.c [WINDOWSNT]: Include w32term.h.
1798
1799 * process.c [WINDOWSNT]: Add prototype of sys_select.
1800
1801 * fileio.c [WINDOWSNT]: Include w32.h.
1802
1803 * dispnew.c [WINDOWSNT]: Include w32.h.
1804
1805 * cygw32.c (Fcygwin_convert_path_to_windows)
1806 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1807 Lisp_Object values. (Bug#12661)
1808
1809 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1810 to Lisp_Object. (Bug#12661)
1811
1812 2012-10-17 Kenichi Handa <handa@gnu.org>
1813
1814 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1815 invalidate.
1816
1817 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1818
1819 * buffer.c (Fkill_buffer): When unchaining the marker,
1820 reset its buffer pointer to NULL (Bug#12652).
1821
1822 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1823
1824 Do not verify indirection counters of killed buffers (Bug#12579).
1825 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1826 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1827
1828 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1829
1830 * alloc.c (Fmake_byte_code): Fix typo in comment.
1831 * print.c (print_interval): Define as static to match prototype.
1832 * indent.c (disptab_matches_widthtab, recompute_width_table):
1833 Convert to eassert.
1834
1835 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1836
1837 * editfns.c (get_system_name): Remove.
1838 * lisp.h (get_system_name): Remove prototype.
1839 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1840 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1841
1842 2012-10-15 Daniel Colascione <dancol@dancol.org>
1843
1844 * dbusbind.c: Add comment explaining reason for previous change.
1845
1846 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1847
1848 * window.c (Fwindow_end): Rewrite check whether cached position
1849 can be used (Bug#12600).
1850 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1851 Set windows_or_buffers_changed.
1852
1853 2012-10-15 Daniel Colascione <dancol@dancol.org>
1854
1855 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1856 enabled by undefining the symbol "interface", which the platform
1857 headers define to something incompatible.
1858
1859 2012-10-14 Daniel Colascione <dancol@dancol.org>
1860
1861 * image.c (init_tiff_functions, init_imagemagick_functions)
1862 (init_svg_functions): Fix cygw32 build break by using these
1863 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1864
1865 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1866
1867 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1868
1869 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1870
1871 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1872
1873 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1874
1875 * coding.c (detect_coding): Set coding->id before calling
1876 this->detector.
1877
1878 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1879
1880 * fileio.c: Formatting fixes.
1881
1882 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1883
1884 Fix some stat-related races.
1885 * fileio.c (Fwrite_region): Avoid race condition if a file is
1886 removed or renamed by some other process immediately after Emacs
1887 writes it but before Emacs stats it. Do not assume that stat (or
1888 fstat) succeeds.
1889 * image.c (slurp_file): Resolve the file name with fopen + fstat
1890 rather than stat + fopen.
1891 (pbm_read_file) [0]: Remove unused code with stat race.
1892 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1893 Remove ineffective code with stat race.
1894
1895 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1896
1897 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1898
1899 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1900
1901 * nsterm.m (hold_event_q): New static variable.
1902 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1903 ! q_event_ptr.
1904 (hold_event): New function.
1905 (ns_read_socket): If hold_event_q have events, store them and
1906 return (Bug#12384).
1907 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1908 is zero (Bug#12384).
1909
1910 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1911
1912 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1913
1914 2012-10-12 Eli Zaretskii <eliz@gnu.org>
1915
1916 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1917
1918 * fileio.c (check_existing): New function.
1919 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1920 instead of calling 'stat', when what's needed is to check whether
1921 a file exists. This avoids expensive system calls on MS-Windows.
1922 (Bug#12587)
1923
1924 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1925
1926 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1927 determine whether a file exists and is not a directory.
1928
1929 * lisp.h (check_existing): Add prototype.
1930
1931 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1932
1933 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1934
1935 2012-10-12 Glenn Morris <rgm@gnu.org>
1936
1937 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1938
1939 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1940
1941 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1942
1943 * eval.c (Fautoload): Remember previous autoload status in load-history.
1944
1945 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1946
1947 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1948 * lread.c (load_each_byte, new_backquote_flag, readchar)
1949 (read_filtered_event, lisp_file_lexically_bound_p)
1950 (safe_to_load_version, Fload, complete_filename_p, openp)
1951 (build_load_history, readevalloop, read_escape, read1)
1952 (string_to_number, read_vector, read_list):
1953 * macros.c (Fstart_kbd_macro):
1954 * marker.c (CONSIDER):
1955 * menu.c (parse_single_submenu, digest_single_submenu)
1956 (find_and_return_menu_selection, Fx_popup_menu):
1957 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1958 (Ftry_completion):
1959 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1960 (ns_menu_show):
1961 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1962 (xmenu_show, xdialog_show):
1963 Use bool for booleans.
1964 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1965 as it's not a predicate. All uses changed. Omit unnecessary
1966 buffer termination.
1967
1968 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1969
1970 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1971 (save_excursion_restore): Do not restore mark if it was not saved.
1972
1973 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1974
1975 * marker.c (cached_modiff): EMACS_INT, not int.
1976
1977 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1978 instead of having a wrong decl.
1979 * nsmenu.m (waiting_for_input): Remove wrong decl.
1980
1981 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1982
1983 keyboard.c, keymap.c: Use bool for booleans.
1984 * dispnew.c (sit_for): Distinguish between 3-way display_option
1985 and boolean do_display.
1986 * keyboard.c (single_kboard, this_command_key_count_reset)
1987 (waiting_for_input, echoing, immediate_quit, input_pending)
1988 (interrupt_input, interrupts_deferred, pop_kboard)
1989 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1990 (command_loop_1, adjust_point_for_property)
1991 (safe_run_hooks_error, input_polling_used, read_char):
1992 (help_char_p, readable_events, kbd_buffer_events_waiting)
1993 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1994 (lucid_event_type_list_p, get_input_pending):
1995 (gobble_input, menu_separator_name_p, menu_bar_item)
1996 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1997 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1998 (keyremap_step, test_undefined, read_key_sequence)
1999 (detect_input_pending, detect_input_pending_ignore_squeezables)
2000 (detect_input_pending_run_timers, requeued_events_pending_p)
2001 (quit_throw_to_read_char, Fset_input_interrupt_mode):
2002 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
2003 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
2004 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
2005 (accessible_keymaps_1, Fkey_description, push_key_description):
2006 (shadow_lookup, struct where_is_internal_data)
2007 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
2008 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
2009 (describe_map, describe_vector):
2010 * menu.c (single_menu_item):
2011 * nsmenu.m (ns_update_menubar):
2012 * process.c (wait_reading_process_output):
2013 * search.c (scan_buffer, scan_newline):
2014 Use bool for boolean.
2015 * keyboard.c (timers_run, swallow_events)
2016 (detect_input_pending_run_timers):
2017 * process.c (wait_reading_process_output):
2018 Use unsigned for counter where wraparound-on-overflow is desired,
2019 since unsigned is guaranteed to have that behavior and signed is not.
2020 (read_char): Use ptrdiff_t for string length.
2021 (get_input_pending): Remove first argument, since it was always
2022 the same pointer-to-int (now pointer-to-boolean) &input_pending,
2023 and behave as if it had that value. Return new value of
2024 input_pending. All callers changed.
2025 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
2026 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
2027 a string length.
2028 * keymap.c (push_key_description): Omit last arg, which was always 1.
2029 All callers changed.
2030
2031 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
2032
2033 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
2034
2035 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
2036 ($(BLD)/term.$(O)): Update dependencies.
2037
2038 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2039
2040 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
2041 * lisp.h (enum pvec_type): Adjust comments and omit explicit
2042 initializer for PVEC_NORMAL_VECTOR.
2043
2044 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2045
2046 Clean out old termopts cruft.
2047 * termopts.h (flow_control, meta_key): Remove unused decls.
2048 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
2049 Don't include termopts.h.
2050
2051 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2052
2053 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2054
2055 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2056
2057 * commands.h (immediate_quit): Remove duplicate decl.
2058
2059 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
2060
2061 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
2062 caching.
2063 (nsfont_open): Remove setting of Vfonts_in_cache.
2064 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
2065
2066 2012-10-09 Eli Zaretskii <eliz@gnu.org>
2067
2068 * w32fns.c (w32_last_error): Change the return value to DWORD, to
2069 match what GetLastError returns. Explain why the function is
2070 needed.
2071
2072 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
2073 'is_tooltip_frame', to avoid confusion with its global namesake.
2074
2075 2012-10-08 Daniel Colascione <dancol@dancol.org>
2076
2077 * xdisp.c (start_hourglass): Call w32_note_current_window when
2078 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
2079 build that caused Emacs to display the hourglass cursor forever.
2080
2081 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
2082 which is broken under remote desktop, calculate the number of
2083 colors available for a display based on the display's number of
2084 planes and number of bits per pixel per plane. (bug#10397).
2085
2086 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
2087
2088 * nsfont.m (Vfonts_in_cache): New variable.
2089 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
2090 are used. Add cached fonts to Vfonts_in_cache.
2091 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
2092
2093 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
2094
2095 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
2096 in nt/config.nt.
2097 (FONT_H): Define after FRAME_H.
2098 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
2099 Update dependencies.
2100
2101 * w32term.c: Remove leftover declaration of keyboard_codepage.
2102
2103 2012-10-08 Eli Zaretskii <eliz@gnu.org>
2104
2105 * makefile.w32-in (FONT_H): Add $(FRAME_H).
2106 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
2107 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
2108 (GLOBAL_SOURCES): Add cygw32.c.
2109 ($(BLD)/unexw32.$(O)):
2110 ($(BLD)/w32.$(O)):
2111 ($(BLD)/w32console.$(O)):
2112 ($(BLD)/w32fns.$(O)):
2113 ($(BLD)/w32heap.$(O)):
2114 ($(BLD)/w32menu.$(O)):
2115 ($(BLD)/w32proc.$(O)): Add w32common.h.
2116
2117 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
2118 'const char *'.
2119 (x_to_w32_color): Don't modify the argument, modify a copy instead.
2120
2121 2012-10-08 Daniel Colascione <dancol@dancol.org>
2122
2123 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
2124 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
2125 accidental message numbering hole. Change other messages to
2126 match.
2127
2128 * w32select.h (HAVE_W32SELECT): Remove.
2129
2130 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
2131 w32common.h instead of w32heap.h.
2132
2133 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
2134 (get_allocation_unit, get_processor_type, get_w32_major_version)
2135 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2136 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2137 (OS_NT, os_subtype, cache_system_info): Move declarations to
2138 w32common.
2139
2140 * w32heap.c: Include w32common.h.
2141 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
2142 (w32_minor_version, w32_build_number, w32_subtype):
2143 Remove duplicate definitions.
2144
2145 * w32fns.c: Include w32common.h; include w32heap.h only in
2146 WINDOWSNT.
2147
2148 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
2149 Use `report_file_error' instead of `error' in order to better
2150 inform users of what went wrong. Increase NTGUI_UNICODE file
2151 dialog box file name length to 32k, the maximum allowed by the NT
2152 kernel.
2153
2154 * w32common.h: New file.
2155 (ROUND_UP, ROUND_DOWN, get_page_size)
2156 (get_allocation_unit, get_processor_type, get_w32_major_version)
2157 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2158 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2159 (OS_NT, os_subtype, cache_system_info): Move here.
2160
2161 * unexw32.c, unexcw.c: Include w32common.h.
2162
2163 * emacs.c (main): Use (defined (WINDOWSNT) || defined
2164 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
2165 to call syms_of_w32select.
2166
2167 * cygw32.h: Remove obsolete EXFUN declarations.
2168
2169 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
2170
2171 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
2172 of w32inevt.o from SOME_MACHINE_OBJECTS.
2173
2174 2012-10-08 Daniel Colascione <dancol@dancol.org>
2175
2176 * image.c: Permanent fix for JPEG compilation issue --- limit
2177 jpeglib `boolean' redefinition to Cygwin builds.
2178
2179 2012-10-08 Eli Zaretskii <eliz@gnu.org>
2180
2181 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
2182
2183 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
2184 Cygwin.
2185
2186 2012-10-08 Daniel Colascione <dancol@dancol.org>
2187
2188 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
2189 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
2190 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
2191 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
2192 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
2193 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
2194 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
2195 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
2196 now a supported configuration.
2197
2198 * Makefile.in: consolidate image variables into LIBIMAGE; add
2199 W32_OBJ and W32_LIBS. Compile new files.
2200
2201 * conf_post.h:
2202 (_DebPrint) declare tracing facility for W32 debugging. We need
2203 to unify tracing later.
2204
2205 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
2206 unconditional use of W32 Unicode functions. Cygwin runs only on
2207 100% Unicode operating systems.
2208
2209 * cygw32.c: New file. Define Cygwin-specific facilities.
2210 (Fcygwin_convert_path_to_windows)
2211 (Fcygwin_convert_path_from_windows): New user functions for
2212 accessing Cygwin path-munging routines.
2213
2214 * cygw32.h: New file.
2215 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
2216 UTF-16LE strings temporarily inside non-Lisp-visible string
2217 objects.
2218
2219 (w32_strerror): Just what it says on the tin.
2220
2221 * emacs.c: Make the NS fork-then-exec code for daemon-launching
2222 also run for Cygwin; both systems have the same problem with using
2223 GUI facilities in a forked child. Also call syms_of_cygw32,
2224 syms_of_w32select in correct places.
2225
2226 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
2227 needs fork-then-exec for daemon launching.
2228
2229 * font.h: Include frame.h.
2230
2231 * image.c: Use the image library cache machinery only when we're
2232 compiling for native WINDOWSNT; Cygwin can use shared libraries
2233 like any other Unixlike system.
2234
2235 * keyboard.c: Clarify a comment regarding the input loop.
2236
2237 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
2238 functions directly instead of trying to detect at runtime that our
2239 host operating system supports them. We make this change for two
2240 reasons: Cygwin lacks support for the multibyte character
2241 conversion functions used by the legacy menu code, and Cygwin
2242 never needs to rely on non-Unicode APIs.
2243
2244 * unexw32.c (hinst): Declare extern.
2245
2246 * w32.c: Change header order;
2247 (w32_strerror): Move to w32fns.c because we need it for
2248 non-WINDOWSNT builds.
2249
2250 * w32.h: Add #error macro to make sure we don't include w32.h for
2251 Cygwin builds. Remove w32select declarations.
2252
2253 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
2254 w32fns.c. w32console.c is WINDOWSNT-only.
2255
2256 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2257 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2258 POSIXy alternative.
2259 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2260 (w32_major_version, w32_minor_version, w32_build_number)
2261 (os_subtype, sound_type): Define here
2262 (w32_defined_color): Make color parameter const for consistency
2263 with other _defined_color functions.
2264 (w32_createwindow): Unconditionally call w32_init_class instead of
2265 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2266 through the code is complex and unnecessary because class
2267 registration is practically free.
2268 (w32_name_of_message): New EMACSDEBUG-only function.
2269 (Fset_message_beep): Move here
2270 (Fx_open_connection): Require that the display name for Windows be
2271 "w32" for consistency, emacsclient disambiguation, and maybe, one
2272 day, multi-window-system support.
2273 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2274 Cygwin files for W32 GUI facilities, since these clearly don't
2275 expect Cygwin names.
2276 (_DebPrint): Define.
2277 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2278 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2279 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2280 (w32_last_error): Remove.
2281
2282 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
2283
2284 * w32heap.c (syspage_mask): Declare here.
2285 (cache_system_info): Remove.
2286
2287 * w32inevt.c (faked_key): Define globally, not statically.
2288 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2289 (w32_console_toggle_lock_key): Move to w32fns.c.
2290
2291 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2292
2293 * w32proc.c (_DebPrint): Move to w32fns.c.
2294 * w32select.c: Include string.h, stdio.h for Cygwin.
2295 * w32select.h: New File.
2296
2297 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2298 get_osfhandle.
2299 (w32_message_fd): New variable. Under Cygwin, holds the file
2300 descriptor the system used to tell us about pending thread
2301 messages.
2302
2303 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2304 that prevented compilation under non-WINDOWSNT systems.
2305
2306 (w32_initialize): Open /dev/windows and assign it to
2307 w32_message_fd. Provide w32 feature.
2308
2309 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2310 (WM_EMACS_INPUT_READY): add.
2311 (prepend_msg, w32_message_fd): Declare globally.
2312
2313 * w32xfns.c:
2314 (keyboard_handle): Use only when WINDOWSNT.
2315 (notify_msg_ready): New function. Posts a message to the main
2316 thread's message queue under CYGWIN, which wakes up the main
2317 thread from select(2) by making the /dev/windows file descriptor
2318 ready. Under WINDOWSNT, it sets an event the same way the old
2319 code did.
2320
2321 (post, prepend_msg): Actually call notify_msg_ready instead of
2322 setting the input event directly.
2323
2324 2012-10-07 Eli Zaretskii <eliz@gnu.org>
2325
2326 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2327 but it still has blocs in it, don't return it to the system,
2328 instead of aborting. (Bug#12402)
2329
2330 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2331
2332 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
2333
2334 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2335 MAC_OS_X_VERSION_10_6.
2336 (syms_of_nsterm): Remove comment about Panther and above for
2337 ns-antialias-text.
2338 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2339 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2340 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2341
2342 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2343 MAC_OS_X_VERSION_10_4.
2344
2345 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2346 MAC_OS_X_VERSION_10_2.
2347
2348 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2349
2350 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2351 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2352
2353 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2354 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
2355 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2356 Remove ns_in_resize check.
2357 (ns_clear_frame_area): Remove resize handle code.
2358
2359 * nsfns.m (ns_in_resize): Remove.
2360 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2361 Remove ns_in_resize check.
2362
2363 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2364
2365 Improve sys_siglist detection.
2366 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2367 defined as a macro, as is done in Solaris.
2368 (sys_siglist_entries): New macro.
2369 (save_strsignal): Use it.
2370 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2371 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2372
2373 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2374
2375 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2376 fullscreen/Fullscreen.
2377
2378 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2379 tobar_height is new.
2380
2381 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2382 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2383 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2384 (windowDidResize:): Check for correct window if old style fullscreen.
2385 Capitalize word in comment. Remove incorrect comment.
2386 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2387 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2388 error in drawing background.
2389 (toggleFullScreen:): Remove comment. Rearrange calls.
2390 Set toolbar values to zero, save old height in tobar_height.
2391 Restore tool bar height when leaving fullscreen.
2392 (canBecomeMainWindow): New function.
2393
2394 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2395
2396 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2397
2398 2012-10-05 Eli Zaretskii <eliz@gnu.org>
2399
2400 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2401
2402 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
2403 that time stamps of directories could also be changed.
2404 Don't request the too broad GENERIC_WRITE, only the more restrictive
2405 FILE_WRITE_ATTRIBUTES access rights.
2406
2407 * fileio.c (Fset_file_times): Special-case ignoring errors for
2408 directories only on MSDOS, not on MS-Windows.
2409
2410 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
2411
2412 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2413
2414 2012-10-04 Eli Zaretskii <eliz@gnu.org>
2415
2416 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2417 see whether CreateFile failed.
2418
2419 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2420
2421 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2422 to avoid similar races.
2423 * keyboard.c (pending_signals): Now bool, not int.
2424
2425 Port timers to OpenBSD, plus check for timer failures.
2426 OpenBSD problem reported by Han Boetes.
2427 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2428 and/or setitimer.
2429 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2430 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2431 like OpenBSD, which has timer_settime but does not declare it.
2432 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2433 whether to use itimerspec-related primitives. All uses of
2434 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2435
2436 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2437
2438 * profiler.c (handle_profiler_signal): Fix a malloc race
2439 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2440
2441 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2442
2443 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2444
2445 2012-10-02 Eli Zaretskii <eliz@gnu.org>
2446
2447 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2448 consistent with the change in return value of 'safe_strsignal'.
2449
2450 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2451
2452 Prefer plain 'static' to 'static inline' (Bug#12541).
2453 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2454 (bidi_set_sor_type, bidi_push_embedding_level)
2455 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2456 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2457 (bidi_cache_search, bidi_cache_ensure_space)
2458 (bidi_cache_iterator_state, bidi_cache_find)
2459 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2460 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2461 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2462 Now 'static', not 'static inline'.
2463
2464 Count overruns when profiling; change units to ns.
2465 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2466 Give extra weight to samples after overruns, to attempt to count
2467 the time more accurately.
2468 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2469 the underlying primitives nominally do ns.
2470 (Fprofiler_cpu_start): Document the change. Mention that
2471 the sampling intervals are only approximate.
2472
2473 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2474
2475 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2476
2477 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2478 case for the special 0 coding-system.
2479
2480 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2481 (Fmake_overlay): Remove redundant tests.
2482 (fix_start_end_in_overlays): Remove redundant recentering.
2483
2484 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
2485
2486 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2487 Update dependencies.
2488
2489 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2490
2491 Fix a malloc race condition involving strsignal.
2492 A signal can arrive in the middle of a malloc, and Emacs's signal
2493 handler can invoke strsignal, which can invoke malloc, which is
2494 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2495 Fix it by altering the signal handler so that it does not invoke
2496 strsignal.
2497 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2498 * process.c (status_message): Use const pointer, in case strsignal
2499 is #defined to safe_strsignal.
2500 * sysdep.c (sys_siglist, init_signals): Always define and
2501 initialize a substitute sys_siglist if the system does not define
2502 one, even if HAVE_STRSIGNAL.
2503 (safe_strsignal): Rename from strsignal. Always define,
2504 using sys_siglist. Return a const pointer.
2505 * syssignal.h (safe_strsignal): New decl.
2506 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2507
2508 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2509
2510 * w32proc.c (timer_loop): Fix code that waits for timer
2511 expiration, to avoid high CPU usage.
2512
2513 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2514
2515 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2516 (sweep_weak_table): Remove redundant prototypes.
2517
2518 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2519
2520 * emacs.c: Move the inclusion of TERM_HEADER after including
2521 windows.h on WINDOWSNT. This avoids compilation problems with
2522 MSVC.
2523
2524 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2525
2526 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2527 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2528 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2529 as the previous version used 'void *'.
2530
2531 * ralloc.c (ROUNDUP): Fix last change.
2532 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2533 'size_t'.
2534
2535 * w32proc.c <disable_itimers>: New static flag.
2536 (init_timers): Initialize it to zero, after creating the critical
2537 sections used by the timer threads.
2538 (term_timers): Set to 1 before deleting the critical sections.
2539 (getitimer, setitimer): If disable_itimers is non-zero, return an
2540 error indication without doing anything. Reported by Fabrice
2541 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2542 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2543 return results.
2544 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2545 support timers.
2546
2547 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2548 term_ntproc after all the other bookkeeping, to get timers working
2549 as long as possible.
2550
2551 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2552
2553 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2554 Suggested by Juri Linkov in
2555 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2556
2557 Prefer plain 'static' to 'static inline' (Bug#12541).
2558 With static functions, modern compilers inline pretty well by
2559 themselves; advice from programmers often hurts as much as it helps.
2560 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2561 this change shrinks the text size of the Emacs executable by 1.1%
2562 without affecting CPU significantly in my benchmark.
2563 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2564 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2565 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2566 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2567 (bset_auto_fill_function, bset_auto_save_file_format)
2568 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2569 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2570 (bset_cache_long_line_scans, bset_case_fold_search)
2571 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2572 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2573 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2574 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2575 (bset_header_line_format, bset_indicate_buffer_boundaries)
2576 (bset_indicate_empty_lines, bset_invisibility_spec)
2577 (bset_left_fringe_width, bset_major_mode, bset_mark)
2578 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2579 (bset_name, bset_overwrite_mode, bset_pt_marker)
2580 (bset_right_fringe_width, bset_save_length)
2581 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2582 (bset_scroll_up_aggressively, bset_selective_display)
2583 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2584 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2585 (set_buffer_overlays_after):
2586 * category.c (bset_category_table):
2587 * charset.c (read_hex):
2588 * coding.c (produce_composition, produce_charset)
2589 (handle_composition_annotation, handle_charset_annotation)
2590 (char_encodable_p):
2591 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2592 (assign_row, set_frame_matrix_frame, make_current)
2593 (add_row_entry):
2594 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2595 * fns.c (maybe_resize_hash_table):
2596 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2597 * gmalloc.c (register_heapinfo):
2598 * image.c (lookup_image_type):
2599 * intervals.c (set_interval_object, set_interval_left)
2600 (set_interval_right, copy_interval_parent, rotate_right)
2601 (rotate_left, balance_possible_root_interval):
2602 * keyboard.c (kset_echo_string, kset_kbd_queue)
2603 (kset_keyboard_translate_table, kset_last_prefix_arg)
2604 (kset_last_repeatable_command, kset_local_function_key_map)
2605 (kset_overriding_terminal_local_map, kset_real_last_command)
2606 (kset_system_key_syms, clear_event, set_prop):
2607 * lread.c (digit_to_number):
2608 * marker.c (attach_marker, live_buffer, set_marker_internal):
2609 * nsterm.m (ns_compute_glyph_string_overhangs):
2610 * process.c (pset_buffer, pset_command)
2611 (pset_decode_coding_system, pset_decoding_buf)
2612 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2613 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2614 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2615 * syntax.c (bset_syntax_table, dec_bytepos):
2616 * terminal.c (tset_param_alist):
2617 * textprop.c (interval_has_some_properties)
2618 (interval_has_some_properties_list):
2619 * window.c (wset_combination_limit, wset_dedicated)
2620 (wset_display_table, wset_hchild, wset_left_fringe_width)
2621 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2622 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2623 (wset_right_fringe_width, wset_right_margin_cols)
2624 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2625 (wset_vertical_scroll_bar_type, wset_window_parameters):
2626 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2627 (wset_column_number_displayed, wset_region_showing)
2628 (window_box_edges, run_window_scroll_functions)
2629 (append_glyph_string_lists, prepend_glyph_string_lists)
2630 (append_glyph_string, set_glyph_string_background_width)
2631 (append_glyph, append_composite_glyph)
2632 (take_vertical_position_into_account):
2633 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2634 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2635 (lface_hash, lface_same_font_attributes_p, lookup_face):
2636 * xml.c (libxml2_loaded_p):
2637 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2638 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2639 Now 'static', not 'static inline'.
2640
2641 * bidi.c: Tune.
2642 (bidi_copy_it): Do the whole copy with a single memcpy.
2643 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2644
2645 Revert the FOLLOW-SYMLINKS change for file-attributes.
2646 Doing it right would require several changes to Tramp, and there's
2647 not enough time to get that tested before the freeze today.
2648 * dired.c (directory_files_internal, Ffile_attributes):
2649 Undo last change.
2650
2651 * frame.c (x_report_frame_params): Port better to wider ints.
2652 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2653 or that pointers can be printed in 15 decimal digits.
2654 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2655
2656 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2657
2658 Support x64 build on MS-Windows.
2659 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2660 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2661 compatibility with x64.
2662 (x_get_focus_frame): Add prototype.
2663
2664 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2665 defining an XRectangle structure.
2666
2667 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2668 arithmetics for compatibility with x64.
2669
2670 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2671 compatibility with x64.
2672
2673 * w32heap.h: Adjust prototypes and declarations.
2674
2675 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2676 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2677 DWORD, long, and unsigned long, for compatibility with x64.
2678 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2679 (sbrk): Argument is now of type ptrdiff_t.
2680
2681 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2682 less than 0x0500.
2683 (w32_msg_pump): Use WPARAM type for 'result'.
2684
2685 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2686 architecture.
2687 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2688 compatibility with x64.
2689
2690 * vm-limit.c (lim_data): Now size_t.
2691 (check_memory_limits): Adjust prototypes of real_morecore and
2692 __morecore to receive argument of type ptrdiff_t. Use size_t for
2693 five_percent and data_size.
2694
2695 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2696 variables, for compatibility with x64.
2697 (rva_to_section, offset_to_section, relocate_offset)
2698 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2699 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2700 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2701 for compatibility with x64.
2702
2703 * sysdep.c (STDERR_FILENO): Define if not already defined.
2704
2705 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2706 (__morecore): Argument type is now ptrdiff_t.
2707 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2708 (relinquish): Use ptrdiff_t type for 'excess'.
2709 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2710
2711 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2712 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2713 instead of a literal number.
2714
2715 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2716 (min): Define only if not already defined.
2717
2718 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2719 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2720 hosts.
2721
2722 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2723 'bitmaps' is a pointer.
2724
2725 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2726
2727 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2728
2729 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2730
2731 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2732 * dired.c (directory_files_internal, Ffile_attributes):
2733 New arg follow_symlinks. All uses changed.
2734
2735 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2736
2737 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2738
2739 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2740
2741 Support atimers and CPU profiler via profile.c on MS-Windows.
2742 * w32proc.c (sig_mask, crit_sig): New static variables.
2743 (sys_signal): Support SIGALRM and SIGPROF.
2744 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2745 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2746 sigfillset, and sigprocmask are no longer no-ops.
2747 (sigismember): New function.
2748 (struct itimer_data): New definition.
2749 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2750 (crit_prof): New static variables.
2751 (MAX_SINGLE_SLEEP): New definition.
2752 (timer_loop, stop_timer_thread, term_timers, init_timers)
2753 (start_timer_thread, getitimer, setitimer): New functions.
2754 (alarm): No longer a no-op, calls setitimer.
2755
2756 * w32.c (term_ntproc): Call term_timers.
2757 (init_ntproc): Make sure all signals are unblocked at startup, to
2758 erase any traces of dumping. Call init_timers.
2759
2760 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2761 Windows-specific code to display the hourglass mouse pointer is no
2762 longer used.
2763 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2764 to hourglass timer expiration.
2765 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2766 Remove, no longer used.
2767 (w32_note_current_window, show_hourglass, hide_hourglass):
2768 New functions, in support of hourglass cursor display similar to other
2769 window systems.
2770 (syms_of_w32fns): Don't initialize hourglass_timer.
2771
2772 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2773 WINDOWSNT as well.
2774 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2775
2776 * w32.h (init_timers, term_timers): Add prototypes.
2777
2778 2012-09-30 Kenichi Handa <handa@gnu.org>
2779
2780 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2781 to the buffer relocation which may be caused by ccl_driver.
2782
2783 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2784
2785 * xfns.c (Fx_file_dialog): Update comment.
2786
2787 * w32fns.c (Fx_file_dialog): Update comment.
2788
2789 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2790 Initialize panel name field if OSX >= 10.6.
2791
2792 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2793
2794 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2795
2796 * nsterm.m (NEW_STYLE_FS): New define.
2797 (ns_fullscreen_hook, windowWillEnterFullScreen)
2798 (windowDidEnterFullScreen, windowWillExitFullScreen)
2799 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2800 (setFSValue): New functions.
2801 (EmacsFSWindow): New implementation.
2802 (canBecomeKeyWindow): New function for EmacsFSWindow.
2803 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2804 (dealloc): Release nonfs_window if in fullscreen.
2805 (updateFrameSize:): Call windowDidMove to update top/left.
2806 (windowWillResize:toSize:): Check if frame is still maximized.
2807 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2808 next_maximized, maximized_width, maximized_height and nonfs_window.
2809 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2810 tbar_height.
2811 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2812 fullscreen. Set maximized_width/height. Act on next_maximized.
2813
2814 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2815 (EmacsView): Add variables for fullscreen.
2816 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2817 (EmacsFSWindow): New interface for fullscreen.
2818
2819 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2820
2821 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2822
2823 2012-09-30 Chong Yidong <cyd@gnu.org>
2824
2825 * fns.c (Frandom): Doc fix.
2826
2827 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2828
2829 * window.c (Vwindow_combination_limit): New default value.
2830 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2831
2832 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2833
2834 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2835 Suggested by Eli Zaretskii in
2836 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2837
2838 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2839
2840 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2841 HAVE_TIMER_SETTIME is defined.
2842
2843 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2844
2845 Profiler improvements: more-accurate timers, overflow checks.
2846 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2847 signal.h, setjmp.h. Include systime.h instead.
2848 (saturated_add): New function.
2849 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2850 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2851 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2852 New static vars.
2853 (enum profiler_cpu_running): New enum.
2854 (profiler_cpu_running): Now of that enum type, not bool.
2855 All uses changed to store the new value.
2856 (handle_profiler_signal): Rename from sigprof_handler_1,
2857 for consistency with other handlers. Do not check whether
2858 cpu_log is a hash-table if garbage collecting, since it
2859 doesn't matter in that case.
2860 (deliver_profiler_signal): Rename from sigprof_handler,
2861 for consistency with other handlers.
2862 (setup_cpu_timer): New function, with much of what used to be in
2863 Fprofiler_cpu_start. Check for out-of-range argument.
2864 Prefer timer_settime if available, and prefer
2865 thread cputime clocks, then process cputime clocks, then
2866 monotonic clocks, to the old realtime clock. Use make_timeval
2867 to round more-correctly when falling back to setitimer.
2868 (Fprofiler_cpu_start): Use it.
2869 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2870 Don't assume that passing NULL as the 2nd argument of setitimer
2871 is the same as passing a pointer to all-zero storage.
2872 Ignore SIGPROF afterwards.
2873 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2874 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2875 non-fatal signal handlers. Ignore SIGPROF on startup.
2876 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2877 in profiler.c, since sysdep.c now uses it.
2878
2879 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2880 Suggested by Eli Zaretskii in
2881 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2882
2883 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2884
2885 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2886
2887 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2888
2889 * lisp.h (struct backtrace): Remove indirection for `function' field.
2890 * xdisp.c (redisplay_internal):
2891 * profiler.c (record_backtrace, sigprof_handler_1):
2892 * alloc.c (Fgarbage_collect):
2893 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2894 (Fbacktrace_frame): Adjust accordingly.
2895
2896 2012-09-28 Glenn Morris <rgm@gnu.org>
2897
2898 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2899 (Frun_hook_with_args_until_failure): Doc fixes.
2900
2901 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2902
2903 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2904 Qautomatic_redisplay and change the symbol name. All users changed.
2905
2906 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2907
2908 * profiler.c (sigprof_handler): Fix race condition.
2909
2910 2012-09-28 Glenn Morris <rgm@gnu.org>
2911
2912 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2913
2914 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2915
2916 Check more robustly for timer_settime.
2917 * Makefile.in (LIB_TIMER_TIME): New macro.
2918 (LIBES): Add it.
2919 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2920 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2921 call timer_settime.
2922
2923 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2924
2925 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2926
2927 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2928
2929 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2930
2931 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2932
2933 * character.h (MAYBE_UNIFY_CHAR): Remove.
2934 * charset.c, charset.h (maybe_unify_char): Now static.
2935 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2936 Since this stuff is now private to charset.c, there's no need for
2937 a public macro and no need to inline by hand.
2938
2939 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2940 Stefan Monnier <monnier@iro.umontreal.ca>
2941 Juanma Barranquero <lekktu@gmail.com>
2942
2943 * profiler.c: New file.
2944 * Makefile.in (base_obj): Add profiler.o.
2945 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2946 ($(BLD)/profiler.$(O)): New target.
2947 * emacs.c (main): Call syms_of_profiler.
2948 * alloc.c (Qautomatic_gc): New constant.
2949 (MALLOC_PROBE): New macro.
2950 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2951 (total_bytes_of_live_objects): New function.
2952 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2953 Call malloc_probe for the memory profiler.
2954 (syms_of_alloc): Define Qautomatic_gc.
2955 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2956 race condition.
2957 (struct backtrace): Move definition...
2958 * lisp.h (struct backtrace): ..here.
2959 (Qautomatic_gc, profiler_memory_running): Declare vars.
2960 (malloc_probe, syms_of_profiler): Declare functions.
2961 * xdisp.c (Qautomatic_redisplay): New constant.
2962 (redisplay_internal): Record itself in backtrace_list.
2963 (syms_of_xdisp): Define Qautomatic_redisplay.
2964
2965 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2966 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2967
2968 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2969
2970 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2971
2972 Prefer POSIX timers if available.
2973 They avoid a race if the timer is too close to the current time.
2974 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2975 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2976 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2977
2978 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2979
2980 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2981 CHAR_STRING_ADVANCE.
2982 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2983 STRING_CHAR_ADVANCE.
2984
2985 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2986
2987 Move Vlibrary_cache to emacs.c and reset before dumping.
2988
2989 * lisp.h (reset_image_types): Declare.
2990 [WINDOWSNT] (Vlibrary_cache): Declare.
2991
2992 * image.c (reset_image_types): New function.
2993
2994 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2995 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2996 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2997
2998 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2999 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
3000
3001 * w32.h (Vlibrary_cache): Do not declare.
3002
3003 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3004
3005 * w32proc.c (sys_signal): Handle all signals defined by the
3006 MS-Windows runtime, not just SIGCHLD. Actually install the signal
3007 handlers for signals supported by Windows. Don't override
3008 term_ntproc as the handler for SIGABRT.
3009 (sigaction): Rewrite to call sys_signal instead of duplicating its
3010 code.
3011 (sys_kill): Improve commentary.
3012
3013 * w32.c (term_ntproc): Accept (and ignore) one argument, for
3014 consistency with a signature of a signal handler. All callers
3015 changed.
3016 (init_ntproc): Accept an argument DUMPING. If dumping, don't
3017 install term_ntproc as a signal handler for SIGABRT, as that
3018 should be done by the dumped Emacs.
3019
3020 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
3021
3022 * w32select.c (term_w32select): Protect against repeated
3023 invocation by setting clipboard_owner to NULL after calling
3024 DestroyWindow.
3025
3026 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
3027 and term_ntproc to their modified signatures.
3028
3029 * character.c (char_string, string_char): Remove calls to
3030 MAYBE_UNIFY_CHAR. See the discussion starting at
3031 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
3032 for the details.
3033
3034 2012-09-25 Chong Yidong <cyd@gnu.org>
3035
3036 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
3037
3038 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
3039
3040 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
3041 when encountering an unknown bytecode.
3042
3043 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
3044
3045 image.c, indent.c: Use bool for booleans.
3046 * dispextern.h (struct image_type): Members valid_p, load, init
3047 now return bool, not int. All uses changed.
3048 * image.c: Omit unnecessary static decls.
3049 (x_create_bitmap_mask, x_build_heuristic_mask):
3050 Return void, not int, since callers don't care about the return value.
3051 (x_create_bitmap_mask, define_image_type, valid_image_p)
3052 (struct image_keyword, parse_image_spec, image_spec_value)
3053 (check_image_size, image_background)
3054 (image_background_transparent, x_clear_image_1)
3055 (postprocess_image, lookup_image, x_check_image_size)
3056 (x_create_x_image_and_pixmap, xbm_image_p)
3057 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
3058 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
3059 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
3060 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
3061 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
3062 (png_image_p, init_png_functions, png_load_body, png_load)
3063 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
3064 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
3065 (init_gif_functions, gif_load, imagemagick_image_p)
3066 (imagemagick_load_image, imagemagick_load, svg_image_p)
3067 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
3068 (gs_load):
3069 * nsimage.m (ns_load_image):
3070 * nsterm.m (ns_defined_color):
3071 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
3072 * xfns.c (x_defined_color):
3073 * xterm.c (x_alloc_lighter_color_for_widget)
3074 (x_alloc_nearest_color_1, x_alloc_nearest_color)
3075 (x_alloc_lighter_color):
3076 * indent.c (disptab_matches_widthtab, current_column)
3077 (scan_for_column, string_display_width, indented_beyond_p)
3078 (compute_motion, vmotion, Fvertical_motion):
3079 Use bool for booleans.
3080
3081 2012-09-24 Chong Yidong <cyd@gnu.org>
3082
3083 * chartab.c (Fset_char_table_default): Obsolete function removed.
3084
3085 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3086
3087 Move pid_t related decls out of lisp.h.
3088 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
3089 (interruptible_wait_for_termination):
3090 Move these decls from lisp.h to syswait.h, since they use pid_t.
3091 Needed on FreeBSD; see Herbert J. Skuhra in
3092 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
3093 * callproc.c: Include syswait.h.
3094
3095 gnutls.c, gtkutil.c: Use bool for boolean.
3096 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
3097 (emacs_gnutls_handle_error):
3098 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
3099 (xg_hide_tooltip, xg_create_frame_widgets)
3100 (create_dialog, xg_uses_old_file_dialog)
3101 (xg_get_file_with_chooser, xg_get_file_with_selection)
3102 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
3103 (xg_item_label_same_p, xg_update_menubar)
3104 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
3105 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
3106 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
3107 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
3108 (update_frame_tool_bar, free_frame_tool_bar):
3109 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
3110 * nsmenu.m (ns_update_menubar):
3111 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
3112 * xfns.c (Fx_show_tip) [USE_GTK]:
3113 Use bool for boolean.
3114 * gtkutil.c (xg_update_frame_menubar):
3115 * xmenu.c (update_frame_menubar):
3116 Return void, not int, since caller ignores return value.
3117 * gtkutil.c (xg_change_toolbar_position):
3118 Return void, not 1.
3119
3120 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
3121
3122 * makefile.w32-in (BLOCKINPUT_H): Remove.
3123 (SYSSIGNAL_H): New macro.
3124 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
3125 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
3126 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
3127 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
3128 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
3129 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
3130 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
3131 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
3132 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
3133 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
3134 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
3135 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
3136 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
3137 ($(BLD)/w32xfns.$(O)): Update dependencies.
3138
3139 2012-09-23 Eli Zaretskii <eliz@gnu.org>
3140
3141 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
3142 fatal_error_backtrace.
3143
3144 * w32proc.c (sys_kill): Undo last change: don't do anything when
3145 invoked to deliver SIGABRT to our own process. This is now
3146 handled by emacs_raise.
3147
3148 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
3149
3150 * w32term.c (w32_read_socket): Remove leftover reference to
3151 interrupt_input_pending.
3152
3153 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3154
3155 Do not use SA_NODEFER.
3156 Problem reported by Dani Moncayo in
3157 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
3158 * alloc.c (die):
3159 * sysdep.c (emacs_abort): Do not reset signal handler.
3160 * emacs.c (terminate_due_to_signal): Reset signal handler here.
3161 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
3162 wanted even on POSIXish hosts, and it doesn't work on Windows.
3163
3164 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3165
3166 * xterm.c (x_term_init): Call fixup_locale before and after calling
3167 gtk_init (Bug#12392).
3168
3169 2012-09-23 Chong Yidong <cyd@gnu.org>
3170
3171 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
3172 Vdynamic_library_alist.
3173
3174 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
3175 (Fgnutls_available_p): Caller changed.
3176
3177 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
3178 (Flibxml_parse_xml_region): Likewise.
3179
3180 * dispextern.h (struct image_type): Remove arg from init function.
3181
3182 * image.c (Finit_image_library, lookup_image_type)
3183 (define_image_type): Remove now-unneeded second arg.
3184 (init_xpm_functions, init_png_functions, init_jpeg_functions)
3185 (init_tiff_functions, init_gif_functions, init_svg_functions):
3186 Arglist and w32_delayed_load calling convention changed.
3187 (gs_type): Remove init_gs_functions; there is no such function.
3188 (valid_image_p, make_image): Fix caller to lookup_image_type.
3189
3190 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3191
3192 Simplify and avoid signal-handling races (Bug#12471).
3193 * alloc.c (die):
3194 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
3195 Avoid recursive loop if there's a fatal error in the function itself.
3196 * atimer.c (pending_atimers):
3197 * blockinput.h: Don't include "atimer.h"; no longer needed.
3198 (interrupt_input_pending): Remove. All uses removed.
3199 pending_signals now counts both atimers and ordinary interrupts.
3200 This is less racy than having three separate pending-signal flags.
3201 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
3202 (input_blocked_p):
3203 Rename from their upper-case counterparts BLOCK_INPUT,
3204 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
3205 INPUT_BLOCKED_P, and turn into functions. All uses changed.
3206 This makes it easier to access volatile variables more accurately.
3207 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
3208 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
3209 that's more reliable if the code is buggy and sets
3210 interrupt_input_blocked to a negative value. All uses changed.
3211 * atimer.c (deliver_alarm_signal):
3212 Remove. No need to deliver this to the parent; any thread can
3213 handle this signal now. All uses replaced by underlying handler.
3214 * atimer.c (turn_on_atimers):
3215 * dispnew.c (handle_window_change_signal):
3216 * emacs.c (handle_danger_signal):
3217 * keyboard.c (kbd_buffer_get_event):
3218 Don't reestablish signal handler; not needed with sigaction.
3219 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
3220 (UNBLOCK_INPUT_TO):
3221 Rework to avoid unnecessary accesses to volatile variables.
3222 (UNBLOCK_INPUT_TO): Now a function.
3223 (totally_unblock_input, unblock_input): New decls.
3224 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
3225 (init_data): Remove. Necessary stuff now done in init_signal.
3226 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
3227 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
3228 (fatal_error_code): Remove; no longer needed.
3229 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
3230 it doesn't always backtrace. All uses changed. No need to reset
3231 signal to default, since sigaction and/or die does that for us now.
3232 Use emacs_raise (FOO), not kill (getpid (), FOO).
3233 (main): Check more-accurately whether we're dumping.
3234 Move fatal-error setup to sysdep.c
3235 * floatfns.c: Do not include "syssignal.h"; no longer needed.
3236 * gtkutil.c (xg_get_file_name, xg_get_font):
3237 Remove no-longer-needed signal-mask manipulation.
3238 * keyboard.c, process.c (POLL_FOR_INPUT):
3239 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
3240 * keyboard.c (read_avail_input): Remove.
3241 All uses replaced by gobble_input.
3242 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
3243 (kbd_buffer_store_event_hold, gobble_input):
3244 (record_asynch_buffer_change) [USABLE_SIGIO]:
3245 (store_user_signal_events):
3246 No need to mess with signal mask.
3247 (gobble_input): If blocking input and there are terminals, simply
3248 set pending_signals to 1 and return. All hooks changed to not
3249 worry about whether input is blocked.
3250 (process_pending_signals): Clear pending_signals before processing
3251 them, in case a signal comes in while we're processing.
3252 By convention callers now test pending_signals before calling us.
3253 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3254 New functions, to support changes to blockinput.h.
3255 (handle_input_available_signal): Now extern.
3256 (reinvoke_input_signal): Remove. All uses replaced by
3257 handle_async_input.
3258 (quit_count): Now volatile, since a signal handler uses it.
3259 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3260 All callers changed. Block SIGINT only if not already blocked.
3261 Clear sigmask reliably, even if Fsignal returns, which it can.
3262 Omit unnecessary accesses to volatile var.
3263 (quit_throw_to_read_char): No need to restore sigmask.
3264 * keyboard.c (gobble_input, handle_user_signal):
3265 * process.c (wait_reading_process_output):
3266 Call signal-handling code rather than killing ourselves.
3267 * lisp.h: Include <float.h>, for...
3268 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3269 (pending_signals): Now volatile.
3270 (syms_of_data): Now const if IEEE floating point.
3271 (handle_input_available_signal) [USABLE_SIGIO]:
3272 (terminate_due_to_signal, record_child_status_change): New decls.
3273 * process.c (create_process): Avoid disaster if memory is exhausted
3274 while we're processing a vfork, by tightening the critical section
3275 around the vfork.
3276 (send_process_frame, process_sent_to, handle_pipe_signal)
3277 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3278 ignores SIGPIPE.
3279 (send_process): No need for setjmp/longjmp any more, since the
3280 SIGPIPE stuff is now gone. Instead, report an error if errno
3281 is EPIPE.
3282 (record_child_status_change): Now extern. PID and W are now args.
3283 Return void, not bool. All callers changed.
3284 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3285 Remove. All uses removed. This bug should be fixed now in a
3286 different way.
3287 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3288 and record the child status change directly. This avoids the
3289 need to futz with the signal mask.
3290 (process_fatal_action): Move here from emacs.c.
3291 (emacs_sigaction_flags): New function, containing
3292 much of what used to be in emacs_sigaction_init.
3293 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3294 caught by emacs, to make races less likely.
3295 (deliver_process_signal): Rename from handle_on_main_thread.
3296 All uses changed.
3297 (BACKTRACE_LIMIT_MAX): Now at top level.
3298 (thread_backtrace_buffer, threadback_backtrace_pointers):
3299 New static vars.
3300 (deliver_thread_signal, deliver_fatal_thread_signal):
3301 New functions, for more-accurate delivery of thread-specific signals.
3302 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3303 (deliver_arith_signal): Handle in this thread, not
3304 in the main thread, since it's triggered by this thread.
3305 (maybe_fatal_sig): New function.
3306 (init_signals): New arg DUMPING so that we can be more accurate
3307 about whether we're dumping. Caller changed.
3308 Treat thread-specific signals differently from process-general signals.
3309 Block all signals while handling fatal error; that's safer.
3310 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3311 on IEEE hosts.
3312 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3313 Ignore SIGPIPE unless batch.
3314 (emacs_backtrace): Output backtrace for the appropriate thread,
3315 which is not necessarily the main thread.
3316 * syssignal.h: Include <stdbool.h>.
3317 (emacs_raise): New macro.
3318 * xterm.c (x_connection_signal): Remove; no longer needed
3319 now that we use sigaction.
3320 (x_connection_closed): No need to mess with sigmask now.
3321 (x_initialize): No need to reset SIGPIPE handler here, since
3322 init_signals does this for us now.
3323
3324 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3325
3326 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
3327 background rect may be larger (Bug#12245).
3328
3329 2012-09-23 Chong Yidong <cyd@gnu.org>
3330
3331 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3332
3333 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3334
3335 * .gdbinit: Just stop at fatal_error_backtrace.
3336 See Stefan Monnier's request in
3337 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3338 Remove no-longer-used query of system type.
3339
3340 2012-09-22 Chong Yidong <cyd@gnu.org>
3341
3342 * search.c (Freplace_match): Doc fix (Bug#12325).
3343
3344 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3345
3346 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3347 (Fline_end_position): Doc fix.
3348
3349 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3350
3351 2012-09-22 Chong Yidong <cyd@gnu.org>
3352
3353 * dispextern.h (struct image_type): Add new slot, storing a type
3354 initialization function.
3355
3356 * image.c (define_image_type): Call the image initializer function
3357 if it is defined. Arguments and return value changed.
3358 (valid_image_p, make_image): Callers changed.
3359 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3360 (gif_type, imagemagick_type, svg_type, gs_type):
3361 Add initialization functions.
3362 (Finit_image_library): Call lookup_image_type.
3363 (CHECK_LIB_AVAILABLE): Macro deleted.
3364 (lookup_image_type): Call define_image_type here, rather than via
3365 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3366 (syms_of_image): Move define_image_type calls for xbm_type and
3367 pbm_type to lookup_image_type.
3368
3369 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3370
3371 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3372 'idle_timers' from here ...
3373 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3374 lists, to avoid infloops when the timer does something stupid,
3375 like reinvoke itself with the same or smaller time-out.
3376 (Bug#12447)
3377
3378 2012-09-22 Martin Rudalics <rudalics@gmx.at>
3379
3380 * window.c (Fsplit_window_internal): Handle only Qt value of
3381 Vwindow_combination_limit separately.
3382 (Qtemp_buffer_resize): New symbol.
3383 (Vwindow_combination_limit): New default value.
3384 Rewrite doc-string.
3385
3386 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3387
3388 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3389 the new overlay string. (Bug#10159)
3390
3391 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3392
3393 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3394 or that fprintf is async-signal-safe. POSIX doesn't require
3395 either assumption.
3396
3397 2012-09-22 Chong Yidong <cyd@gnu.org>
3398
3399 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3400 (Bug#8207).
3401
3402 2012-09-22 Kenichi Handa <handa@gnu.org>
3403
3404 * composite.c (composition_reseat_it): Handle the case that a
3405 grapheme cluster is not covered by a single font (Bug#12352).
3406
3407 2012-09-21 Chong Yidong <cyd@gnu.org>
3408
3409 * image.c (define_image_type): Avoid adding duplicate types to
3410 image_types (Bug#12463). Suggested by Jörg Walter.
3411
3412 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3413
3414 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3415 (print_load_command_name): Add case LC_DATA_IN_CODE.
3416 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3417
3418 2012-09-21 Glenn Morris <rgm@gnu.org>
3419
3420 * eval.c (Frun_hook_with_args_until_success)
3421 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3422
3423 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
3424
3425 * fileio.c (Ffile_selinux_context): Only call freecon when
3426 lgetfilecon succeeded.
3427 (Fset_file_selinux_context): Likewise. (Bug#12444)
3428
3429 2012-09-21 Eli Zaretskii <eliz@gnu.org>
3430
3431 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3432 reordering, locate the cursor by calling set_cursor_from_row; if
3433 that fails, clear the desired glyph matrix before returning a
3434 failure indication to the caller. Fixes leaving garbled display
3435 when fast scrolling with a down-key. (Bug#12403)
3436 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3437 scrolling through multibyte text.
3438
3439 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3440
3441 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3442 calling mark_vectorlike since that's the one that marks the window.
3443 (mark_discard_killed_buffers): Mark the final cdr.
3444 * window.h (struct window): Move prev/next_buffers to the
3445 non-standard fields.
3446 * window.c (make_window): Initialize prev/next_buffers manually.
3447
3448 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3449
3450 Omit unused arg EXPECTED from socket hooks.
3451 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3452 * nsterm.m (ns_term_init):
3453 * termhooks.h (struct terminal.read_socket_hook):
3454 * w32inevt.c (w32_console_read_socket):
3455 * w32term.c (w32_read_socket):
3456 * xterm.c (XTread_socket):
3457 Omit unused arg EXPECTED. All callers changed.
3458 (store_user_signal_events): Return void, not int, since callers no
3459 longer care about the return value. All uses changed.
3460
3461 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
3462
3463 * w32gui.h (XParseGeometry): Do not declare.
3464
3465 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3466
3467 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
3468 Ignore 'expected'. See Eli Zaretskii in
3469 <http://bugs.gnu.org/12471#8> (last line).
3470
3471 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3472 (XParseGeometry): Now static. Substitute extremal values for
3473 values that are out of range.
3474
3475 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3476
3477 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3478
3479 * nsfns.m (XParseGeometry): Remove.
3480 (Fx_create_frame): Call x_set_offset to correctly interpret
3481 top_pos in geometry.
3482
3483 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
3484 (Fx_parse_geometry): If there is a space in string, call
3485 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3486
3487 2012-09-17 Eli Zaretskii <eliz@gnu.org>
3488
3489 * search.c (scan_buffer): Use character positions in calls to
3490 region_cache_forward and region_cache_backward, not byte
3491 positions. (Bug#12196)
3492
3493 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3494 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3495
3496 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3497 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3498 emacs_blocked_malloc, now deleted.
3499
3500 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3501
3502 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3503 The workaround was for improving performance on Solaris 2.4, but
3504 is getting in the way now. Emacs will still work if someone is
3505 still running Solaris 2.4 in a museum somewhere; Sun dropped
3506 support for Solaris 2.4 in 2003.
3507 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3508 * process.c (create_process) [HAVE_WORKING_VFORK]:
3509 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3510 since Emacs no longer uses vfork on that platform.
3511
3512 2012-09-17 Glenn Morris <rgm@gnu.org>
3513
3514 * emacs.c: Use COPYRIGHT.
3515
3516 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3517
3518 Remove configure's --without-sync-input option (Bug#12450).
3519 When auditing signal-handling in preparation for cleaning it up,
3520 I found that SYNC_INPUT has race conditions and would be a real
3521 pain to fix. Since it's an undocumented and deprecated
3522 configure-time option, now seems like a good time to remove it.
3523 Also see <http://bugs.gnu.org/11080#16>.
3524 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3525 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3526 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3527 (malloc_hysteresis):
3528 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3529 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3530 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3531 (dont_register_blocks, bytes_used_when_reconsidered)
3532 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3533 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3534 [!SYSTEM_MALLOC && !SYNC_INPUT]:
3535 Remove. All uses removed.
3536 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3537 implementation, one that depends on whether the new macro
3538 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3539 is defined.
3540 * atimer.c (run_timers, handle_alarm_signal):
3541 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3542 (handle_async_input, process_pending_signals)
3543 (handle_input_available_signal, init_keyboard):
3544 * nsterm.m (ns_read_socket):
3545 * process.c (wait_reading_process_output):
3546 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3547 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3548 (emacs_write):
3549 * xterm.c (XTread_socket):
3550 Assume SYNC_INPUT.
3551 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3552 * eval.c (handling_signal): Remove. All uses removed.
3553 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3554 All uses replaced with the SYNC_INPUT version.
3555 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3556 Remove decls.
3557 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3558 Now static.
3559
3560 * font.c (Ffont_shape_gstring): Remove unused local.
3561
3562 2012-09-16 Glenn Morris <rgm@gnu.org>
3563
3564 * Makefile.in (clean): No longer run nextstep's clean.
3565
3566 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3567 (ns_frag): Remove.
3568 (ns-app): Move here from ns.mk, and simplify.
3569 (clean): Simplify nextstep entry.
3570 * ns.mk: Remove file.
3571
3572 2012-09-17 Kenichi Handa <handa@gnu.org>
3573
3574 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3575 not covert the last few charactes.
3576
3577 2012-09-16 Kenichi Handa <handa@gnu.org>
3578
3579 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3580 here, but just check the validity of glyphs in the glyph-string.
3581
3582 2012-09-16 Martin Rudalics <rudalics@gmx.at>
3583
3584 * window.c (Fwindow_parameter, Fset_window_parameter):
3585 Accept any window as argument (Bug#12452).
3586
3587 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3588
3589 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3590 to ns_term_init to avoid memory leak.
3591
3592 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3593 explicit retain/release.
3594 (ns_term_init): Only allow one display. Initialize outerpool and
3595 ns_*_types.
3596
3597 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3598
3599 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3600 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3601 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3602 the Microsoft problem in a different way, by altering ../nt/config.nt.
3603
3604 2012-09-15 Eli Zaretskii <eliz@gnu.org>
3605
3606 * w32xfns.c:
3607 * w32uniscribe.c:
3608 * w32term.c:
3609 * w32select.c:
3610 * w32reg.c:
3611 * w32proc.c:
3612 * w32menu.c:
3613 * w32inevt.c:
3614 * w32heap.c:
3615 * w32font.c:
3616 * w32fns.c:
3617 * w32console.c:
3618 * w32.c:
3619 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3620 by lisp.h. This completes removal of setjmp.h inclusion
3621 erroneously announced in the previous commit. (Bug#12446)
3622
3623 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3624 more accurate.
3625
3626 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3627 not defined as a macro. The latter happens on MS-Windows.
3628 (Bug#12446)
3629
3630 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3631
3632 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3633 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3634 Some instances of '#include <setjmp.h>' removed, if the
3635 only reason for the instance was because "lisp.h" was included.
3636 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3637 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3638 and _longjmp with the new symbols. Emacs already uses _setjmp if
3639 available, so this change affects only POSIXish hosts that have
3640 sigsetjmp but not _setjmp, such as some versions of Solaris and
3641 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3642 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3643 (png_load_body) [HAVE_PNG]:
3644 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3645 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3646 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3647 since PNG requires jmp_buf. This is the only exception to the
3648 general rule that we now use sys_setjmp and sys_longjmp.
3649 This exception is OK since this code does not change the signal
3650 mask or longjmp out of a signal handler.
3651
3652 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3653
3654 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3655 Include "syssignal.h", for 'main_thread'.
3656
3657 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3658
3659 Avoid out-of-range marker position (Bug#12426).
3660 * insdel.c (replace_range, replace_range_2):
3661 Adjust markers before overlays, as suggested by comments.
3662 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3663 Remove redundant check before calling offset_intervals.
3664
3665 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3666
3667 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3668 current buffer (Bug#12387).
3669
3670 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3671
3672 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3673
3674 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3675
3676 Use a more backwards-compatible timer format (Bug#12430).
3677 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3678 vector element, not from the 4th, since PSECS is now at the end.
3679 (Fcurrent_idle_time): Doc fix.
3680
3681 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3682
3683 Function to mark objects and remove killed buffers at once.
3684 * alloc.c (discard_killed_buffers): Rename to ...
3685 (mark_discard_killed buffers) ... new name. Add marking
3686 of remaining objects. Fix comment. Adjust users.
3687 (mark_object): Do not touch frame buffer lists here.
3688 * frame.c (delete_frame): Reset frame buffer lists here.
3689
3690 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3691
3692 Better workaround for GNOME bug when --enable-gcc-warnings.
3693 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3694 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3695 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3696
3697 Simplify SIGIO usage (Bug#12408).
3698 The code that dealt with SIGIO was crufty and confusing, e.g., it
3699 played tricks like "#undef SIGIO" but these tricks were not used
3700 consistently. Simplify mostly by not #undeffing standard symbols,
3701 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3702 or not as we please) rather than "defined SIGIO" (standard symbol
3703 that we probably shouldn't #undef).
3704 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3705 Modules that need it can include it.
3706 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3707 * dispextern.h (ignore_sigio): New decl.
3708 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3709 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3710 * emacs.c (shut_down_emacs):
3711 * keyboard.c (kbd_buffer_store_event_hold):
3712 Use ignore_sigio rather than invoking 'signal' directly.
3713 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3714 for FIONREAD.
3715 (FIONREAD, SIGIO): Do not #undef.
3716 (tty_read_avail_input): Use #error rather than a syntax error.
3717 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3718 for I_PIPE, used by SETUP_SLAVE_PTY.
3719 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3720 * sysdep.c (croak): Remove; no longer needed. This bit of
3721 temporary code, with Fred N. Fish's comment that it's temporary,
3722 has been in Emacs since at least 1992!
3723 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3724 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3725 * syssignal.h (croak): Remove decl.
3726 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3727 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3728 now that we're termios-only.
3729 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3730 * term.c (dissociate_if_controlling_tty): Use #error rather than
3731 a run-time error.
3732
3733 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3734 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3735 to work around GNOME bug 683906.
3736 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3737 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3738 This works around GCC bug 54561.
3739
3740 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3741
3742 More fixes for 'volatile' and setjmp/longjmp.
3743 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3744 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3745 (png_load_body) [HAVE_PNG]:
3746 (jpeg_load_body) [HAVE_JPEG]:
3747 New function, with most of the old parent function's body.
3748 (png_load) [HAVE_PNG]:
3749 (jpeg_load) [HAVE_JPEG]:
3750 Invoke the new function, to avoid longjmp munging our locals.
3751 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3752 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3753 longjmp is passed 2, as the C standard doesn't guarantee this.
3754 Instead, store the failure code into mgr->failure_code.
3755
3756 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3757
3758 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3759 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3760 (syms_of_keyboard): Remove support for unread-command-char.
3761
3762 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3763
3764 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3765 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3766 violation. (Bug#12426)
3767
3768 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3769
3770 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3771
3772 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3773
3774 * eval.c: Add `inhibit-debugger'.
3775 (Qinhibit_debugger): New symbol.
3776 (call_debugger): Bind it instead of Qdebug_on_error.
3777 (maybe_call_debugger): Test Vinhibit_debugger.
3778 (syms_of_eval): Define inhibit-debugger.
3779 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3780 (syms_of_xdisp): Remove inhibit-debug-on-message.
3781
3782 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3783
3784 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3785 If a nonvolatile local variable is written before a _longjmp to
3786 the frame containing the variable, and is read after the _longjmp,
3787 the value read is indeterminate. Some local variables of type
3788 'struct handler' and 'struct catchtag' are used in this way, so
3789 mark each of their slots as volatile if the slot can be set before
3790 _longjmp and read afterwards.
3791 * lisp.h (struct handler): var and chosen_clause are now volatile.
3792 (struct catchtag): val, next, and pdlcount are now volatile.
3793
3794 * bidi.c (bidi_push_it, bidi_pop_it):
3795 * fns.c (copy_hash_table):
3796 * image.c (define_image_type):
3797 * keyboard.c (kbd_buffer_store_event_hold):
3798 * process.c (Fprocess_send_eof):
3799 * xfaces.c (x_create_gc) [HAVE_NS]:
3800 * xgselect.c (xg_select):
3801 Prefer assignment to memcpy when either will do.
3802
3803 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3804 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3805 time an item is removed. No need to mark this function 'inline';
3806 the compiler knows better than we do.
3807
3808 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3809
3810 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3811 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3812 to change_frame_size (Bug#12388).
3813 (windowDidResize:): Pass YES to updateFrameSize.
3814
3815 * nsterm.h: Add delay parameter to updateFrameSize.
3816
3817 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3818
3819 Discard killed buffers from deleted window and frame objects.
3820 This reduces an amount of references to killed buffers and
3821 helps GC to reclaim them faster.
3822 * alloc.c (discard_killed_buffers): New function.
3823 (mark_object): Use it for deleted windows and frames.
3824 (mark_object): If symbol's value is set up for a killed buffer
3825 or deleted frame, restore its global binding.
3826 * data.c (swap_in_global_binding): Add GC notice.
3827 (swap_in_symval_forwarding): Use convenient set_blv_where.
3828 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3829 * window.h: ... to here.
3830
3831 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3832
3833 Convenient macro to check whether the buffer is live.
3834 * buffer.h (BUFFER_LIVE_P): New macro.
3835 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3836 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3837
3838 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3839
3840 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3841 composition cases (Bug#12364).
3842
3843 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3844 overhang of succeeding glyphs overlapping box cursor.
3845
3846 * w32term.c (x_draw_glyph_string): Likewise.
3847
3848 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3849
3850 Simplify, document, and port floating-point (Bug#12381).
3851 The porting part of this patch fixes bugs on non-IEEE platforms
3852 with frexp, ldexp, logb.
3853 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3854 Now static.
3855 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3856 support, by removing commented-out code and briefly listing the
3857 C89 functions excluded. The commented-out stuff was confusing
3858 maintenance, e.g., we thought we needed cbrt but it was commented out.
3859 (logb): Remove decl; no longer needed.
3860 (isfinite): New macro, if not already supplied.
3861 (isnan): Don't replace any existing macro.
3862 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3863 are present on all C89 platforms.
3864 (Ffrexp): Do not special-case zero, as frexp does the right thing
3865 for that case.
3866 (Flogb): Do not use logb, as it doesn't have the desired meaning
3867 on hosts that use non-base-2 floating point. Instead, stick with
3868 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3869 frexp, to avoid getting an unspecified result.
3870
3871 * xdisp.c (Qinhibit_debug_on_message): Now static.
3872
3873 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3874
3875 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3876 NSBezierPath (Bug#12131).
3877
3878 2012-09-10 Chong Yidong <cyd@gnu.org>
3879
3880 * fns.c (Fdelq, Fdelete): Doc fix.
3881
3882 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3883
3884 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3885 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3886
3887 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3888
3889 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3890 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3891 Use it.
3892
3893 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3894
3895 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3896 left fringe if the window has a left margin. This avoids leaving
3897 traces of the cursor because its leftmost pixel is not drawn over.
3898
3899 * dispnew.c (update_window_line): When the left margin area of a
3900 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3901 that screen line. (Bug#12277)
3902
3903 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3904
3905 Assume C89 or later for math functions (Bug#12381).
3906 This simplifies the code, and makes it a bit smaller and faster,
3907 and (most important) makes it easier to clean up signal handling
3908 since we can stop worring about floating-point exceptions in
3909 library code. That was a problem before C89, but the problem
3910 went away many years ago on all practical Emacs targets.
3911 * data.c, image.c, lread.c, print.c:
3912 Don't include <math.h>; no longer needed.
3913 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3914 might be autoconfigured, as that never happens.
3915 * data.c (fmod):
3916 * doprnt.c (DBL_MAX_10_EXP):
3917 * print.c (DBL_DIG):
3918 Remove. C89 or later always defines these.
3919 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3920 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3921 (arith_error, domain_error, domain_error2):
3922 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3923 no longer needed -- we simply return what C returns. All uses removed.
3924 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3925 the wrapped code.
3926 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3927 Remove. All uses expanded, as these macros are no longer used
3928 more than once and are now more trouble than they're worth.
3929 (Ftan): Use tan, not sin / cos.
3930 (Flogb): Assume C89 frexp.
3931 (fmod_float): Assume C89 fmod.
3932 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3933 (init_floatfns): Remove. All uses removed.
3934
3935 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3936
3937 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3938 compositeToPoint for OSX < 10.6 (Bug#12390).
3939
3940 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3941
3942 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3943 This produces more-accurate results.
3944
3945 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3946
3947 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3948 changes (Bug#12088).
3949
3950 2012-09-08 Chong Yidong <cyd@gnu.org>
3951
3952 * syntax.c (Fstring_to_syntax): Doc fix.
3953
3954 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3955
3956 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3957 in the internal border.
3958 (x_set_window_size): Remove static variables and their usage.
3959 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3960 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3961 Remove fringe/internal border adjustment (Bug#11052).
3962 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3963 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3964 (ns_fix_rect_ibw): Remove.
3965 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3966 (ns_dumpglyphs_box_or_relief): Ditto.
3967 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3968 adjustment.
3969 (ns_dumpglyphs_image): Ditto.
3970 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
3971 border adjustment.
3972 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3973 their usage. Add fringe_extended_p and its use as in other terms.
3974 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3975 scroll bar was removed.
3976 (updateFrameSize): New function.
3977 (windowDidResize): Move code to updateFrameSize and call it.
3978
3979 * nsterm.h (EmacsView): Add updateFrameSize.
3980
3981 2012-09-07 Chong Yidong <cyd@gnu.org>
3982
3983 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3984
3985 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3986
3987 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3988
3989 More signal-handler cleanup (Bug#12327).
3990 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3991 Problem introduced when merging patches. Noted by Eli Zaretskii in
3992 <http://bugs.gnu.org/12327#67>.
3993 * floatfns.c: Comment fix.
3994 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3995 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3996 and anyway the declaration is harmless even if SIGDANGER is not defined.
3997 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3998 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3999 source files not surprisingly expected syssignal.h to define, or
4000 not define, SIGIO, and it's cleaner to do it that way, for consistency.
4001 Include <sys/ioctl.h>, for FIONREAD.
4002 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
4003 This eliminates a problem whereby other files mysteriously had
4004 to include "syssignal.h" before including "systty.h" if they
4005 wanted to use "#ifdef SIGIO".
4006
4007 2012-09-07 Eli Zaretskii <eliz@gnu.org>
4008
4009 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
4010
4011 * w32.c (sigemptyset): Empty the set.
4012 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
4013
4014 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
4015
4016 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
4017
4018 * alloc.c (mark_buffer): Revert unsafe marking optimization.
4019 (mark_object): Likewise for frame objects.
4020
4021 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4022
4023 * syssignal.h (handle_on_main_thread): Always declare,
4024 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
4025 This ports to platforms without HAVE_PTHREAD.
4026
4027 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4028
4029 Signal-handler cleanup (Bug#12327).
4030 Emacs's signal handlers were written in the old 4.2BSD style with
4031 sigblock and sigmask and so forth, and this led to some
4032 inefficiencies and confusion. Rewrite these to use
4033 pthread_sigmask etc. without copying signal sets around. Also,
4034 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
4035 'signal', and instead use functions that do not attempt to take
4036 over the system name space. This patch causes Emacs's text
4037 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
4038 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
4039 Do not include <signal.h> or "syssignal.h", as these
4040 modules do not use signals.
4041 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
4042 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
4043 Do not include <signal.h>, as "syssignal.h" does that for us now.
4044 * atimer.c (sigmask_atimers): New function.
4045 (block_atimers, unblock_atimers): New functions,
4046 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
4047 All uses replaced.
4048 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
4049 no longer needed here.
4050 * emacs.c (main): Inspect existing signal handler with sigaction,
4051 so that there's no need to block and unblock SIGHUP.
4052 * sysdep.c (struct save_signal): New member 'action', replacing
4053 old member 'handler'.
4054 (save_signal_handlers, restore_signal_handlers):
4055 Use sigaction instead of 'signal' to save and restore.
4056 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
4057 New function. All users of 'signal' modified to use set_sighandler
4058 if they're writeonly, and to use sys_signal if they're read+write.
4059 (emacs_sigaction_init, forwarded_signal): New functions.
4060 (sys_signal): Remove. All uses replaced by calls to sigaction
4061 and emacs_sigaction_init, or by direct calls to 'signal'.
4062 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
4063 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
4064 all uses replaced by pthread_sigmask etc. calls.
4065 * syssignal.h: Include <signal.h>.
4066 (emacs_sigaction_init, forwarded_signal): New decls.
4067 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
4068 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
4069 (sigmask, sys_sigmask): Remove; no longer needed.
4070 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
4071 (sigblock, sigunblock, sigfree):
4072 (sigsetmask) [!defined sigsetmask]:
4073 Remove. All uses replaced by pthread_sigmask.
4074 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
4075 no longer need to be replaced, and its typical old uses
4076 are now done via emacs_sigaction_init and sigaction.
4077 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
4078 (sys_sigdel): Remove; unused.
4079 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
4080
4081 2012-09-06 Eli Zaretskii <eliz@gnu.org>
4082
4083 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
4084 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
4085
4086 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4087
4088 Explicitly mark buffer_defaults and buffer_local_symbols.
4089 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
4090 mark_local_symbols here.
4091 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
4092 since special buffers aren't marked here any more.
4093 (allocate_buffer): Chain new buffer with all_buffers here...
4094 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
4095 not here.
4096 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
4097 (syms_of_buffer): Remove staticpro of the above.
4098 (init_buffer_once): Set names for buffer_defaults and
4099 buffer_local_symbols.
4100
4101 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4102
4103 Use bool for booleans in font-related modules.
4104 * font.c (font_intern_prop, font_style_to_value)
4105 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
4106 (generate_otf_features, font_check_otf_features, font_check_otf)
4107 (font_match_p, font_list_entities, font_at):
4108 * fontset.c (fontset_id_valid_p, reorder_font_vector
4109 (fontset_find_font, Fset_fontset_font)
4110 (face_suitable_for_char_p) [0]:
4111 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
4112 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
4113 (m17n_flt_initialized, ftfont_shape_by_flt):
4114 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
4115 * nsfont.m (nsfont_draw):
4116 * w32font.c (w32font_draw):
4117 * w32term.c (x_draw_glyphless_glyph_string_foreground):
4118 Use bool for booleans.
4119 * font.h: Adjust to above API changes.
4120 (struct font, struct font_driver, struct font_driver_list):
4121 Use bool for booleans.
4122 (struct font): Remove useless member encoding_type.
4123 All users removed.
4124 * fontset.c, xftfont.c: Omit unnecessary static decls.
4125
4126 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4127
4128 * alloc.c (mark_object): Revert window marking code
4129 since it's unsafe for the Fset_window_configuration.
4130
4131 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4132
4133 Fix race conditions with signal handlers and errno (Bug#12327).
4134 Be more systematic about preserving errno whenever a signal
4135 handler returns, even if it's not in the main thread. Do this by
4136 renaming signal handlers to distinguish between signal delivery
4137 and signal handling. All uses changed.
4138 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
4139 * data.c (deliver_arith_signal): Rename from arith_error.
4140 * dispnew.c (deliver_window_change_signal): Rename from
4141 window_change_signal.
4142 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
4143 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
4144 * keyboard.c (deliver_input_available_signal): Rename from
4145 input_available_signal.
4146 (deliver_user_signal): Rename from handle_user_signal.
4147 (deliver_interrupt_signal): Rename from interrupt_signal.
4148 * process.c (deliver_pipe_signal): Rename from send_process_trap.
4149 (deliver_child_signal): Rename from sigchld_handler.
4150 * atimer.c (handle_alarm_signal):
4151 * data.c (handle_arith_signal):
4152 * dispnew.c (handle_window_change_signal):
4153 * emacs.c (handle_fatal_signal, handle_danger_signal):
4154 * keyboard.c (handle_input_available_signal):
4155 * keyboard.c (handle_user_signal, handle_interrupt_signal):
4156 * process.c (handle_pipe_signal, handle_child_signal):
4157 New functions, with the actual signal-handling code taken from the
4158 original respective signal handlers, sans the sporadic attempts to
4159 preserve errno, since that's now done by handle_on_main_thread.
4160 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
4161 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
4162 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4163 Move to sysdep.c.
4164 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4165 Move initialization of main_thread to sysdep.c's init_signals.
4166 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
4167 our usage, and simplifies the mainline code.
4168 (record_child_status_change): New static function, as a helper
4169 for handle_child_signal, and with most of the old child handler's
4170 contents.
4171 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
4172 (handle_child_signal): Use the above.
4173 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4174 Moved here from emacs.c.
4175 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
4176 code moved here from emacs.c's main function.
4177 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
4178 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
4179 This lets callers save and restore errno properly.
4180
4181 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4182
4183 Remove redundant or unused things here and there.
4184 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
4185 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
4186 * editfns.c (Fcompare_buffer_substrings): Likewise.
4187 * frame.h (struct terminal, struct font_driver_list):
4188 Remove redundant declarations.
4189 * window.h (Qleft, Qright): Likewise.
4190
4191 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4192
4193 Do not mark objects from deleted buffers, windows and frames.
4194 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
4195 (mark_object): Likewise for windows and frames.
4196
4197 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4198
4199 * alloc.c (valid_lisp_object_p): Treat killed buffers,
4200 buffer_defaults and buffer_local_symbols as valid objects.
4201 Return special value to denote them.
4202
4203 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4204
4205 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
4206 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
4207 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
4208 (file_name_absolute_p, Fsubstitute_in_file_name):
4209 (check_executable, check_writable, Ffile_accessible_directory_p)
4210 (Fset_file_selinux_context, Fdefault_file_modes)
4211 (Finsert_file_contents, choose_write_coding_system)
4212 (Fwrite_region, build_annotations, a_write, e_write)
4213 (Fdo_auto_save):
4214 * filelock.c (boot_time_initialized, get_boot_time)
4215 (get_boot_time_1, lock_file_1, within_one_second):
4216 * floatfns.c (in_float):
4217 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
4218 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
4219 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
4220 * lisp.h (struct Lisp_Hash_Table.cmpfn):
4221 * window.c (compare_window_configurations):
4222 Use bool for booleans.
4223 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
4224 (Fdefault_file_modes): Now mode_t, not int, for modes.
4225 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
4226 (internal_delete_file): Now returns void, not a (boolean) int,
4227 since nobody was looking at the return value.
4228 * lisp.h, window.h: Adjust to above API changes.
4229
4230 * xdisp.c (set_message): Simplify and reindent last change.
4231
4232 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
4233
4234 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
4235
4236 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
4237
4238 * eval.c (call_debugger): Make the function non-static so that we
4239 can call it from set_message.
4240
4241 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
4242 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
4243
4244 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4245
4246 Give more-useful info on a fatal error (Bug#12328).
4247 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4248 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4249 of doing the work ourselves.
4250 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4251 do most of the work.
4252 (fatal_error_backtrace): New function, taken from the guts
4253 of the old fatal_error_signal, but with a new option to output
4254 a backtrace.
4255 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4256 info about the signal than just its number.
4257 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4258 * sysdep.c: Include <execinfo.h>
4259 (emacs_backtrace): New function, taken partly from the previous
4260 code of the 'die' function.
4261 (emacs_abort): Call fatal_error_backtrace rather than abort.
4262
4263 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4264
4265 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4266 eager (load-time) macro-expansion.
4267 * lisp.mk (lisp): Add macroexp.
4268
4269 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4270
4271 Simplify redefinition of 'abort' (Bug#12316).
4272 Do not try to redefine the 'abort' function. Instead, redo
4273 the code so that it calls 'emacs_abort' rather than 'abort'.
4274 This removes the need for the NO_ABORT configure-time macro
4275 and makes it easier to change the abort code to do a backtrace.
4276 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4277 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4278 Remove; sysdep.c's emacs_abort now takes its place.
4279 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4280 'abort' changed to use 'emacs_abort'.
4281 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4282 (abort) [!defined abort]: Rename to ...
4283 (emacs_abort): ... new name.
4284 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4285 the place of the old 'abort' in emacs.c.
4286 * w32.c, w32fns.c (abort): Do not #undef.
4287 * w32.c (emacs_abort): Rename from w32_abort.
4288
4289 2012-09-04 Eli Zaretskii <eliz@gnu.org>
4290
4291 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4292 offsets[j].dv, since the y axis of the screen coordinates points
4293 down, while the y axis of the font definition coordinates points
4294 up. This fixes display of Arabic diacritics such as KASRA and
4295 KASRATAN. (Bug#11860)
4296
4297 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4298
4299 Be more systematic about _setjmp vs setjmp.
4300 * alloc.c (test_setjmp, mark_stack):
4301 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4302 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4303 (png_load, my_error_exit, jpeg_load):
4304 * process.c (send_process_trap, send_process):
4305 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4306 The underscored versions are up to 30x faster on some hosts.
4307 Formerly, the code used setjmp+longjmp sometimes and
4308 _setjmp+_longjmp at other times, with no particular reason to
4309 prefer setjmp+longjmp.
4310
4311 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4312
4313 Fix minor problem found by static checking.
4314 * buffer.c (Fdelete_all_overlays): Return nil.
4315
4316 2012-09-03 Martin Rudalics <rudalics@gmx.at>
4317
4318 * buffer.c (Fdelete_all_overlays): New function.
4319
4320 2012-09-03 Chong Yidong <cyd@gnu.org>
4321
4322 * gtkutil.c: Add extern decl for Qxft.
4323
4324 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4325
4326 * emacs.c, eval.c: Use bool for boolean.
4327 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4328 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4329 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4330 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4331 (main, decode_env_path, Fdaemon_initialized):
4332 * eval.c (call_debugger, Finteractive_p, interactive_p):
4333 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4334 (maybe_call_debugger, Fbacktrace):
4335 * process.c (read_process_output, exec_sentinel):
4336 Use bool for booleans.
4337 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4338 All callers changed.
4339 * eval.c (interactive_p): Omit always-true boolean argument
4340 EXCLUDE_SUBRS_P. All callers changed.
4341 * dispextern.h, lisp.h: Reflect above API changes.
4342 * firstfile.c (dummy): Use the address of 'main', whose signature
4343 won't change, instead of the address of 'initialize', whose
4344 signature just changed from int to bool.
4345 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4346 * msdos.c (fatal_error_in_progress): ... from here.
4347 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4348 of incrementing it.
4349 (redisplay_internal, unwind_redisplay): Simply clear
4350 REDISPLAYING_P when unwinding, instead of saving its previous,
4351 always-false value and then restoring it.
4352
4353 Clean up some extern decls.
4354 Mostly, this hoists extern decls out of .c files and into .h files.
4355 That way, we're more likely to catch errors if the interfaces change.
4356 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4357 declare xg_mark_data.
4358 * dispextern.h (x_frame_parm_handlers):
4359 * font.h (Qxft):
4360 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4361 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4362 (Qultra_bold, Qoblique, Qitalic):
4363 Move extern decl here from .c file.
4364 * alloc.c (xg_mark_data) [USE_GTK]:
4365 * doc.c (Qclosure):
4366 * eval.c (Qlexical_binding):
4367 * fns.c (time) [!HAVE_UNISTD_H]:
4368 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4369 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4370 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4371 * lread.c (Qinternal_interpreter_environment):
4372 * minibuf.c (Qbuffer):
4373 * process.c (QCfamily, QCfilter):
4374 * widget.c (free_frame_faces):
4375 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4376 * xfont.c (x_clear_errors):
4377 * xterm.c (x_frame_parm_handlers):
4378 Remove now-redundant extern decls.
4379 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4380 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4381 Now static.
4382 * xfaces.c: Remove unnecessary static decls.
4383 * xterm.c (updating_frame): Remove decl of nonexistent object.
4384
4385 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4386 when building globals.h, as the objects that are not built on
4387 this host are not needed to compile C files on this host.
4388
4389 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4390
4391 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4392
4393 * frame.h: Add missing prototype for x_wm_set_size_hint.
4394
4395 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4396
4397 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4398 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4399 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4400 (Fsubstitute_command_keys):
4401 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4402 (save_excursion_save, save_excursion_restore)
4403 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4404 (format_time_string, general_insert_function)
4405 (make_buffer_string, make_buffer_string_both)
4406 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4407 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4408 (copy_text, insert_1, insert_1_both, insert_from_string)
4409 (insert_from_string_before_markers, insert_from_string_1)
4410 (insert_from_buffer, insert_from_buffer_1, replace_range)
4411 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4412 (del_range_2, modify_region):
4413 * intervals.c (intervals_equal, balance_possible_root_interval)
4414 (adjust_intervals_for_insertion, merge_properties_sticky)
4415 (graft_intervals_into_buffer, lookup_char_property)
4416 (adjust_for_invis_intang, set_point_both)
4417 (get_property_and_range, compare_string_intervals)
4418 (set_intervals_multibyte_1, set_intervals_multibyte):
4419 * keyboard.c (decode_timer):
4420 Use bool for boolean.
4421 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4422 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4423
4424 2012-09-02 Chong Yidong <cyd@gnu.org>
4425
4426 * keymap.c (push_key_description): Print M-TAB as C-M-i
4427 (Bug#11758).
4428
4429 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
4430
4431 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4432 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4433 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4434 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4435 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4436 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4437 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4438
4439 2012-09-01 Eli Zaretskii <eliz@gnu.org>
4440
4441 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4442 more than one grapheme cluster passed to the shaper: compute the
4443 offset adjustment values separately for each cluster. (Bug#11860)
4444
4445 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4446 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4447 about implicit conversions from integer to pointer.
4448
4449 2012-09-01 Daniel Colascione <dancol@dancol.org>
4450
4451 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4452 system used too early.
4453
4454 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4455
4456 Better seed support for (random).
4457 * emacs.c (main): Call init_random.
4458 * fns.c (Frandom): Set the seed from a string argument, if given.
4459 Remove long-obsolete Gentzel cruft.
4460 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4461 (init_random): New function.
4462
4463 2012-09-01 Daniel Colascione <dancol@dancol.org>
4464
4465 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4466 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4467 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4468 x_wm_set_size_hint, x_query_colors, x_real_positions,
4469 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4470 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4471 all of which have been moved to common code.
4472
4473 * xfaces.c: Include TERM_HEADER instead of listing all possible
4474 window-system headers.
4475
4476 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4477 to match header.
4478
4479 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4480 directly accessing frame internals.
4481
4482 * w32font.h: Include font.h. Define syms_of_w32font and
4483 globals_of_w32font.
4484
4485 * process.c: Include TERM_HEADER instead of listing all possible
4486 window-system headers.
4487
4488 * nsterm.h: Remove declarations now in frame.h.
4489 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
4490
4491 * menu.c: Include TERM_HEADER instead of listing all possible
4492 window-system headers.
4493
4494 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4495 window system.
4496
4497 * keyboard.c: Include TERM_HEADER instead of listing all possible
4498 window-system headers.
4499
4500 * image.c: Include TERM_HEADER instead of listing all possible
4501 window-system headers. Declare Vlibrary_cache when compiling for
4502 Windows.
4503
4504 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4505 window system declarations.
4506
4507 * frame.h: Move common functions here: set_frame_menubar,
4508 x_set_window_size, x_sync, x_get_focus_frame,
4509 x_set_mouse_position, x_set_mouse_pixel_position,
4510 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4511 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4512 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4513 x_activate_menubar, x_real_positions, x_bitmap_icon,
4514 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4515 and x_query_colors.
4516
4517 * frame.c: Include TERM_HEADER instead of listing all possible
4518 window-system headers.
4519
4520 * font.c: Include TERM_HEADER instead of listing all possible
4521 window-system headers.
4522
4523 * emacs.c: Include TERM_HEADER.
4524
4525 * dispnew.c: Include TERM_HEADER instead of listing all possible
4526 window-system headers.
4527
4528 * ccl.h: Include character.h.
4529
4530 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4531 the current window system; include in list of objects to link into
4532 Emacs.
4533
4534 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4535
4536 Remove mark_ttys function and fix tty_display_info initialization.
4537 * lisp.h (mark_ttys): Remove prototype.
4538 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4539 to mark_ttys because all possible values of 'top_frame' slot are
4540 the frames which are reachable from Vframe_list.
4541 * term.c (mark_ttys): Remove.
4542 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4543
4544 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4545
4546 Change struct frame bitfields from unsigned char to unsigned.
4547 * frame.h (struct frame): Change type of 'display_preempted',
4548 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4549 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4550 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4551 bitfields from unsigned char to unsigned.
4552
4553 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4554
4555 Remove unused member of struct x_output and struct w32_output.
4556 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4557 * w32term.h (struct w32_output): Likewise.
4558
4559 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4560
4561 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4562 does not become zero (Bug#12234).
4563
4564 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4565
4566 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4567 for GCC 4.7.1 x86-64.
4568
4569 2012-08-30 Glenn Morris <rgm@gnu.org>
4570
4571 * lread.c (init_lread): For out-of-tree builds, only add the
4572 source directory's site-lisp dir to the load-path if it exists,
4573 consistent with in-tree builds. (Bug#12302)
4574
4575 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4576
4577 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4578 button_values to NULL. Call setStykeMask so dialogs get a close button.
4579 (windowShouldClose:): Set window_closed.
4580 (dealloc): New member, free button_values.
4581 (process_dialog:): Make member function. Remove window argument,
4582 replace window with self. Count buttons and allocate and store values
4583 in button_values.
4584 (addButton:value:row:): value is int with the name tag. Call setTag
4585 with tag. Remove return self, declare return value as void.
4586 (addString:row:): Remove return self, declare return value as void.
4587 (addSplit): Remove return self, declare return value as void.
4588 (clicked:): Remove return self, declare return value as void.
4589 Set dialog_return to button_values[seltag]. Code formatting change.
4590 (initFromContents:isQuestion:): Adjust call to process_dialog.
4591 Code formatting change.
4592 (timeout_handler:): Set timer_fired to YES.
4593 (runDialogAt:): Set timer_fired to NO.
4594 Handle click on close button as quit.
4595
4596 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4597 Add window_closed and button_values. Add void as return value for
4598 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4599 Add process_dialog as new member.
4600
4601 2012-08-28 Eli Zaretskii <eliz@gnu.org>
4602
4603 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4604 is not one of the heaps we manage. (Bug#12242)
4605
4606 2012-08-28 Glenn Morris <rgm@gnu.org>
4607
4608 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4609
4610 2012-08-28 Martin Rudalics <rudalics@gmx.at>
4611
4612 * window.c (Fset_window_configuration): Remove handling of
4613 auto-buffer-name window parameter. Install revision of reverted
4614 fix.
4615
4616 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4617
4618 Do not allow to set major mode for a dead buffer.
4619 * buffer.c (Fset_buffer_major_mode): Signal an error
4620 if the buffer is dead.
4621 (Fother_buffer, other_buffer_safely): Remove redundant
4622 nested declaration.
4623
4624 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4625
4626 Always use set_buffer_if_live to restore original buffer at unwind.
4627 * buffer.h (record_unwind_current_buffer): New function.
4628 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4629 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4630 * undo.c, window.c: Adjust users.
4631 * buffer.c (set_buffer_if_live): Fix comment.
4632
4633 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4634
4635 Fix usage of set_buffer_internal.
4636 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4637 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4638 * coding.c (decode_coding): Omit redundant test.
4639 * fileio.c (decide_coding_unwind): Likewise.
4640 * fns.c (secure_hash): Likewise.
4641 * insdel.c (modify_region): Likewise.
4642 * keyboard.c (command_loop_1): Likewise.
4643 * print.c (PRINTFINISH): Likewise.
4644 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4645
4646 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4647
4648 * dispnew.c: Use bool for boolean.
4649 (frame_garbaged, display_completed, delayed_size_change)
4650 (fonts_changed_p, add_window_display_history)
4651 (add_frame_display_history, verify_row_hash)
4652 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4653 (row_equal_p, realloc_glyph_pool)
4654 (allocate_matrices_for_frame_redisplay)
4655 (showing_window_margins_p)
4656 (adjust_frame_glyphs_for_frame_redisplay)
4657 (build_frame_matrix_from_leaf_window, make_current)
4658 (mirrored_line_dance, mirror_line_dance, update_frame)
4659 (update_window_tree, update_single_window)
4660 (check_current_matrix_flags, update_window, update_text_area)
4661 (update_window_line, set_window_update_flags, scrolling_window)
4662 (update_frame_1, scrolling, buffer_posn_from_coords)
4663 (do_pending_window_change, change_frame_size)
4664 (change_frame_size_1, sit_for):
4665 Use bool for boolean.
4666 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4667 and remove last int (actually boolean) argument, which was always 0.
4668 All callers changed.
4669 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4670 * dispextern.h (struct composition_it): Use bool for boolean.
4671 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4672 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4673 * dired.c (file_name_completion):
4674 Use bool for boolean. (This was missed in an earlier change.)
4675
4676 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4677
4678 * window.c (Fset_window_configuration): Revert first part of
4679 last change.
4680
4681 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4682
4683 * nsterm.h (NSPanel): New class variable dialog_return.
4684
4685 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4686 Initialize dialog_return.
4687 (windowShouldClose:): Use stop instead of stopModalWithCode.
4688 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4689 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4690 event.
4691 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4692 modal loop returns.
4693
4694 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4695
4696 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4697 * composite.c (find_composition, composition_gstring_p)
4698 (composition_reseat_it, find_automatic_composition):
4699 * data.c (let_shadows_buffer_binding_p)
4700 (let_shadows_global_binding_p, set_internal, make_blv)
4701 (Fmake_variable_buffer_local, Fmake_local_variable)
4702 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4703 (cons_to_signed, arith_driver):
4704 * dbusbind.c (xd_in_read_queued_messages):
4705 * dired.c (directory_files_internal, file_name_completion):
4706 Use bool for booleans.
4707 * dired.c (file_name_completion):
4708 * process.h (fd_callback):
4709 Omit int (actually boolean) argument. It wasn't being used.
4710 All uses changed.
4711 * composite.h, lisp.h: Reflect above API changes.
4712
4713 * cmds.c, coding.c: Use bool for booleans.
4714 * cmds.c (move_point, Fself_insert_command):
4715 * coding.h (struct composition status, struct coding_system):
4716 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4717 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4718 (emacs_mule_char, decode_coding_emacs_mule)
4719 (encode_coding_emacs_mule, detect_coding_iso_2022)
4720 (decode_coding_iso_2022, encode_invocation_designation)
4721 (encode_designation_at_bol, encode_coding_iso_2022)
4722 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4723 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4724 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4725 (encode_coding_raw_text, detect_coding_charset)
4726 (decode_coding_charset, encode_coding_charset, detect_eol)
4727 (detect_coding, get_translation_table, produce_chars)
4728 (consume_chars, reused_workbuf_in_use)
4729 (make_conversion_work_buffer, code_conversion_save)
4730 (decode_coding_object, encode_coding_object)
4731 (detect_coding_system, char_encodable_p)
4732 (Funencodable_char_position, code_convert_region)
4733 (code_convert_string, code_convert_string_norecord)
4734 (Fset_coding_system_priority):
4735 * fileio.c (Finsert_file_contents):
4736 Use bool for booleans.
4737 * coding.h, lisp.h: Reflect above API changes.
4738 * coding.c: Remove unnecessary static function decls.
4739 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4740 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4741 not a boolean 'int', since callers never look at the return value.
4742 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4743 * coding.h (decoding_buffer_size, encoding_buffer_size)
4744 (emacs_mule_string_char): Remove unused extern decls.
4745 (struct iso_2022_spec, struct coding_system):
4746 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4747 (struct emacs_mule_spec): Remove unused field 'full_support'.
4748 All initializations removed.
4749 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4750
4751 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4752
4753 Fix spare memory change (Bug#12286).
4754 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4755 (valid_lisp_object_p): Likewise.
4756
4757 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4758
4759 * window.c (Fset_window_configuration): Record any window's old
4760 buffer if it's replaced (see Bug#8789). If the new current
4761 buffer doesn't appear in the selected window, go to its old
4762 point (Bug#12208).
4763
4764 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4765
4766 Special MEM_TYPE_SPARE to denote reserved memory.
4767 * alloc.c (enum mem_type): New memory type.
4768 (refill_memory_reserve): Use new type for spare memory.
4769 This prevents live_cons_p and live_string_p from incorrect
4770 detection of uninitialized objects from spare memory as live.
4771
4772 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4773
4774 Spelling fixes.
4775 * Makefile.in (.PHONY): versioclean -> versionclean.
4776
4777 Remove unused external symbols.
4778 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4779 * window.c (Qwindow_valid_p, decode_valid_window):
4780 Now static, not extern.
4781 * data.c (Qinterval): Remove; unused.
4782 (syms_of_data): Do not define 'interval'.
4783 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4784 * window.h (decode_valid_window):
4785 Remove decls.
4786
4787 * character.c, charset.c, chartab.c: Use bool for booleans.
4788 * character.c (lisp_string_width, string_count_byte8)
4789 (string_escape_byte8):
4790 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4791 (load_charset_map_from_file, map_charset_chars)
4792 (Fdefine_charset_internal, define_charset_internal)
4793 (Fdeclare_equiv_charset, find_charsets_in_text)
4794 (Ffind_charset_region, char_charset, Fiso_charset):
4795 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4796 (sub_char_table_set, sub_char_table_set_range)
4797 (char_table_set_range, optimize_sub_char_table)
4798 (map_sub_char_table):
4799 Use bool for boolean.
4800 * character.c (str_to_unibyte): Omit last boolean argument; it was
4801 always 0. All callers changed.
4802 * character.h, charset.h: Adjust to match previous changes.
4803 * character.h (char_printable_p): Remove decl of nonexistent function.
4804 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4805 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4806 are all boolean, so make them single-bit bitfields.
4807
4808 * lisp.h (ASET): Remove attempt to detect side effects.
4809 It was meant to be temporary and it often doesn't work,
4810 because when IDX has side effects the behavior of IDX==IDX
4811 is undefined. See Stefan Monnier in
4812 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4813
4814 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4815
4816 * lisp.h (functionp): New function (extracted from Ffunctionp).
4817 (FUNCTIONP): Use it.
4818 * eval.c (Ffunctionp): Use it.
4819
4820 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4821
4822 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4823 as that's faster and simpler than static storage. Don't bother
4824 with the g_main_context_query overhead if g_main_context_pending
4825 says no events are pending.
4826 (gfds, gfds_size): Remove these static vars.
4827 (xgselect_initialize): Remove; no longer needed.
4828 All uses and decls removed.
4829
4830 * emacs.c (fatal_error_signal_hook): Remove.
4831 All uses removed. This leftover from old code was always 0.
4832
4833 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4834 * casefiddle.c (casify_object, casify_region):
4835 * casetab.c (set_case_table):
4836 * category.c, category.h (word_boundary_p):
4837 * category.h (CHAR_HAS_CATEGORY):
4838 Use bool for booleans, instead of int.
4839
4840 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4841
4842 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4843
4844 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4845
4846 On assertion failure, print backtrace if available.
4847 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4848 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4849 * Makefile.in (LIB_EXECINFO): New macro.
4850 (LIBES): Use it.
4851
4852 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4853 * bytecode.c (exec_byte_code):
4854 * callint.c (check_mark, Fcall_interactively):
4855 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4856 (getenv_internal, sync_process_alive, call_process_exited):
4857 * lisp.h (USE_SAFE_ALLOCA):
4858 Use bool for booleans, instead of int.
4859 * lisp.h, process.h: Adjust prototypes to match above changes.
4860 * callint.c (Fcall_interactively): Don't assume the mark's
4861 offset fits in 'int'.
4862
4863 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4864
4865 * buffer.c, buffer.h: Use bool for boolean.
4866 * buffer.c (reset_buffer_local_variables)
4867 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4868 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4869 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4870 (overlay_touches_p, overlay_strings, Foverlay_put)
4871 (report_overlay_modification, call_overlay_mod_hooks):
4872 (mmap_enlarge, mmap_set_vars):
4873 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4874 Use bool for booleans, instead of int.
4875 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4876 since the 1-or-0 return value is always ignored anyway.
4877 (mmap_initialized_p):
4878 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4879 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4880
4881 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4882
4883 * bidi.c: Use bool for boolean.
4884 This is a bit more readable, and makes the text segment of bidi.o
4885 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4886 Presumably it's faster too.
4887 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4888 Now bool.
4889 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4890 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4891 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4892 (bidi_explicit_dir_char, bidi_level_of_next_char)
4893 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4894 Use bool for booleans, instead of int.
4895 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4896 (bidi_unshelve_cache): Adjust decls to match code.
4897
4898 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4899
4900 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4901 argument.
4902
4903 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4904
4905 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4906 * atimer.h: Include <stdbool.h>.
4907
4908 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4909
4910 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4911 compile time tests instead of run time tests on systems that do
4912 not use them.
4913 (FRAME_MAC_P): Remove leftover from deleted code.
4914 * frame.c (syms_of_frame): Remove leftover from deleted code.
4915
4916 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4917
4918 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4919
4920 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4921
4922 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4923 Otherwise, the compiler complains about (A?B:C) where B is void
4924 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
4925 (fontset_add): Return void, for FONTSET_ADD.
4926
4927 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4928
4929 * alloc.c: Use bool for booleans.
4930 (gc_in_progress, abort_on_gc)
4931 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4932 (dont_register_blocks) [GC_MALLOC_CHECK]:
4933 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4934 (check_string_bytes, make_specified_string, memory_full)
4935 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4936 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4937 (mark_stack, valid_pointer_p, make_pure_string)
4938 (Fgarbage_collect, survives_gc_p, gc_sweep):
4939 Use bool for booleans, instead of int.
4940 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4941 Remove unused local.
4942 * alloc.c (PURE_POINTER_P):
4943 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4944 * editfns.c (Fformat):
4945 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4946 (Fdo_auto_save):
4947 * fns.c (sweep_weak_table):
4948 * lisp.h (suppress_checking, push_message, survives_gc_p)
4949 (make_pure_string, gc_in_progress, abort_on_gc):
4950 * lread.c (readchar, read1):
4951 * print.c (Fprin1_to_string):
4952 * xdisp.c (push_message):
4953 Use bool for booleans affected directly or indirectly by
4954 alloc.c's changes.
4955
4956 Make recently-introduced setters macros.
4957 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4958 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4959 (set_fontset_default, set_fontset_fallback): Rename from their
4960 upper-case counterparts, and make them functions rather than macros.
4961 This is more consistent with the other recently-introduced setters.
4962 These don't need to be inline, since they're local.
4963
4964 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4965
4966 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4967 the loop (Bug#12247).
4968
4969 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4970
4971 * lisp.h (vcopy): Use memcpy rather than our own loop.
4972 This fixes a performance regression introduced by the recent
4973 addition of vcopy. This means 'vcopy' will need to be modified
4974 for a copying collector, but that's OK. Also, tighten the
4975 checking in the assertion.
4976
4977 2012-08-21 Eli Zaretskii <eliz@gnu.org>
4978
4979 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4980 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4981 non-base glyph for the width of the base character, according to
4982 what x_draw_composite_glyph_string_foreground expects.
4983 Generate WADJUST value according to composition_gstring_width's
4984 expectations, to produce correct width of the composed character.
4985 Reverse the sign of the DU offset produced by ScriptPlace.
4986
4987 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4988
4989 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4990
4991 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4992
4993 Avoid direct writes to contents member of struct Lisp_Vector.
4994 * lisp.h (vcopy): New function to copy data into vector.
4995 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4996 * fns.c (Ffillarray): Use ASET.
4997 * keyboard.c (timer_check_2): Use AREF and ASET.
4998 (append_tool_bar_item, Frecent_keys): Use vcopy.
4999 * lread.c (read_vector): Use ASET.
5000 * msdos.c (Frecent_doskeys): Use vcopy.
5001 * xface.c (Finternal_copy_lisp_face): Use vcopy.
5002 (Finternal_merge_in_global_face): Use ASET and vcopy.
5003 * xfont.c (xfont_list_pattern): Likewise.
5004
5005 2012-08-21 Martin Rudalics <rudalics@gmx.at>
5006
5007 * window.c (Fwindow_point): For the selected window always return
5008 the position of its buffer's point.
5009 (Fset_window_point): For the selected window always go in its
5010 buffer to the specified position.
5011
5012 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5013
5014 Setter macros for fontsets.
5015 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
5016 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
5017 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
5018 Adjust users.
5019
5020 2012-08-20 Glenn Morris <rgm@gnu.org>
5021
5022 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5023 Don't assume that `ln -f' works.
5024
5025 2012-08-20 Eli Zaretskii <eliz@gnu.org>
5026
5027 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
5028 and later about non-assignments with no effect. See discussion at
5029 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
5030 details.
5031
5032 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5033
5034 Inline setter functions for Lisp_Objects slots of struct specbinding.
5035 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
5036 Adjust users.
5037
5038 2012-08-20 Martin Rudalics <rudalics@gmx.at>
5039
5040 * window.c (select_window): Always make selected window's buffer
5041 current.
5042
5043 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5044
5045 Use AREF and ASET for docstrings of category tables.
5046 * category.h (CATEGORY_DOCSTRING): Use AREF.
5047 (SET_CATEGORY_DOCSTRING): Use ASET.
5048 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
5049
5050 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5051
5052 Inline setter functions for hash table members.
5053 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
5054 (set_hash_hash, set_hash_index): Rename with _slot suffix.
5055 (set_hash_key_and_value, set_hash_index, set_hash_next)
5056 (set_hash_hash): New functions.
5057 * charset.c, fns.c: Adjust users.
5058
5059 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5060
5061 Inline getter and setter functions for per-buffer values.
5062 * buffer.h (per_buffer_default, set_per_buffer_default)
5063 (per_buffer_value, set_per_buffer_value): New functions.
5064 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
5065 * buffer.c, data.c: Adjust users.
5066
5067 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
5068
5069 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
5070
5071 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
5072
5073 Rely on <config.h> + <unistd.h> to declare 'environ',
5074 as gnulib does this if the system doesn't.
5075 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
5076 Remove declaration. MS-Windows declares it on stdlib.h which is
5077 included by conf_post.h.
5078 * emacs.c (environ) [DOUG_LEA_MALLOC]:
5079 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
5080 * vm-limit.c: Include <unistd.h>, for 'environ'.
5081
5082 * unexaix.c, unexcoff.c: Include "mem-limits.h".
5083 (start_of_data): Remove decl; mem-limits.h provides it.
5084
5085 * xdisp.c (handle_invisible_prop): Make it a bit faster
5086 and avoid a gcc -Wmaybe-uninitialized diagnostic.
5087
5088 2012-08-19 Chong Yidong <cyd@gnu.org>
5089
5090 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
5091 ends (Bug#3874).
5092
5093 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
5094
5095 * .gdbinit: Use call instead of set when calling a function in the
5096 inferior.
5097
5098 * data.c (set_internal): Don't use set_blv_found.
5099 (Fkill_local_variable): Likewise.
5100
5101 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
5102
5103 * nsfont.m (ns_ascii_average_width): Ensure the string
5104 ascii_printable is initialized with a null-terminated character
5105 array. Otherwise, it can contain undesired extra characters.
5106
5107 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5108
5109 port new setting code to Sun C 5.8 2005/10/13
5110 * chartab.c, lisp.h (char_table_set, char_table_set_range):
5111 Return void, not Lisp_Object. Otherwise, the compiler
5112 complains about (A?B:C) where B is void and C is Lisp_Object
5113 when compiling CHAR_TABLE_SET, due to the recent change to
5114 the API of sub_char_table_set_contents.
5115
5116 2012-08-18 Chong Yidong <cyd@gnu.org>
5117
5118 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
5119 for the string case (Bug#3874).
5120
5121 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5122
5123 * buffer.h (BSET): Remove (Bug#12215).
5124 Replace all uses with calls to new setter functions.
5125 (bset_bidi_paragraph_direction, bset_case_canon_table)
5126 (bset_case_eqv_table, bset_directory, bset_display_count)
5127 (bset_display_time, bset_downcase_table)
5128 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
5129 (bset_last_selected_window, bset_local_var_alist)
5130 (bset_mark_active, bset_point_before_scroll, bset_read_only)
5131 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
5132 (bset_width_table):
5133 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5134 (bset_auto_fill_function, bset_auto_save_file_format)
5135 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5136 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5137 (bset_cache_long_line_scans, bset_case_fold_search)
5138 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5139 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5140 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5141 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5142 (bset_header_line_format, bset_indicate_buffer_boundaries)
5143 (bset_indicate_empty_lines, bset_invisibility_spec)
5144 (bset_left_fringe_width, bset_major_mode, bset_mark)
5145 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5146 (bset_name, bset_overwrite_mode, bset_pt_marker)
5147 (bset_right_fringe_width, bset_save_length)
5148 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5149 (bset_scroll_up_aggressively, bset_selective_display)
5150 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5151 (bset_word_wrap, bset_zv_marker):
5152 * category.c (bset_category_table):
5153 * syntax.c (bset_syntax_table):
5154 New setter functions.
5155
5156 * process.h (PSET): Remove (Bug#12215).
5157 Replace all uses with calls to new setter functions.
5158 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5159 (PROCESS_INLINE): New macro.
5160 (pset_childp): New setter function.
5161 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
5162 * process.c (PROCESS_INLINE):
5163 Define to EXTERN_INLINE, so that the corresponding functions
5164 are compiled into code.
5165 (pset_buffer, pset_command, pset_decode_coding_system)
5166 (pset_decoding_buf, pset_encode_coding_system)
5167 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
5168 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
5169 (pset_type, pset_write_queue): New setter functions.
5170
5171 * window.h (WSET): Remove (Bug#12215).
5172 Replace all uses with calls to new setter functions.
5173 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5174 (WINDOW_INLINE): New macro.
5175 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
5176 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
5177 (wset_total_lines, wset_vertical_scroll_bar)
5178 (wset_window_end_pos, wset_window_end_valid)
5179 (wset_window_end_vpos): New setter functions.
5180 * window.c (WINDOW_INLINE):
5181 Define to EXTERN_INLINE, so that the corresponding functions
5182 are compiled into code.
5183 (wset_combination_limit, wset_dedicated, wset_display_table)
5184 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
5185 (wset_new_normal, wset_new_total, wset_next_buffers)
5186 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5187 (wset_prev_buffers, wset_right_fringe_width)
5188 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
5189 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
5190 (wset_window_parameters):
5191 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5192 (wset_column_number_displayed, wset_region_showing):
5193 New setter functions.
5194
5195 * termhooks.h (TSET): Remove (Bug#12215).
5196 Replace all uses with calls to new setter functions.
5197 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5198 (TERMHOOKS_INLINE): New macro.
5199 (tset_charset_list, tset_selection_alist): New setter functions.
5200 * terminal.c (TERMHOOKS_INLINE):
5201 Define to EXTERN_INLINE, so that the corresponding functions
5202 are compiled into code.
5203 (tset_param_alist): New setter function.
5204
5205 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5206
5207 * keyboard.h (KSET): Remove (Bug#12215).
5208 Replace all uses with calls to new setter functions.
5209 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5210 (KEYBOARD_INLINE): New macro.
5211 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
5212 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
5213 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
5214 New setter functions.
5215 * keyboard.c (KEYBOARD_INLINE):
5216 Define to EXTERN_INLINE, so that the corresponding functions
5217 are compiled into code.
5218 (kset_echo_string, kset_kbd_queue)
5219 (kset_keyboard_translate_table, kset_last_prefix_arg)
5220 (kset_last_repeatable_command, kset_local_function_key_map)
5221 (kset_overriding_terminal_local_map, kset_real_last_command)
5222 (kset_system_key_syms): New setter functions.
5223
5224 * frame.h (FSET): Remove (Bug#12215).
5225 Replace all uses with calls to new setter functions.
5226 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5227 (FRAME_INLINE): New macro.
5228 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
5229 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
5230 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
5231 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
5232 (fset_param_alist, fset_root_window, fset_scroll_bars)
5233 (fset_selected_window, fset_title, fset_tool_bar_items)
5234 (fset_tool_bar_position, fset_tool_bar_window): New functions.
5235 * frame.c (FRAME_INLINE):
5236 Define to EXTERN_INLINE, so that the corresponding functions
5237 are compiled into code.
5238 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
5239
5240 A few more naming-convention fixes for getters and setters.
5241 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
5242 and rename from buffer_overlays_set_before.
5243 (set_buffer_overlays_after): Move here from buffer.h, and rename
5244 from buffer_overlays_set_after.
5245 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5246 All uses changed.
5247 (set_buffer_intervals): Rename from buffer_set_intervals.
5248 * intervals.c (set_interval_object): Move here from intervals.h,
5249 and rename from interval_set_object.
5250 (set_interval_left): Move here from intervals.h, and rename from
5251 interval_set_left.
5252 (set_interval_right): Move here from intervals.h, and rename from
5253 interval_set_right.
5254 (copy_interval_parent): Move here from intervals.h, and rename from
5255 interval_copy_parent.
5256 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5257 (set_interval_plist): Rename from interval_set_plist.
5258 Return void, not Lisp_Object, since no caller uses the result.
5259 * lisp.h (string_intervals): Rename from string_get_intervals.
5260 (set_string_intervals): Rename from string_set_intervals.
5261
5262 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5263 (set_char_table_contents): Rename from char_table_set_contents.
5264 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
5265 All uses changed. See the end of
5266 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5267
5268 * lisp.h (CSET): Remove (Bug#12215).
5269 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5270 (set_char_table_purpose): New functions,
5271 replacing CSET. All uses changed. For example, replace
5272 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
5273 "set_char_table_parent (char_table, parent);".
5274 The old version was confusing because it used the same name
5275 'parent' for two different things.
5276
5277 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5278
5279 Functions to get and set Lisp_Object fields of buffer-local variables.
5280 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5281 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5282 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
5283 * data.c, eval.c, frame.c: Adjust users.
5284
5285 2012-08-17 Chong Yidong <cyd@gnu.org>
5286
5287 * xfaces.c (merge_face_vectors): If the target font specfies a
5288 font spec, make the font's attributes take precedence over
5289 directly-specified attributes.
5290 (merge_face_ref): Recognize :font.
5291
5292 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5293
5294 Do not use memcpy for copying intervals.
5295 * intervals.c (reproduce_interval): New function.
5296 (reproduce_tree, reproduce_tree_obj): Use it.
5297 (reproduce_tree_obj): Remove prototype.
5298
5299 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5300
5301 * lisp.h (duration_to_sec_usec): Remove unused decl.
5302
5303 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5304
5305 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5306 to an allocated instance of NSString, not to the class itself.
5307
5308 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
5309
5310 * makefile.w32-in (C_CTYPE_H): New macro.
5311 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5312 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5313 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5314
5315 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5316
5317 Use ASCII tests for character types.
5318 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5319 * xfns.c, xterm.c:
5320 Don't include <ctype.h>; was not needed.
5321 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5322 * sysdep.c, xfaces.c:
5323 Include <c-ctype.h> instead of <ctype.h>.
5324 * nsterm.m: Include <c-ctype.h>.
5325 * charset.c (read_hex):
5326 * doc.c (Fsnarf_documentation):
5327 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5328 (DRIVE_LETTER) [DOS_NT]:
5329 (Ffile_name_directory, Fexpand_file_name)
5330 (Fsubstitute_in_file_name):
5331 * font.c (font_parse_xlfd, font_parse_fcname):
5332 * frame.c (x_set_font_backend):
5333 * gtkutil.c (xg_get_font):
5334 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5335 * nsimage.m (hexchar):
5336 * nsterm.m (ns_xlfd_to_fontname):
5337 * sysdep.c (system_process_attributes):
5338 * xfaces.c (hash_string_case_insensitive):
5339 Use C-locale tests instead of locale-specific tests for character
5340 types, since we want the ASCII interpretation here, not the
5341 interpretation suitable for whatever happens to be the current locale.
5342
5343 2012-08-16 Martin Rudalics <rudalics@gmx.at>
5344
5345 Consistently check windows for validity/liveness
5346 (Bug#11984, Bug#12025, Bug#12026).
5347 * lisp.h (CHECK_VALID_WINDOW): New macro.
5348 * window.c (decode_window): Rename to decode_live_window.
5349 (decode_valid_window, Fwindow_valid_p): New functions.
5350 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5351 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5352 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5353 (Fwindow_prev_sibling, Fwindow_combination_limit)
5354 (Fset_window_combination_limit, Fwindow_use_time)
5355 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5356 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5357 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5358 (Fwindow_hscroll, Fset_window_hscroll)
5359 (Fwindow_redisplay_end_trigger)
5360 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5361 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5362 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5363 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5364 (Fwindow_end, Fset_window_point, Fset_window_start)
5365 (Fpos_visible_in_window_p, Fwindow_line_height)
5366 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5367 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5368 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5369 (Fset_window_parameter, Fwindow_display_table)
5370 (Fset_window_display_table, Fdelete_other_windows_internal)
5371 (Fset_window_buffer, Fset_window_new_total)
5372 (Fset_window_new_normal, Fdelete_window_internal)
5373 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5374 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5375 (Fwindow_scroll_bars): Check whether argument window is a valid or
5376 live window. Update doc-strings.
5377 (syms_of_window): New symbol Qwindow_valid_p.
5378 * keyboard.c (Fposn_at_x_y): Check whether argument
5379 frame_or_window denotes a valid window.
5380
5381 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5382
5383 Fix previous char table change.
5384 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5385 * chartab.c (optimize_sub_char_table): Likewise.
5386
5387 2012-08-16 Chong Yidong <cyd@gnu.org>
5388
5389 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5390
5391 * xfont.c (xfont_open):
5392 * xftfont.c (xftfont_open): Set the font's max_width field.
5393
5394 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5395 min_width to space_width and average_width to the average over
5396 printable ASCII characters.
5397 (ns_char_width): Code cleanup.
5398 (ns_ascii_average_width): New utility function.
5399
5400 * font.h (struct font): Update comments.
5401
5402 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5403
5404 Simple interface to set Lisp_Object fields of character tables.
5405 * lisp.h (CSET): New macro.
5406 (char_table_set_extras, char_table_set_contents)
5407 (sub_char_table_set_contents): New function.
5408 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5409 * syntax.c: Adjust users.
5410
5411 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5412
5413 * eval.c (eval_sub): Bind lexical-binding.
5414 * lread.c (Qlexical_binding): Make non-static.
5415
5416 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5417
5418 * nsmenu.m (popupSession): Remove.
5419 (pop_down_menu): Remove endModalSession.
5420 (timeout_handler:): New method.
5421 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5422 Call runModalForWindow. Check timer_fired when it returns.
5423 If not set, cancel timer and break out of loop.
5424 Otherwise loop again, with a new timeout.
5425
5426 * nsterm.m: Include fcntl.h if present.
5427 (fd_entry, t_readfds, inNsSelect): Remove.
5428 (select_writefds, select_valid, select_timeout, selfds)
5429 (select_mutex, apploopnr): Add.
5430 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5431 Otherwise call kbd_buffer_store_event.
5432 (ns_send_appdefined): Remove release of fd_entry.
5433 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5434 Increment and decrement apploopnr.
5435 (ns_select): If no file descriptors, just do a NSTimer.
5436 Otherwise copy read/write masks and start select thread (fd_handler).
5437 Start main loop and wait for application defined event.
5438 Inform select thread to stop selecting after main loop is exited.
5439 (ns_term_init): Create selfds pipe and set non-blocking.
5440 Initialize select_mutex. Start the select thread (fd_handler).
5441 (fd_handler:): Loop forever, wait for info from the main thread
5442 to either start or stop selecting. When select returns, send
5443 and appdefined event.
5444 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5445 If not call kbd_buffer_store_event.
5446
5447 * nsterm.h (EmacsApp): fd_handler takes id argument.
5448 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5449
5450 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5451
5452 2012-08-15 Eli Zaretskii <eliz@gnu.org>
5453
5454 * region-cache.c (move_cache_gap): Update gap_len using the actual
5455 growth of the boundaries array. Do not change cache_len.
5456 (Bug#12196)
5457
5458 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5459
5460 Generalize and cleanup font subsystem checks.
5461 * font.h (FONT_DEBUG, font_assert): Remove.
5462 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5463 Change font_assert to eassert. Use eassert where appropriate.
5464
5465 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5466
5467 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5468
5469 2012-08-15 Chong Yidong <cyd@gnu.org>
5470
5471 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5472 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5473 extract the font descriptor instead of just the font name.
5474 In that case, return a font spec instead of a string.
5475 (x_last_font_name): Move to this file from xfns.c.
5476
5477 * xfns.c (Fx_select_font): The return value can also be a font
5478 spec. Move x_last_font_name management to gtkutil.c.
5479
5480 * xfaces.c: Make font weight and style symbols non-static.
5481
5482 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5483
5484 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5485 (bug#12117).
5486
5487 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5488
5489 * alloc.c (Fgarbage_collect): Use plural form consistently.
5490
5491 2012-08-14 Eli Zaretskii <eliz@gnu.org>
5492
5493 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5494 iteration through the command loop. Fixes a problem whereby mouse
5495 movements are ignored until the first mouse click.
5496
5497 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5498
5499 Use bool, not int, for Lisp booleans.
5500 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5501 makes Emacs a bit smaller and presumably a bit faster.
5502 * lisp.h: Include <stdbool.h>.
5503 (struct Lisp_Boolfwd, defvar_bool):
5504 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5505 * regex.c [!emacs]: Include <stdbool.h>.
5506 (false, true): Remove; <stdbool.h> does this for us now.
5507
5508 2012-08-14 Chong Yidong <cyd@gnu.org>
5509
5510 * character.c (Fcharacterp): Doc fix (Bug#12076).
5511
5512 * data.c (Findirect_variable): Doc fix (Bug#11040).
5513
5514 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5515
5516 * editfns.c (Fformat): Doc fix (Bug#12059).
5517 (Fsave_current_buffer): Doc fix (Bug#11542).
5518
5519 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5520
5521 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5522 (bug#12022).
5523
5524 2012-08-14 Martin Rudalics <rudalics@gmx.at>
5525
5526 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5527 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5528 * minibuf.c (choose_minibuf_frame, read_minibuf):
5529 * w32fns.c (x_create_tip_frame):
5530 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5531 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5532
5533 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5534
5535 * intervals.c (offset_intervals): Remove obsolete comment.
5536
5537 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5538
5539 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5540
5541 2012-08-14 Gergely Risko <gergely@risko.hu>
5542
5543 * coding.c (decode_coding): Record buffer modification before
5544 disabling undo_list (Bug#11773).
5545
5546 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5547
5548 Revert and cleanup some recent overlay changes.
5549 * buffer.h (enum overlay_type): Remove.
5550 (buffer_get_overlays, buffer_set_overlays): Likewise.
5551 (buffer_set_overlays_before, buffer_set_overlays_after):
5552 New function. Adjust users.
5553 (unchain_both): Add eassert.
5554
5555 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5556
5557 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5558
5559 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5560
5561 * gtkutil.c (xg_mark_data): Don't assume C99.
5562
5563 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5564
5565 * gtkutil.c (xg_frame_tb_info): New struct.
5566 (TB_INFO_KEY): New define.
5567 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5568 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5569 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5570 if not present.
5571 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5572 is up to date. Otherwise store new data.
5573 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5574
5575 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5576
5577 Use KSET for write access to Lisp_Object members of struct kboard.
5578 * keyboard.h (KSET): New macro.
5579 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5580 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5581 * xterm.c: Adjust users.
5582
5583 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5584
5585 Use BSET for write access to Lisp_Object members of struct buffer.
5586 * buffer.h (BSET): New macro.
5587 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5588 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5589 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5590 * window.c, xdisp.c, xfns.c: Adjust users.
5591
5592 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5593
5594 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5595
5596 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5597
5598 * nsterm.m (not_in_argv): New function.
5599 (application:openFile, application:openTempFile:):
5600 (application:openFileWithoutUI:, application:openFiles:): Open file
5601 if not_in_argv returns non-zero (bug#12171).
5602
5603 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5604 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5605 Define for Gtk+ versions less than 3.2.
5606 (xg_get_font_name): Use those functions/macros here.
5607 Reported by Frans Oilinki <moilinki@gmail.com>.
5608
5609 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5610
5611 * unexmacosx.c (copy_data_segment): Copy initialized data in
5612 statically linked libraries from input file rather than memory.
5613
5614 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5615 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5616 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5617
5618 2012-08-10 Glenn Morris <rgm@gnu.org>
5619
5620 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5621 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5622
5623 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5624
5625 Fix last change to allow compilation with low optimization levels.
5626 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5627 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5628
5629 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5630
5631 Use common inline syntax in intervals.h.
5632 * intervals.h (INTERVALS_INLINE): New macro.
5633 Change all users from LISP_INLINE.
5634
5635 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5636
5637 Define Qnone once for all platforms.
5638 * frame.c (Qnone): Define here.
5639 (syms_of_frame): DEFSYM it.
5640 * lisp.h (Qnone): New declaration.
5641 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5642 * xfns.c: Remove duplication. Adjust users.
5643
5644 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5645
5646 Remove unused macros from intervals.h.
5647 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5648 * intervals.c: Adjust comment.
5649
5650 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5651
5652 * w32fns.c <w32_unicode_gui>: New static variable.
5653 (globals_of_w32fns): Initialize it according to os_subtype.
5654 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5655 testing os_subtype.
5656
5657 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5658 Eli Zaretskii <eliz@gnu.org>
5659
5660 Fix bug #10299 with Unicode characters sent by customized
5661 keyboards created by MSKLC.
5662 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5663 (w32_init_class): Use it to initialize the Emacs class with either
5664 ANSI or Unicode API calls.
5665 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5666 later.
5667 (w32_wnd_proc): If the character code sent by WM_CHAR or
5668 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5669 original message. Call DefWindowProcW on NT and later.
5670
5671 2012-08-10 Glenn Morris <rgm@gnu.org>
5672
5673 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5674
5675 * lisp.h (DIRECTORY_SEP): Let configure set it.
5676
5677 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5678
5679 Use TSET for write access to Lisp_Object slots of struct terminal.
5680 * termhooks.h (TSET): New macro.
5681 * coding.c, terminal.c, xselect.c: Adjust users.
5682
5683 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5684
5685 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5686 the failing expression, include them in the error message.
5687 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5688 * lisp.h (internal_condition_case_n): Update declaration.
5689
5690 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5691
5692 Inline functions to examine and change buffer overlays.
5693 * buffer.c (unchain_both): New function.
5694 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5695 (buffer_has_overlays): New function.
5696 (enum overlay_type): New enum.
5697 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5698 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5699
5700 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5701
5702 Inline functions to examine and change buffer intervals.
5703 * alloc.c (mark_interval_tree): Remove.
5704 (MARK_INTERVAL_TREE): Simplify.
5705 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5706 * intervals.c (buffer_balance_intervals): New function.
5707 (graft_intervals_into_buffer): Adjust indentation.
5708 (set_intervals_multibyte): Simplify.
5709 * buffer.h (BUF_INTERVALS): Remove.
5710 (buffer_get_intervals, buffer_set_intervals): New function.
5711 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5712 * intervals.c, textprop.c: Adjust users.
5713
5714 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5715
5716 Inline functions to examine and change string intervals.
5717 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5718 (string_get_intervals, string_set_intervals): New function.
5719 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5720 * lread.c, print.c, textprop.c: Adjust users.
5721
5722 2012-08-08 Glenn Morris <rgm@gnu.org>
5723
5724 * lisp.mk (lisp): Remove language/persian.elc.
5725
5726 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5727
5728 Cleanup intervals.
5729 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5730 (NULL_INTERVAL_P): Likewise. Adjust users.
5731 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5732 Adjust comment. Move under #if 0.
5733 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5734 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5735
5736 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5737
5738 Check total length of intervals with eassert.
5739 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5740 * intervals.c: Change all users to eassert.
5741
5742 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5743
5744 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5745 Rename fields to match removal of FGET and WGET and disuse of
5746 INTERNAL_FIELD in Lisp_Cons.
5747
5748 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5749
5750 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5751 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5752 name since all xname users are fixed long time ago. Do not
5753 use INTERNAL_FIELD.
5754 (set_symbol_name, set_symbol_function, set_symbol_plist):
5755 (set_symbol_next, set_overlay_plist): New function.
5756 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5757 (struct Lisp_Overlay): Likewise.
5758 (CVAR, MVAR, SVAR): Remove.
5759 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5760 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5761 * xterm.c: Adjust users.
5762 * .gdbinit: Change to use name field of struct Lisp_Symbol
5763 where appropriate.
5764
5765 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5766
5767 Basic functions to set Lisp_Object and pointer slots of intervals.
5768 * intervals.h (interval_set_parent, interval_set_object):
5769 (interval_set_left, interval_set_right, interval_set_plist):
5770 (interval_copy_parent): New function.
5771 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5772 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5773 Adjust indentation.
5774 (INTERVAL_SIZE): Remove. Adjust users.
5775 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5776
5777 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5778
5779 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5780 * process.h (PGET): Remove.
5781 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5782 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5783
5784 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5785
5786 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5787 * window.h (WGET): Remove.
5788 (struct window): Do not use INTERNAL_FIELD.
5789 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5790 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5791 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5792 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5793 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5794 Adjust users.
5795
5796 2012-08-07 Chong Yidong <cyd@gnu.org>
5797
5798 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5799 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5800 (Fdelete_window_internal): Signal an error if the window is not on
5801 a live frame (Bug#12025).
5802
5803 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5804
5805 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5806 * frame.h (FGET): Remove.
5807 (struct frame): Do not use INTERNAL_FIELD.
5808 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5809 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5810 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5811 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5812
5813 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5814
5815 * w32.c: Silence compiler warnings.
5816 (map_w32_filename): Remove unused variable `is_fat'.
5817 (chase_symlinks): Add parentheses around expression.
5818
5819 2012-08-06 Glenn Morris <rgm@gnu.org>
5820
5821 * sysdep.c: Respect BROKEN_GETWD.
5822
5823 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5824 Let configure handle it.
5825 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5826
5827 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5828
5829 Use GCALIGNMENT where appropriate.
5830 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5831 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5832 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5833
5834 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5835
5836 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5837 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5838
5839 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5840
5841 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5842 that should be sufficient for everyone.
5843
5844 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5845
5846 * keyboard.c (timer_check_2): Add break so timer_check returns next
5847 timeout.
5848
5849 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5850
5851 Fix Windows build errors introduced after converting to WGET and WSET.
5852 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5853 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5854
5855 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5856
5857 * nsterm.m (ns_frame_rehighlight): Use FSET.
5858
5859 * nsmenu.m (ns_update_menubar): Use FSET.
5860
5861 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5862
5863 Separate read and write access to Lisp_Object slots of Lisp_Process.
5864 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5865 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5866
5867 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5868
5869 Separate read and write access to Lisp_Object slots of struct window.
5870 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5871 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5872 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5873 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5874 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5875 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5876 Adjust users.
5877
5878 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5879
5880 Fix Windows build errors introduced after converting to FGET and FSET.
5881 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5882 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5883 (w32_judge_scroll_bars): Change to use FSET.
5884 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5885
5886 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5887
5888 Fix replacement typo.
5889 * window.c (replace_window): Set root_window instead of
5890 selected_window. This fixes a total window subsystem
5891 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5892
5893 2012-08-06 Glenn Morris <rgm@gnu.org>
5894
5895 * lisp.mk (lisp): Add language/persian.elc.
5896
5897 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5898
5899 Separate read and write access to Lisp_Object slots of struct frame.
5900 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5901 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5902 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5903 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5904 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5905
5906 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5907
5908 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5909
5910 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5911
5912 Generalize common compile-time constants.
5913 * lisp.h (header_size, bool_header_size, word_size): Now here.
5914 (struct Lisp_Vector): Add comment.
5915 (struct Lisp_Bool_Vector): Move up to define handy constants.
5916 (VECSIZE, PSEUDOVECSIZE): Simplify.
5917 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5918 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5919 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5920 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5921 * xfont.c, xmenu.c: Use word_size where appropriate.
5922
5923 2012-08-05 Lawrence Mitchell <wence@gmx.li>
5924
5925 * search.c (Freplace_match): Treat \? in the replacement text
5926 literally (Bug#8161).
5927
5928 2012-08-05 Chong Yidong <cyd@gnu.org>
5929
5930 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5931 * frame.c (Vdelete_frame_functions):
5932 * emacs.c (Vkill_emacs_hook): Doc fix.
5933
5934 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5935
5936 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5937 --with-x-toolkit=no builds.
5938 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5939
5940 2012-08-04 Chong Yidong <cyd@gnu.org>
5941
5942 * syntax.c (Fmodify_syntax_entry): Doc fix.
5943
5944 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5945
5946 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5947 * w32.c (init_environment): Change the default values of many
5948 environment variables in dflt_envvars[] to NULL, to avoid pushing
5949 them into environment when they were not already defined.
5950 Remove the code that deletes site-lisp subdirectories from the default
5951 value of EMACSLOADPATH, as it is no longer needed.
5952 (check_windows_init_file): Now external, not static.
5953 Use Vload_path as is, without adding anything, as this function is now
5954 called when Vload_path is already set up.
5955
5956 * w32.h (check_windows_init_file): Add prototype.
5957
5958 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5959 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5960 compatibility with Posix platforms.
5961 (main): Move the call to check_windows_init_file to here from
5962 w32.c.
5963 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5964 any, in the DEFALT argument into the root of the Emacs build or
5965 installation tree, as appropriate.
5966
5967 * callproc.c (init_callproc_1): Call decode_env_path instead of
5968 doing its equivalent by hand.
5969 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5970 the code that sets Vexec_path run on MS-Windows.
5971
5972 * lread.c (init_lread): Add comments to #ifdef's.
5973
5974 * msdos.c (dos_set_window_size, IT_update_begin)
5975 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5976 instead of direct references.
5977
5978 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5979
5980 Export DEFAULT_REHASH_* to GDB.
5981 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5982 Now constants, not macros.
5983
5984 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5985
5986 Remove unnecessary casts involving pointers.
5987 These casts are no longer needed now that we assume C89 or later,
5988 since they involve casting to or from void *.
5989 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5990 (make_pure_float, make_pure_vector):
5991 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5992 * macros.c (Fstart_kbd_macro):
5993 * menu.c (find_and_return_menu_selection):
5994 * minibuf.c (read_minibuf_noninteractive):
5995 * sysdep.c (closedir):
5996 * xdisp.c (x_produce_glyphs):
5997 * xfaces.c (compare_fonts_by_sort_order):
5998 * xfns.c (x_real_positions, select_visual):
5999 * xselect.c (x_stop_queuing_selection_requests)
6000 (x_get_window_property, x_get_window_property_as_lisp_data):
6001 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
6002 Remove unnecessary pointer casts.
6003 * alloc.c (record_xmalloc): New function.
6004 * lisp.h (record_xmalloc): New decl.
6005 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
6006 more like a function. This is because the pointer cast is not
6007 needed. All uses changed.
6008 * print.c (print_string, print_error_message): Avoid length recalc.
6009
6010 Improve fix for macroexp crash with debugging (Bug#12118).
6011 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
6012 ARRAY_MARK_FLAG when checking subscripts, because ASET is
6013 not supposed to be invoked from the garbage collector.
6014 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
6015 (gc_aset): New function, which is like ASET but can be
6016 used in the garbage collector.
6017 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6018 (set_hash_index): Use it instead of ASET.
6019
6020 2012-08-03 Eli Zaretskii <eliz@gnu.org>
6021
6022 Support symlinks on latest versions of MS-Windows.
6023 * w32.c: Include winioctl.h and aclapi.h.
6024 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
6025 (revert_to_self): Forward declarations of static functions.
6026 <static BOOL g_b_init_get_security_info>:
6027 <g_b_init_create_symbolic_link>: New static flags.
6028 (globals_of_w32): Initialize them to zero.
6029 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
6030 (map_w32_filename): Improve commentary. Simplify switch.
6031 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
6032 headers (most versions of MinGW w32api don't).
6033 (get_security_info, create_symbolic_link)
6034 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
6035 New functions.
6036 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
6037 in the argument file name.
6038 (sys_access): Call unc_volume_file_attributes only if
6039 GetFileAttributes fails with network-related error codes.
6040 (sys_rename): Diagnose renaming of a symlink when the user doesn't
6041 have the required privileges.
6042 (get_file_security_desc_by_name): Rename from
6043 get_file_security_desc.
6044 (stat_worker): New function, with most of the guts of 'stat', and
6045 with addition of handling of symlinks and support for 'lstat'.
6046 If possible, get file's attributes and security information by
6047 handle, not by name. Produce S_IFLNK bit for symlinks, when
6048 called from 'lstat'.
6049 (stat, lstat): New functions, call 'stat_worker'.
6050 (symlink, readlink, careadlinkat): Rewritten to create and resolve
6051 symlinks when the underlying filesystem supports them.
6052
6053 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6054
6055 Fix macroexp crash on Windows with debugging (Bug#12118).
6056 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
6057 checking subscripts; problem introduced with the recent
6058 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
6059 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
6060 since it's used in non-static inline functions now.
6061
6062 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
6063 Don't assume buffer size fits in 'int'. Remove unused local.
6064
6065 Use C99-style 'extern inline' if available.
6066 * buffer.h (BUFFER_INLINE):
6067 * category.h (CATEGORY_INLINE):
6068 * character.h (CHARACTER_INLINE):
6069 * charset.h (CHARSET_INLINE):
6070 * composite.h (COMPOSITE_INLINE):
6071 * dispextern.h (DISPEXTERN_INLINE):
6072 * lisp.h (LISP_INLINE):
6073 * systime.h (SYSTIME_INLINE):
6074 New macro, replacing 'static inline' in this header.
6075 * buffer.h, category.h, character.h, charset.h, composite.h:
6076 * dispextern.h, lisp.h, systime.h:
6077 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6078 * alloc.c (LISP_INLINE):
6079 * buffer.c (BUFFER_INLINE):
6080 * category.c (CATEGORY_INLINE):
6081 * character.c (CHARACTER_INLINE):
6082 * charset.c (CHARSET_INLINE):
6083 * composite.c (COMPOSITE_INLINE):
6084 * dispnew.c (DISPEXTERN_INLINE):
6085 * sysdep.c (SYSTIME_INLINE):
6086 Define to EXTERN_INLINE, so that the corresponding functions
6087 are compiled into code.
6088 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
6089 (INLINE_HEADER_END): New macros.
6090 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
6091 since it's used in non-static inline functions now.
6092 (VALMASK) [!USE_LSB_TAG]: Likewise.
6093
6094 2012-08-02 Glenn Morris <rgm@gnu.org>
6095
6096 * s/: Remove empty directory.
6097
6098 * s/ms-w32.h: Move to ../nt/inc.
6099 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
6100 Update for new ms-w32.h location.
6101
6102 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6103
6104 Port to Solaris 8.
6105 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
6106
6107 2012-08-02 Glenn Morris <rgm@gnu.org>
6108
6109 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
6110 hard-coding the path separator.
6111
6112 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6113
6114 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
6115 This how ASET and AREF are supposed to work, and makes
6116 it easier to think about future improvements. See
6117 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
6118 * charset.h (set_charset_attr): New function.
6119 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
6120 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
6121 (aref_addr): New function. All uses of &AREF(...) changed.
6122 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6123 (set_hash_index): New functions. All lvalue-style uses of
6124 HASH_KEY etc. changed.
6125 * keyboard.c (set_prop): New function. All lvalue-style uses
6126 of PROP changed.
6127
6128 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
6129
6130 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
6131 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
6132 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
6133 * nsfns.m (ns_set_name_as_filename): Likewise.
6134 * nsmenu.m (ns_update_menubar): Likewise.
6135 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
6136
6137 2012-08-01 Eli Zaretskii <eliz@gnu.org>
6138
6139 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
6140 Adapt to latest changes in field names of the corresponding Lisp
6141 objects.
6142
6143 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
6144
6145 2012-08-01 Glenn Morris <rgm@gnu.org>
6146
6147 * s/msdos.h: Remove file.
6148 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
6149 * Makefile.in (S_FILE): Remove.
6150 (config_h): Remove S_FILE.
6151
6152 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
6153
6154 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
6155 Remove; moved to nt/config.nt.
6156
6157 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6158
6159 Use INTERNAL_FIELD for conses and overlays.
6160 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
6161 Remove obsolete comment.
6162 (MVAR): New macro.
6163 (struct Lisp_Overlay): Use INTERNAL_FIELD.
6164 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
6165
6166 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6167
6168 Use INTERNAL_FIELD for symbols.
6169 * lisp.h (SVAR): New macro. Adjust users.
6170 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
6171 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
6172
6173 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6174
6175 Use INTERNAL_FIELD for processes.
6176 * process.h (PVAR): New macro. Adjust style.
6177 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
6178 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
6179
6180 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6181
6182 Use INTERNAL_FIELD for windows.
6183 * window.h (WVAR): New macro.
6184 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
6185 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6186 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6187 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
6188 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
6189 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6190
6191 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6192
6193 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
6194
6195 2012-08-01 Glenn Morris <rgm@gnu.org>
6196
6197 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
6198 Move to configure.ac.
6199
6200 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
6201
6202 * makefile.w32-in (CONFIG_H): Update dependencies.
6203 (CONF_POST_H): New macro.
6204
6205 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
6206
6207 2012-07-31 Glenn Morris <rgm@gnu.org>
6208
6209 * Makefile.in (S_FILE): No longer set by configure.
6210
6211 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
6212 is available.
6213 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
6214
6215 * process.h (NULL_DEVICE):
6216 * emacs.c (SEPCHAR):
6217 * editfns.c (USER_FULL_NAME): Let configure set them.
6218
6219 * s/README, s/template.h: Remove files.
6220
6221 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
6222
6223 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
6224 Move to configure.ac.
6225
6226 2012-07-31 Eli Zaretskii <eliz@gnu.org>
6227
6228 * .gdbinit (xframe): Adapt to introduction of FVAR and the
6229 resulting renaming of 'struct frame' members.
6230
6231 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
6232
6233 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
6234 after introduction of FVAR.
6235
6236 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6237
6238 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
6239
6240 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
6241 instead of compositeToPoint.
6242 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
6243
6244 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
6245
6246 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6247
6248 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6249 * lisp.h (INTERNAL_FIELD): New macro.
6250 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
6251 (BVAR): Change to use INTERNAL_FIELD.
6252 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6253 (KVAR): Change to use INTERNAL_FIELD.
6254 * frame.h (FVAR): New macro.
6255 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
6256 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6257 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6258 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6259 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6260
6261 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6262
6263 Miscellaneous fixes for non-default X toolkits.
6264 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6265 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6266 Move under #ifdef USE_LUCID.
6267 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6268 definition and usage to avoid warnings.
6269
6270 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6271
6272 * nsterm.m (openFiles): Fix previous checkin.
6273
6274 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6275
6276 * indent.c (compute_motion): Remove unused local.
6277
6278 2012-07-31 Glenn Morris <rgm@gnu.org>
6279
6280 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6281
6282 * conf_post.h [USG5_4]:
6283 Move remaining contents of s/usg5-4-common.h here.
6284 * s/usg5-4-common.h: Remove file.
6285
6286 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6287 * s/irix6-5.h: Remove file.
6288
6289 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6290 * s/darwin.h: Remove file.
6291
6292 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6293 * s/hpux10-20.h: Remove file, which is now empty.
6294
6295 2012-07-30 Glenn Morris <rgm@gnu.org>
6296
6297 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6298 * Makefile.in (config_h): Add conf_post.h.
6299 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6300
6301 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6302
6303 * nsterm.m (ns_do_open_file): New variable.
6304 (ns_term_init): Set ns_do_open_file to YES after run returns.
6305 (openFile, openTempFile, openFileWithoutUI, openFiles):
6306 Open files only if ns_do_open_file.
6307
6308 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6309
6310 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6311 This no-op macro hasn't been needed for many years.
6312 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6313
6314 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6315 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6316 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6317 gdb_make_enums_visible.
6318 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6319 (DIRECTORY_SEP): Now a constant, not a macro.
6320
6321 2012-07-30 Eli Zaretskii <eliz@gnu.org>
6322
6323 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6324 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6325
6326 * w32term.c <w32_keyboard_codepage>: Renamed from
6327 keyboard_codepage and now external. All users changed.
6328
6329 * w32term.h: Add declaration of w32_keyboard_codepage.
6330
6331 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6332 the codepage to translate keys to Unicode. If this argument is
6333 -1, use the value returned by GetConsoleCP. All callers changed.
6334
6335 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6336
6337 Update .PHONY listings in makefiles.
6338 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6339 bootstrap-clean, distclean, maintainer-clean, versioclean,
6340 extraclean, frc.
6341
6342 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6343 This is a bit clearer. Fix some commentary typos.
6344
6345 2012-07-30 Glenn Morris <rgm@gnu.org>
6346
6347 * s/netbsd.h: Let configure include signal.h if needed.
6348 Remove file, which is now empty.
6349
6350 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6351 Let configure set them.
6352 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6353 No more need to undefine.
6354
6355 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6356
6357 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6358 non-single-byte char when adding meta modifier. (Bug#12090)
6359
6360 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6361
6362 Convert safe_call to use variable number of arguments.
6363 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6364 (safe_call2): Fix comment.
6365 * lisp.h (safe_call): Adjust prototype.
6366 * coding.c (encode_coding_object): Change to use safe_call2.
6367 * xfaces.c (merge_face_heights): Change to use safe_call1.
6368
6369 2012-07-30 Glenn Morris <rgm@gnu.org>
6370
6371 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
6372 does that unconditionally. Remove file, which is now empty.
6373
6374 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6375 Remove empty files.
6376
6377 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6378
6379 Export to GDB most of lisp.h's remaining object-like macros.
6380 * lisp.h (min, max): Move earlier, because they're used earlier now.
6381 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6382 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6383 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6384 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6385 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6386 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6387 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6388 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6389 Now constants, for GDB. They need not be macros.
6390 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6391 Now constants, for GDB, as well as macros, for static initializers.
6392 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6393 Move to after the definition of struct Lisp_Char_Table,
6394 since the former now needs that type defined.
6395 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6396 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6397 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6398 New enums, for gdb_make_enums_visible.
6399 (GLYPH_MODE_LINE_FACE): Remove; unused.
6400 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
6401 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6402 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6403 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6404 enum maxargs, enum MAX_ALLOCA.
6405 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6406 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6407 no longer needed, now that they are done in lisp.h.
6408
6409 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6410
6411 Cleanup string bytes checking.
6412 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6413 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6414 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6415 (check_sblock, compact_small_strings): Simplify.
6416
6417 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6418
6419 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6420 These macros are confusing and no longer need to be defined, as
6421 the enum values now suffice. All uses replaced with definiens.
6422 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6423
6424 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
6425
6426 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6427 ($(BLD)/w32console.$(O)): Update dependencies.
6428
6429 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6430
6431 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6432 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6433 time. Adjust users.
6434 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6435
6436 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6437
6438 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6439 setting sitelisp (Bug#12010).
6440
6441 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6442
6443 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
6444
6445 * w32heap.c (cache_system_info):
6446 * w32.c (sys_rename):
6447 * w32proc.c (find_child_console, sys_kill): All users changed.
6448
6449 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6450
6451 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6452
6453 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6454
6455 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6456
6457 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6458
6459 Cleanup statistics calculation in Fgarbage_collect.
6460 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6461 Fix zombies percentage calculation. Simplify elapsed time calculation.
6462
6463 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6464
6465 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6466 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6467 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6468 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6469 (replace_range, replace_range_2, del_range_2): Change to eassert.
6470 * marker.c (byte_char_debug_check): Adjust style.
6471
6472 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6473
6474 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6475 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6476 long-ago-commented-out code that talks about "WIN32".
6477 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6478 All uses changed.
6479
6480 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6481
6482 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6483 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6484 Simplify by using alignof.
6485 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6486 * lisp.h: Include <stdalign.h>.
6487 (GCALIGNMENT): New macro and constant.
6488 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6489 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6490 (stdalign): New macro, if not already defined.
6491
6492 2012-07-28 Eli Zaretskii <eliz@gnu.org>
6493
6494 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6495 * w32inevt.c: Include w32inevt.h.
6496 (w32_read_console_input): New inline function, calls either
6497 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6498 w32_console_unicode_input.
6499 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6500 (w32_kbd_patch_key, key_event): Use the codepage returned by
6501 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6502 (key_event): use uChar.UnicodeChar only if
6503 w32_console_unicode_input is non-zero.
6504
6505 * w32console.c: Include w32heap.h.
6506 <w32_console_unicode_input>: New global variable.
6507 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6508 family of Windows, zero otherwise.
6509
6510 * w32inevt.h: Declare w32_console_unicode_input.
6511
6512 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6513 --without-x. (Bug#11742)
6514
6515 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6516
6517 Adjust GDB to reflect pvec_type changes (Bug#12036).
6518 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6519 2012-07-04 changes to pseudovector representation.
6520 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6521
6522 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
6523
6524 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6525 bus address.
6526 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6527
6528 2012-07-27 Eli Zaretskii <eliz@gnu.org>
6529
6530 * alloc.c (listn): Fix the order the arguments are consed onto the
6531 list.
6532
6533 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6534 enumeration constants, as PURE and HEAP are too general, and clash
6535 with other headers and sources, such as gmalloc.c and the
6536 MS-Windows system headers. All users changed.
6537
6538 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6539
6540 Revert last save_excursion_save and save_excursion_restore changes.
6541 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6542 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6543
6544 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6545
6546 Fix recently-introduced typos in Windows port.
6547 Reported by Martin Rudalics <rudalics@gmx.at>.
6548 * w32.c (init_environment): Replace comma with semicolon.
6549 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6550
6551 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6552
6553 Improve GDB symbol export (Bug#12036).
6554 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6555 arms of an 'if', not using conditional expressions; otherwise GDB
6556 complains about the types in the unevaluated arm when the argument
6557 is an integer literal.
6558 (xgetint): Simplify expression.
6559 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6560 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6561 Zaretskii in <http://bugs.gnu.org/12036#13>.
6562 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6563 needed now that we have gdb_make_enums_visible.
6564 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6565 (enum enum_USE_LSB_TAG):
6566 New enum types, packaging up enums that need to be exported to GDB.
6567
6568 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6569
6570 Utility function to make a list from specified amount of objects.
6571 * lisp.h (enum constype): New datatype.
6572 (listn): New prototype.
6573 * alloc.c (listn): New function.
6574 (Fmemory_use_count, syms_of_alloc): Use it.
6575 * buffer.c (syms_of_buffer): Likewise.
6576 * callint.c (syms_of_callint): Likewise.
6577 * charset.c (define_charset_internal): Likewise.
6578 * coding.c (syms_of_coding): Likewise.
6579 * keymap.c (syms_of_keymap): Likewise.
6580 * search.c (syms_of_search): Likewise.
6581 * syntax.c (syms_of_syntax): Likewise.
6582 * w32.c (init_environment): Likewise.
6583 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6584 * xdisp.c (syms_of_xdisp): Likewise.
6585 * xfns.c (syms_of_xfns): Likewise.
6586
6587 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6588
6589 Fast save_excursion_save and save_excursion_restore.
6590 * lisp.h (struct Lisp_Excursion): New data type.
6591 (PVEC_EXCURSION): New pseudovector type.
6592 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6593 to deal with it. Adjust comments.
6594 (init_marker, attach_marker): New prototype.
6595 (unchain_marker): Adjust prototype.
6596 * marker.c (attach_marker): Change to global.
6597 (init_marker): New function.
6598 * alloc.c (Fmake_marker, build_marker): Use it.
6599 (build_marker): More easserts.
6600 (mark_object): Handle struct Lisp_Excursion.
6601 * editfns.c (save_excursion_save, save_excursion_restore):
6602 Reimplement to use struct Lisp_Excursion. Add comments.
6603
6604 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6605
6606 Fix export of symbols to GDB (Bug#12036).
6607 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6608 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6609 emacs.c, as this is a more-suitable home. Had this been done earlier
6610 the fix for 12036 would have avoided some of the problems noted in
6611 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6612 would have been more obvious.
6613 * emacs.c: Do not include <verify.h>; no longer needed.
6614 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6615 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6616 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6617 Remove; now done in lisp.h.
6618 * lisp.h (PUBLISH_TO_GDB): New macro.
6619 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6620 (DATA_SEG_BITS): Use it.
6621 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6622 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6623 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6624 not be usable in #if. This simplifies things.
6625
6626 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6627
6628 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6629
6630 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6631
6632 Simplify export of symbols to GDB (Bug#12036).
6633 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6634 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6635 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6636 Adjust to changes in lisp.h and emacs.c, by using
6637 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6638 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6639 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6640 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6641 instead of gdb_valbits.
6642 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6643 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6644 instead of gdb_array_mark_flag.
6645 (xboolvector): Get size from $->size, not $->header.size.
6646 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6647 (xreload, hook-run, hookpost-run): Remove.
6648 * emacs.c: Include <verify.h>.
6649 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6650 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6651 Remove.
6652 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6653 (gdb_USE_LSB_TAG): New enum constants.
6654 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6655 Also define these as enum constants, so they're visible to GDB.
6656 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6657 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6658 as constants, so they're visible to GDB.
6659 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6660 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6661 Now enum constants, not macros, so they're visible to GDB.
6662 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6663 more convenient now. All uses changed.
6664 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6665 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6666
6667 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6668
6669 Explicitly free restriction data that are not needed anymore.
6670 * editfns.c (save_restriction_restore): Free restriction data.
6671
6672 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6673
6674 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6675 add argument, tune behavior, and adjust all callers.
6676
6677 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6678
6679 Use typedef for EMACS_INT, EMACS_UINT.
6680 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6681 than macros. This simplifies debugging in the usual case, since
6682 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6683 and it allows expressions involving EMACS_INT casts.
6684 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6685
6686 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6687
6688 * nsterm.m (ns_read_socket): Return early if there is a modal
6689 window (Bug#12043).
6690
6691 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6692
6693 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6694 that FOCUS-FRAME can be omitted.
6695
6696 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6697
6698 Adjust buffer text indirection counters at the end of Fkill_buffer.
6699 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6700 buffer is definitely dead. This should really fix an issue reported
6701 by Christoph Scholtes again. (Bug#12007).
6702 (init_buffer_once): Initialize indirection counters of
6703 buffer_defaults and buffer_local_symbols (for sanity and safety).
6704
6705 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6706
6707 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6708 and continuation glyphs on tooltip frames, leave them at zero.
6709 Avoids continued lines in tooltips. (Bug#11832)
6710
6711 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6712
6713 Simplify copy_overlay.
6714 * buffer.c (copy_overlay): Simplify. Use build_marker.
6715 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6716
6717 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6718
6719 * print.c (print_object): Don't crash when a frame's name is nil
6720 or invalid. (Bug#12025)
6721
6722 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6723 it signals an error when a tooltip frame is being created.
6724
6725 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6726
6727 Cleanup miscellaneous objects allocation and initialization.
6728 * alloc.c (allocate_misc): Change to static. Add argument to
6729 specify the subtype. Adjust comment and users.
6730 (build_overlay): New function.
6731 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6732 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6733 (allocate_misc): Remove prototype.
6734 (build_overlay): Add prototype.
6735
6736 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6737
6738 Swap buffer text indirection counters in Fbuffer_swap_text.
6739 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6740 This avoids crash reported by Christoph Scholtes at
6741 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6742
6743 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6744
6745 * nsmenu.m (Popdown_data): New struct.
6746 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6747 free Popdown_data.
6748 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6749 (initWithContentRect): Make imgView and contentView non-static
6750 and autorelease them. Also autorelease img and matrix (Bug#12005).
6751 (dealloc): Remove (Bug#12005).
6752
6753 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6754
6755 Adjust consing_since_gc when objects are explicitly freed.
6756 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6757 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6758 (free_cons, free_misc): Subtract object size from consing_since_gc.
6759
6760 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6761
6762 Simplify and cleanup markers positioning code.
6763 * marker.c (attach_marker): More useful eassert.
6764 (live_buffer, set_marker_internal): New function.
6765 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6766 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6767
6768 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6769
6770 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6771 as it's limited by the amount of memory, not by INT_MAX.
6772
6773 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6774
6775 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6776 in special-event-map. See the discussion at
6777 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6778 for the reasons.
6779
6780 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6781 info.dwItemData. Fixes crashes on 64-bit Windows.
6782 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6783
6784 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6785
6786 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6787 (conversationIdentifier): Return value is NSInteger.
6788 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6789
6790 2012-07-21 Chong Yidong <cyd@gnu.org>
6791
6792 * window.c (decode_any_window): Signal an error if the window is
6793 on a dead frame (Bug#11984).
6794
6795 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6796
6797 Add indirection counting to speed up Fkill_buffer.
6798 * buffer.h (struct buffer): New member.
6799 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6800 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6801 base buffer indirection counter.
6802 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6803 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6804 through buffer list if indirection counter is 0.
6805
6806 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6807
6808 Extend the value returned by Fgarbage_collect with heap statistics.
6809 * alloc.c (Qheap): New symbol.
6810 (syms_of_alloc): DEFSYM it.
6811 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6812 (Fmemory_free): Remove.
6813 (syms_of_alloc): Don't defsubr it.
6814 * buffer.c (Fcompact_buffer): Remove.
6815 (syms_of_buffer): Don't defsubr it.
6816
6817 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6818
6819 Make maybe_gc inline.
6820 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6821 * lisp.h (consing_since_gc, gc_relative_threshold)
6822 (memory_full_cons_threshold): Revert declaration.
6823 (maybe_gc): Remove prototype, define as inline.
6824 * alloc.c: Remove old commented-out code.
6825 (consing_since_gc, gc_relative_threshold)
6826 (memory_full_cons_threshold): Revert to global.
6827 (maybe_gc): Remove.
6828
6829 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6830
6831 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6832 * lisp.h (build_unibyte_string): New function.
6833 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6834 * sysdep.c, w32fns.c, xfns.c: Use it.
6835 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6836 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6837 Adjust users accordingly.
6838 * font.h (font_open_by_name): Adjust prototype.
6839
6840 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6841
6842 Cleanup calls to Fgarbage_collect.
6843 * lisp.h (maybe_gc): New prototype.
6844 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6845 Remove declarations.
6846 * alloc.c (maybe_gc): New function.
6847 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6848 Make them static.
6849 * bytecode.c (MAYBE_GC): Use maybe_gc.
6850 * eval.c (eval_sub, Ffuncall): Likewise.
6851 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6852 to avoid dependency from auto-save feature.
6853
6854 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6855
6856 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6857 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6858 'for_each_per_buffer_object_at'.
6859 All uses changed. It's better to use upper-case for macros that
6860 cannot be implemented as functions, to give the reader a clue
6861 that they're special.
6862
6863 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6864
6865 * alloc.c (Fgarbage_collect): Tweak docstring.
6866
6867 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6868
6869 Tweak the value returned from Fgarbage_collect again.
6870 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6871 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6872 Adjust documentation.
6873 (total_vector_bytes): Rename to total_vector_slots, adjust
6874 accounting.
6875 (total_free_vector_bytes): Rename to total_free_vector_slots,
6876 adjust accounting.
6877 (Qstring_bytes, Qvector_slots): New symbols.
6878 (syms_of_alloc): DEFSYM them.
6879
6880 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6881
6882 Buffer compaction primitive which may be used from Lisp.
6883 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6884 (syms_of_buffer): Register Fcompact_buffer.
6885 * alloc.c (Fgarbage_collect): Use compact_buffer.
6886 * buffer.h (compact_buffer): New prototype.
6887 (struct buffer_text): New member.
6888
6889 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6890
6891 New macro to iterate over all buffers, miscellaneous cleanups.
6892 * lisp.h (all_buffers): Remove declaration.
6893 * buffer.h (all_buffers): Add declaration, with comment.
6894 (for_each_buffer): New macro.
6895 * alloc.c (Fgarbage_collect, mark_object): Use it.
6896 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6897 (init_buffer): Likewise.
6898 * data.c (Fset_default): Likewise.
6899 * coding.c (code_conversion_restore): Remove redundant check
6900 for dead buffer.
6901 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6902
6903 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6904
6905 Fix bug that created negative-length intervals.
6906 * intervals.c (merge_interval_right, merge_interval_left):
6907 Do not zero out this interval if it is absorbed by its children,
6908 as this interval's total length doesn't change in that case. See
6909 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6910
6911 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6912
6913 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6914 when invoking (make-bool-vector N t) and N is a positive
6915 multiple of 8 -- the last 8 bits were mistakenly cleared.
6916
6917 Remove some struct layout assumptions in bool vectors.
6918 * alloc.c (bool_header_size): New constant.
6919 (header_size, word_size): Move earlier, as they're now used earlier.
6920 Use 'word_size' in a few more places, where it's appropriate.
6921 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6922 padding before the data member of a bool vector.
6923 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6924 than doing the check by hand with an abort ().
6925
6926 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6927
6928 * eval.c (Fdefvar): Don't check constants since we only set the var if
6929 it's not yet defined anyway (bug#11904).
6930
6931 * lisp.h (last_undo_boundary): Declare new var.
6932 * keyboard.c (command_loop_1): Set it.
6933 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6934 were auto-added by the command loop (bug#11774).
6935
6936 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6937
6938 * w32font.c (Qsymbol): Remove local definition.
6939 (syms_of_w32font): Don't DEFSYM it.
6940
6941 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6942
6943 Fix sweep_vectors to handle large bool vectors correctly.
6944 * alloc.c (sweep_vectors): Account total_vector_bytes for
6945 bool vectors larger than VBLOCK_BYTES_MAX.
6946
6947 2012-07-18 Chong Yidong <cyd@gnu.org>
6948
6949 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6950 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6951
6952 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6953
6954 Return more descriptive data from Fgarbage_collect.
6955 Suggested by Stefan Monnier in
6956 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6957 * alloc.c (bounded_number): New function.
6958 (total_buffers, total_vectors): New variable.
6959 (total_string_size): Rename to total_string_bytes, adjust users.
6960 (total_vector_size): Rename to total_vector_bytes, adjust users.
6961 (sweep_vectors): Account total_vectors and total_vector_bytes.
6962 (Fgarbage_collect): New return value. Adjust documentation.
6963 (gc_sweep): Account total_buffers.
6964 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6965 (VECTOR_SIZE): Remove.
6966 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6967 (Qinterval, Qmisc): New symbols.
6968 (syms_of_data): Initialize them.
6969 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6970 (Qcons, Qbuffer): New declarations.
6971
6972 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6973
6974 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6975 Round up, not down. Improve doc.
6976
6977 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6978
6979 Restore old code in allocate_string_data to avoid Faset breakage.
6980 Reported by Julien Danjou <julien@danjou.info> in
6981 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6982 * alloc.c (allocate_string_data): Restore old code with minor
6983 adjustments, fix comment to explain this subtle issue.
6984
6985 2012-07-17 Eli Zaretskii <eliz@gnu.org>
6986
6987 Remove FILE_SYSTEM_CASE.
6988 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6989
6990 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6991 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6992 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6993 call-process-region passes it through expand-file-name.
6994
6995 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6996
6997 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6998
6999 Fix crash when creating indirect buffer (Bug#11917)
7000 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
7001 Don't handle unbound variables specially if non-zero.
7002 (Fbuffer_local_variables): Pass zero.
7003 (clone_per_buffer_values): Pass non-zero.
7004
7005 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7006
7007 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
7008 to make the loop interruptible.
7009
7010 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7011
7012 * gnutls.c (emacs_gnutls_handshake): Only retry if
7013 GNUTLS_E_INTERRUPTED.
7014
7015 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7016
7017 Cleanup and convert miscellaneous checks to eassert.
7018 * alloc.c (mark_interval): Fix comment, partially rephrase
7019 old comment from intervals.h (see below).
7020 * intervals.c (find_interval, adjust_intervals_for_insertion)
7021 (delete_interval, adjust_intervals_for_deletion)
7022 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
7023 Convert to eassert.
7024 (adjust_intervals_for_insertion, make_new_interval):
7025 Remove obsolete and unused code.
7026 * intervals.h (struct interval): Remove obsolete comment.
7027 * textprotp.c (erase_properties): Remove unused code.
7028 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
7029 (Fremove_list_of_text_properties): Convert to eassert.
7030
7031 2012-07-17 Chong Yidong <cyd@gnu.org>
7032
7033 * editfns.c (Finsert_char): Doc fix.
7034
7035 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7036
7037 Fix previous change to make Fmemory_free always accurate.
7038 * alloc.c (make_interval): Update total_free_intervals.
7039 (make_float): Likewise for total_free_floats.
7040 (free_cons, Fcons): Likewise for total_free_conses.
7041 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
7042 Likewise for total_free_vector_bytes.
7043 (Fmake_symbol): Likewise for total_free_symbols.
7044 (bytes_free): Remove.
7045
7046 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7047
7048 Simple free memory accounting feature.
7049 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
7050 (sweep_vectors): Accumulate size of free vectors.
7051 (Fgarbage_collect): Setup bytes_free.
7052 (Fmemory_free): New function.
7053 (syms_of_alloc): Register it.
7054
7055 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7056
7057 Cleanup overlays checking.
7058 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
7059 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
7060 eassert and OVERLAYP.
7061 (sort_overlays): Change to use OVERLAYP.
7062
7063 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
7064
7065 * editfns.c (Finsert_char): Make it interactive, and make the
7066 second arg optional. Copy interactive spec and docstring from
7067 ucs-insert.
7068
7069 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7070
7071 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
7072 Unlike the other wrapped functions, fabs has an unspecified
7073 effect on errno.
7074
7075 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
7076
7077 * nsterm.m (keyDown): Interpret flags without left/right bits
7078 as the left key (Bug#11670).
7079
7080 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7081
7082 Remove empty and useless init functions.
7083 * lisp.h (init_character_once, init_fns, init_image)
7084 (init_filelock, init_sound): Remove prototype.
7085 * character.c (init_character_once): Remove.
7086 * filelock.c (init_filelock): Likewise.
7087 * fns.c (init_fns): Likewise.
7088 * image.c (init_image): Likewise.
7089 * sound.c (init_sound): Likewise.
7090 * emacs.c (main): Adjust accordingly.
7091
7092 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7093
7094 * gtkutil.h: Tiny cleanups.
7095 (use_old_gtk_file_dialog): Remove useless declaration.
7096 (xg_uses_old_file_dialog): Add suggested const attribute.
7097
7098 2012-07-15 Eli Zaretskii <eliz@gnu.org>
7099
7100 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
7101 (bidi_paragraph_init): Use it to limit search forward for a strong
7102 directional character in abnormally large paragraphs full of
7103 neutral or weak characters. (Bug#11943)
7104
7105 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
7106
7107 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
7108 the toolbar (Bug#9451).
7109 (xg_make_tool_item): Give the widget event box a transparent
7110 background.
7111
7112 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7113
7114 Cleanup basic allocation variables and functions.
7115 * alloc.c (ignore_warnings, init_intervals, init_float)
7116 (init_cons, init_symbol, init_marker): Remove.
7117 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
7118 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
7119 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
7120 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
7121 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
7122 (staticidx, init_alloc_once, init_strings, free_ablock):
7123 Remove redundant initialization.
7124 * fns.c (init_weak_hash_tables): Remove.
7125 * lisp.h (init_weak_hash_tables): Remove prototype.
7126
7127 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7128
7129 Use zero_vector where appropriate.
7130 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
7131 accordingly.
7132 * lisp.h (zero_vector): New declaration.
7133 * font.c (null_vector): Remove.
7134 (syms_of_font): Remove initialization and staticpro.
7135 (font_list_entities, font_find_for_lface): Change to use zero_vector.
7136 * keymap.c (Faccessible_keymaps): Likewise.
7137
7138 2012-07-15 Leo Liu <sdl.web@gmail.com>
7139
7140 * fringe.c: Fix typo in comments.
7141
7142 2012-07-14 Leo Liu <sdl.web@gmail.com>
7143
7144 * fringe.c: Add a new bitmap exclamation-mark.
7145
7146 2012-07-14 Eli Zaretskii <eliz@gnu.org>
7147
7148 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
7149
7150 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
7151 (HAVE_MENUS): Don't define, defined by editing config.in with
7152 msdos/sed2v2.inp.
7153 (GMALLOC_INHIBIT_VALLOC): Don't define.
7154 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
7155
7156 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
7157
7158 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
7159
7160 2012-07-14 Glenn Morris <rgm@gnu.org>
7161
7162 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
7163 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
7164 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
7165
7166 2012-07-13 Glenn Morris <rgm@gnu.org>
7167
7168 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
7169
7170 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
7171 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
7172
7173 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
7174
7175 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
7176 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
7177 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
7178 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
7179 where appropriate.
7180 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
7181 as boolean expression.
7182 (x_set_window_size): Remove unused variable toolbar.
7183 (ns_get_color_default, ns_mod_to_lisp): Remove.
7184 (ns_mouse_position): Remove unused variables xchar and ychar.
7185 (ns_compute_glyph_string_overhangs): Remove unused variable face.
7186 (ns_set_vertical_scroll_bar): Remove unused variable count.
7187 (ns_delete_terminal): Remove unused variable i.
7188 (ns_term_init): Remove unused variables r, g and b.
7189 (mouseDown): Remove unused variable window.
7190 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
7191 (initFrameFromEmacs): Remove unused variable vbextra.
7192 (mouseEntered): Remove unused variables p and dpyinfo.
7193 (mouseExited): Remove unused variables p and r.
7194 (ns_define_frame_cursor, ns_clear_frame_area)
7195 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
7196 (menuDown): Assign [sender tag] to variable and cast the variable.
7197
7198 * nsterm.h (menuDown): Add id as type to argument sender.
7199 (ns_display_info_for_name): Add Lisp_Object argument.
7200 (ns_term_init): Add Lisp_Object argument.
7201 (ns_map_event_to_object): Add void argument.
7202 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
7203 prototype with arguments and only declare if __OBJC__.
7204 (nxatoms_of_nsselect): Add void argument.
7205 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
7206 (ns_alloc_autorelease_pool): Add void argument.
7207 (ns_release_autorelease_pool): Add void* argument.
7208 (ns_get_defaults_value): Add const char* argument.
7209
7210 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
7211 (initFromContents): Use SSDATA where appropriate.
7212 (ns_update_menubar): Add braces to ambigous if-else.
7213 (initWithTitle): Put () around assignment in if statement.
7214 (ns_menu_show): Remove unused variables window and keymap.
7215 (update_frame_tool_bar): Remove unused variable selected_p.
7216 (initWithContentRect): Remove unused variable this_cmd_name.
7217
7218 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
7219 appropriate.
7220 (setXBMColor): Remove unused variable len.
7221 (setPixmapData): Put () around assignment in loop statement.
7222
7223 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
7224 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
7225 where appropriate.
7226 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
7227 around assignment in loop statement.
7228 (nsfont_open): Remove unused variable i.
7229 (nsfont_open): Remove unused variable len.
7230 (nsfont_draw): Remove unused variable cs.
7231
7232 * nsfns.m (x_set_icon_name, ns_set_name_internal)
7233 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
7234 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
7235 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
7236 (Fns_font_name, Fns_perform_service)
7237 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
7238 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
7239 (ns_set_name): Remove unused variable view.
7240 (x_set_menu_bar_lines): Remove unused variable olines.
7241 (x_set_tool_bar_lines): Remove unused variable root_window.
7242 (Fns_list_colors): Put () around assignment in while statement.
7243 (Fns_perform_service): Remove unused variable len.
7244 (Fns_display_usable_bounds): Remove unused variable top.
7245 (syms_of_nsfns): Remove unused variable i.
7246
7247 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7248 memcpy (Bug#11907).
7249
7250 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
7251
7252 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7253 and free it with DestroyExceptionInfo (Bug#11558).
7254
7255 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
7256
7257 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7258 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7259 Set here, not in nt/config.nt.
7260
7261 2012-07-13 Eli Zaretskii <eliz@gnu.org>
7262
7263 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7264 cursor overflow into the last glyph on display line when the right
7265 fringe is off. (Bug#11832)
7266
7267 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7268
7269 * xdisp.c (produce_special_glyphs): Now static.
7270 * dispextern.h (produce_special_glyphs): Remove decl.
7271
7272 2012-07-13 Glenn Morris <rgm@gnu.org>
7273
7274 * s/bsd-common.h, s/cygwin.h: Remove empty files.
7275 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7276
7277 * s/usg5-4-common.h (USG, USG5):
7278 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7279 * s/sol2-6.h (SOLARIS2):
7280 * s/irix6-5.h (IRIX6_5):
7281 * s/hpux10-20.h (USG, USG5, HPUX):
7282 * s/gnu-linux.h (USG, GNU_LINUX):
7283 * s/freebsd.h (BSD_SYSTEM):
7284 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7285 * s/cygwin.h (CYGWIN):
7286 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7287 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7288
7289 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
7290
7291 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
7292
7293 2012-07-13 Glenn Morris <rgm@gnu.org>
7294
7295 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7296
7297 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7298
7299 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7300 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7301
7302 2012-07-12 Glenn Morris <rgm@gnu.org>
7303
7304 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
7305
7306 * process.c (init_process_emacs): Rename from init_process.
7307 The old name is also the name of a Mach system call.
7308 * lisp.h, emacs.c: Update for this name change.
7309 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7310 longer needed.
7311
7312 2012-07-12 Eli Zaretskii <eliz@gnu.org>
7313
7314 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7315 memmove call that removes glyphs covered by the left truncation
7316 glyph. Improve commentary.
7317 (display_line): Fix display of continuation glyphs on GUI frames
7318 when the right fringe is turned off and variable-size fonts are
7319 used in the window. Move the code that appends a stretch glyph to
7320 produce_special_glyphs, so that it could be used for truncation
7321 and continuation glyphs alike.
7322 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7323 glyph of a suitably computed width, to align the special glyphs at
7324 the window margin. Code moved from display_line. (Bug#11832)
7325
7326 2012-07-12 Glenn Morris <rgm@gnu.org>
7327
7328 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7329
7330 * s/gnu-linux.h, s/hpux10-20.h:
7331 Do not unconditionally define HAVE_XRMSETDATABASE.
7332
7333 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7334
7335 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7336
7337 Fix typos that broke OS X build.
7338 Reported by Randal L. Schwartz in
7339 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7340 * nsterm.m (ns_timeout): Add missing local decl.
7341 (ns_get_color): snprintf -> sprintf, to fix typo.
7342
7343 2012-07-12 Glenn Morris <rgm@gnu.org>
7344
7345 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7346 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7347 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7348 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7349
7350 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7351 Move PTY_OPEN to configure.
7352
7353 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7354 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7355 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7356
7357 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7358
7359 Use empty_unibyte_string where applicable.
7360 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7361 * lread.c (read1): Likewise.
7362 * xsettings.c (syms_of_xsettings): Likewise.
7363
7364 2012-07-12 Glenn Morris <rgm@gnu.org>
7365
7366 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7367 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7368 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7369 * s/hpux10-20.h (RUN_TIME_REMAP):
7370 * s/bsd-common.h (TABDLY): Move to configure.
7371
7372 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7373
7374 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7375
7376 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7377 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
7378
7379 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
7380
7381 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7382 * s/template.h: Move NARROWPROTO to configure.
7383
7384 2012-07-11 Glenn Morris <rgm@gnu.org>
7385
7386 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7387 unused since 2011-01-17 change to systty.h.
7388
7389 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7390 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7391 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7392
7393 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7394
7395 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7396
7397 2012-07-11 Glenn Morris <rgm@gnu.org>
7398
7399 * s/darwin.h, s/gnu-linux.h, s/template.h:
7400 Move INTERRUPT_INPUT to configure.
7401
7402 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7403
7404 Minor adjustments to interning code.
7405 * lisp.h (intern, intern_c_string): Redefine as static inline
7406 wrappers for intern_1 and intern_c_string_1, respectively.
7407 (intern_1, intern_c_string_1): Rename prototypes.
7408 * lread.c (intern_1, intern_c_string_1, oblookup):
7409 Simplify Vobarray checking.
7410 * font.c (font_intern_prop): Likewise. Adjust comment.
7411 * w32font.c (intern_font_name): Likewise.
7412
7413 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7414
7415 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7416
7417 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7418 of Fcar/Fcdr if possible.
7419 * font.c (check_otf_features): Likewise.
7420 * fontset.c (Fnew_fontset): Likewise.
7421 * gnutls.c (Fgnutls_boot): Likewise.
7422 * minibuf.c (read_minibuf): Likewise.
7423 * msdos.c (IT_set_frame_parameters): Likewise.
7424 * xmenu.c (Fx_popup_dialog): Likewise.
7425 * w32menu.c (Fx_popup_dialog): Likewise.
7426
7427 2012-07-11 Glenn Morris <rgm@gnu.org>
7428
7429 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7430 since nothing has defined it on these platforms.
7431
7432 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7433 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7434
7435 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7436 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7437 Move CLASH_DETECTION to configure.
7438
7439 * s/gnu.h: Remove file, which is now empty.
7440
7441 * s/gnu.h, s/gnu-linux.h:
7442 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7443
7444 2012-07-11 John Wiegley <johnw@newartisans.com>
7445
7446 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7447 function attribute, so we only use it if it exists in the
7448 compiler.
7449
7450 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7451
7452 Avoid call to strlen in fast_c_string_match_ignore_case.
7453 * search.c (fast_c_string_match_ignore_case): Change to use
7454 length argument. Adjust users accordingly.
7455 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7456
7457 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7458
7459 Assume mkdir, rmdir.
7460 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7461 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7462
7463 Assume rename.
7464 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7465
7466 Assume perror.
7467 * s/hpux10-20.h (HAVE_PERROR): Remove.
7468 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7469 Remove dummy definition, as this problem was obsolete long ago.
7470
7471 Assume strerror.
7472 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7473
7474 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7475
7476 Avoid calls to strlen in font processing functions.
7477 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
7478 (font_open_by_name): Change to use length argument.
7479 Adjust users accordingly.
7480 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7481 Adjust prototypes.
7482 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7483 Change to return ptrdiff_t.
7484 (xfont_list_pattern, xfont_match): Use length returned by
7485 xfont_decode_coding_xlfd.
7486 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7487
7488 2012-07-11 Glenn Morris <rgm@gnu.org>
7489
7490 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7491 Move DONT_REOPEN_PTY to configure.
7492
7493 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7494 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7495
7496 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7497
7498 Remove "#define unix" that is no longer needed (Bug#11905).
7499 * s/aix4-2.h (unix): Remove; no longer needed.
7500
7501 EMACS_TIME simplification (Bug#11875).
7502 This replaces macros (which typically do not work in GDB)
7503 with functions, typedefs and enums, making the code easier to debug.
7504 The functional style also makes code easier to read and maintain.
7505 * systime.h: Include <sys/time.h> on all hosts, not just if
7506 WINDOWSNT, since 'struct timeval' is needed in general.
7507 (EMACS_TIME): Now a typedef, not a macro.
7508 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7509 not macros.
7510 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7511 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7512 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7513 (EMACS_TIME_LE): Now functions, not macros.
7514 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7515 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7516 which are not functions. All uses rewritten to use:
7517 (make_emacs_time): New function.
7518 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7519 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7520 not functions. All uses rewritten to use the following, respectively:
7521 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7522 (add_emacs_time, sub_emacs_time): New functions.
7523 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7524 * fileio.c (Fcopy_file):
7525 * xterm.c (XTflash): Get the current time closer to when it's used.
7526 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7527
7528 * bytecode.c (targets): Suppress -Woverride-init warnings.
7529
7530 Simplify by avoiding confusing use of strncpy etc.
7531 * doc.c (Fsnarf_documentation):
7532 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7533 * frame.c (Fmake_terminal_frame):
7534 * gtkutil.c (get_utf8_string):
7535 * lread.c (openp):
7536 * nsmenu.m (ns_update_menubar):
7537 * regex.c (regerror):
7538 Prefer memcpy to strncpy and strncat when either will do.
7539 * fileio.c (Fsubstitute_in_file_name):
7540 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7541 (menu_separator_name_p):
7542 * nsmenu.m (ns_update_menubar):
7543 Prefer memcmp to strncmp when either will do.
7544 * nsterm.m: Include <ftoastr.h>.
7545 (ns_get_color):
7546 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7547 Prefer snprintf to strncpy.
7548 * nsterm.m (ns_term_init):
7549 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7550 * nsterm.m (ns_term_init):
7551 Avoid the need for strncpy, by using build_string or
7552 make_unibyte_string directly. Use dtoastr, not snprintf.
7553 * process.c (Fmake_network_process): Diagnose service names that
7554 are too long, rather than silently truncating them or creating
7555 non-null-terminated names.
7556 (Fnetwork_interface_info): Likewise, for interface names.
7557 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7558 Prefer sprintf to strncat.
7559 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7560 Prefer vsnprintf to vsprintf + strncpy.
7561
7562 2012-07-10 Glenn Morris <rgm@gnu.org>
7563
7564 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7565 Clarify fallback case.
7566
7567 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7568
7569 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7570 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7571 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7572 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7573 where argument type is known to be a Lisp_Cons.
7574
7575 2012-07-10 Tom Tromey <tromey@redhat.com>
7576
7577 * bytecode.c (BYTE_CODE_THREADED): New macro.
7578 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7579 (enum byte_code_op): New type.
7580 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7581 (exec_byte_code): Use them. Use token threading when applicable.
7582
7583 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7584
7585 Optimize pure C strings initialization.
7586 * lisp.h (make_pure_string): Fix prototype.
7587 (build_pure_c_string): New function, defined as static inline. This
7588 provides a better opportunity to optimize away calls to strlen when
7589 the function is called with compile-time constant argument.
7590 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7591 argument, adjust users accordingly. Use build_pure_c_string where
7592 appropriate.
7593 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7594 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7595 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7596
7597 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7598
7599 Avoid calls to strlen in miscellaneous functions.
7600 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7601 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7602 * lread.c (openp): Likewise.
7603
7604 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7605
7606 Avoid calls to strlen in path processing functions.
7607 * fileio.c (file_name_as_directory): Add comment. Change to add
7608 srclen argument and return the length of result. Adjust users
7609 accordingly.
7610 (directory_file_name): Fix comment. Change to add srclen argument,
7611 swap 1st and 2nd arguments to obey the common convention.
7612 Adjust users accordingly.
7613 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7614
7615 2012-07-10 Glenn Morris <rgm@gnu.org>
7616
7617 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7618 Move PENDING_OUTPUT_COUNT definition to configure.
7619
7620 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7621 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7622 * s/gnu.h (DATA_START): Move definitions to configure.
7623
7624 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7625 We include usg5-4-common.h, which defines them both.
7626
7627 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7628 O_RDONLY already includes it).
7629
7630 Stop ns builds setting the EMACSLOADPATH environment variable.
7631 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7632 Now it does not set EMACSLOADPATH, just returns the load-path string.
7633 * nsterm.h: Update accordingly.
7634 * lread.c [HAVE_NS]: Include nsterm.h.
7635 (init_lread) [HAVE_NS]: Use ns_load_path.
7636 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7637
7638 2012-07-09 Glenn Morris <rgm@gnu.org>
7639
7640 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7641 since the included bsd-common.h does so.
7642
7643 Stop ns builds setting the EMACSPATH environment variable.
7644 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7645 (ns_init_paths): Do not set EMACSPATH.
7646 * nsterm.h (ns_exec_path): Add it.
7647 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7648 Use ns_exec_path.
7649
7650 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7651
7652 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7653
7654 * process.c (wait_reading_process_output): 'waitchannels' was unset
7655 when read_kbd || !NILP (wait_for_cell); fix this.
7656
7657 Add GCC-style 'const' attribute to functions that can use it.
7658 * character.h (char_resolve_modifier_mask):
7659 * keyboard.h (make_ctrl_char):
7660 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7661 (init_character_once, next_almost_prime, init_fns, init_image)
7662 (flush_pending_output, init_sound):
7663 * mem-limits.h (start_of_data):
7664 * menu.h (finish_menu_items):
7665 Add ATTRIBUTE_CONST.
7666 * emacs.c (DEFINE_DUMMY_FUNCTION):
7667 Declare the dummy function with ATTRIBUTE_CONST.
7668 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7669 Add decls with ATTRIBUTE_CONST.
7670
7671 Minor improvements to make_formatted_string.
7672 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7673 where int is good enough, as vsprintf returns an int.
7674 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7675
7676 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7677
7678 Use make_formatted_string to avoid double length calculation.
7679 * lisp.h (make_formatted_string): New prototype.
7680 * alloc.c (make_formatted_string): New function.
7681 * buffer.c (Fgenerate_new_buffer_name): Use it.
7682 * dbusbind.c (syms_of_dbusbind): Likewise.
7683 * editfns.c (Fcurrent_time_zone): Likewise.
7684 * filelock.c (get_boot_time): Likewise.
7685 * frame.c (make_terminal_frame, set_term_frame_name)
7686 (x_report_frame_params): Likewise.
7687 * image.c (gs_load): Likewise.
7688 * minibuf.c (get_minibuffer): Likewise.
7689 * msdos.c (dos_set_window_size): Likewise.
7690 * process.c (make_process): Likewise.
7691 * xdisp.c (ensure_echo_area_buffers): Likewise.
7692 * xsettings.c (apply_xft_settings): Likewise.
7693
7694 2012-07-09 Glenn Morris <rgm@gnu.org>
7695
7696 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7697 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7698 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7699 * nsterm.h (ns_etc_directory): Add it.
7700 * callproc.c [HAVE_NS]: Include nsterm.h.
7701 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7702
7703 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7704
7705 Move marker debugging code under MARKER_DEBUG.
7706 * marker.c (MARKER_DEBUG): Move marker debugging code under
7707 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7708 for bootstrap with --enable-checking (~3x slowdown reported
7709 by Juanma Barranquero <lekktu@gmail.com>).
7710 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7711
7712 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7713
7714 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7715 See <http://bugs.gnu.org/11825#29>.
7716
7717 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7718
7719 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7720 has no font, use the frame's font. (Bug#11813)
7721 (display_line): Add commentary about displaying truncation glyphs
7722 on GUI frames.
7723 (produce_special_glyphs): Move here from term.c.
7724
7725 * term.c (produce_special_glyphs): Move to xdisp.c.
7726
7727 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7728 section.
7729
7730 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7731
7732 * xdisp.c (display_line): Avoid warning about implicit declaration
7733 of FRAME_FONT.
7734
7735 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7736
7737 * lisp.h: Remove empty conditional.
7738
7739 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7740
7741 * lread.c (load_path_check): Now static.
7742
7743 Fix some minor --with-ns problems found by static checking.
7744 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7745 (x_set_font) [!HAVE_X_WINDOWS]:
7746 * image.c (xpm_load_image) [HAVE_NS]:
7747 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7748 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7749 Remove unused local.
7750 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7751 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7752 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7753 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7754 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7755 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7756 Fix pointer signedness problem.
7757 * xfaces.c (FRAME_X_FONT_TABLE):
7758 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7759
7760 2012-07-07 Glenn Morris <rgm@gnu.org>
7761
7762 * lread.c (load_path_check): New function, split from init_lread.
7763 (init_lread): Reorganize. Motivation:
7764 If EMACSLOADPATH is set, check/warn about that rather than the
7765 defaults, which we are not going to use. Hence we can remove
7766 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7767 Don't warn if site-lisp directories are missing.
7768 If not installed, start from a blank load-path, since
7769 PATH_LOADSEARCH refers to the eventual installation directories.
7770
7771 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7772
7773 Support truncation and continuation glyphs on GUI frames, when
7774 fringes are disabled. (Bug#11832)
7775 * xdisp.c (init_iterator): Get dimensions of truncation and
7776 continuation glyphs even if on GUI frames.
7777 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7778 or both, are absent.
7779 (start_display, move_it_in_display_line_to): Handle the case of a
7780 GUI frame without a fringe to display continuation or truncation
7781 glyphs.
7782 (insert_left_trunc_glyphs): Support GUI frames: make sure
7783 truncation glyphs overwrite enough glyphs from the current line to
7784 have sufficient space in pixels.
7785 (display_line): Support truncation and continuation glyphs on GUI
7786 frames. If some spare pixels are left on the line after inserting
7787 the truncation glyphs, fill that space with a stretch glyph of a
7788 suitably computed width.
7789
7790 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7791 produce_glyphs, to support GUI sessions.
7792
7793 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7794
7795 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7796
7797 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7798
7799 Do not require float-time's arg to fit in time_t (Bug#11825).
7800 This works better on hosts where time_t is unsigned, and where
7801 float-time is applied to the (negative) difference between two times.
7802 * editfns.c (decode_time_components): Last arg is now double *,
7803 not int *, and means to store all the result as a double, without
7804 worrying about whether the seconds part fits in time_t.
7805 All callers changed.
7806 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7807 All callers changed.
7808 (Ffloat_time): Do not fail merely because the specified time falls
7809 outside of time_t range.
7810
7811 2012-07-07 Glenn Morris <rgm@gnu.org>
7812
7813 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7814 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7815 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7816
7817 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7818
7819 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7820 Update dependencies.
7821
7822 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7823
7824 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7825
7826 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7827 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7828 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7829 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7830 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7831 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7832
7833 * xfont.c (compare_font_names): Redo to omit the need for casts.
7834
7835 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7836
7837 * xfns.c (Fx_change_window_property): Doc fix.
7838 * w32fns.c (Fx_change_window_property): Doc fix.
7839
7840 * w32fns.c (Fx_window_property): Accept the same arguments as the
7841 X Windows version. Doc fix.
7842 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7843
7844 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7845 Eli Zaretskii <eliz@gnu.org>
7846
7847 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7848 Windows-specific code from nt/config.nt moved here.
7849 Obsolete settings removed.
7850
7851 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7852
7853 * process.c: Avoid unnecessary calls to gettime.
7854 (wait_reading_process_output): Don't get the time of day
7855 when gobbling data immediately and not waiting, as there's no need
7856 for it in that case. This removes a FIXME.
7857
7858 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7859
7860 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7861 is defined (Bug#11768).
7862
7863 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7864
7865 Fix marker debugging code.
7866 * marker.c (byte_char_debug_check): Do not perform the check
7867 if buffer is not multibyte.
7868 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7869 Call byte_char_debug_check with correct arguments.
7870
7871 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7872
7873 Compile marker debugging code only if ENABLE_CHECKING is defined.
7874 * marker.c (byte_char_debug_check, count_markers):
7875 Use only if ENABLE_CHECKING is defined.
7876 (byte_debug_flag): Remove.
7877 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7878 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7879
7880 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7881
7882 Avoid code repetition in marker-related functions.
7883 * marker.c (attach_marker): New function.
7884 (Fset_marker, set_marker_restricted, set_marker_both)
7885 (set_marker_restricted_both): Use it.
7886 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7887 Consistently rename charno to charpos.
7888 (marker_position): Add eassert.
7889 (marker_byte_position): Convert to eassert.
7890
7891 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7892
7893 Simplify list operations in unchain_overlay and unchain_marker.
7894 * buffer.c (unchain_overlay): Simplify. Add comment.
7895 * marker.c (unchain_marker): Simplify. Fix comments.
7896
7897 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7898
7899 Introduce fast path for the widely used marker operation.
7900 * alloc.c (build_marker): New function.
7901 * lisp.h (build_marker): New prototype.
7902 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7903 * composite.c (autocmp_chars): Likewise.
7904 * editfns.c (buildmark): Remove.
7905 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7906 (save_restriction_save): Use build_marker.
7907 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7908 * window.c (save_window_save): Likewise.
7909
7910 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7911
7912 Do not use Fdelete_overlay in delete_all_overlays
7913 to avoid redundant calls to unchain_overlay.
7914 * buffer.c (drop_overlay): New function.
7915 (delete_all_overlays, Fdelete_overlay): Use it.
7916 * minibuf.c (get_minibuffer): Fix comment.
7917
7918 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7919
7920 Port to OpenBSD 5.1 amd64.
7921 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7922 This is needed for OpenBSD, and should be harmless on all BSD systems.
7923 Also, include <sys/sysctl.h>, as it should be available on all
7924 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7925 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7926 use p_pid member, not kp_proc.pid.
7927
7928 2012-07-06 Glenn Morris <rgm@gnu.org>
7929
7930 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7931
7932 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7933
7934 More xmalloc and related cleanup.
7935 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7936 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7937 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7938 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7939 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7940 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7941 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7942 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7943 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7944 * xterm.c:
7945 Omit needless casts involving void * pointers and allocation.
7946 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7947 as the former is more robust if P's type is changed.
7948 Prefer xzalloc to xmalloc + memset 0.
7949 Simplify malloc-or-realloc to realloc.
7950 Don't worry about xmalloc returning a null pointer.
7951 Prefer xstrdup to xmalloc + strcpy.
7952 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7953 growing it.
7954 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7955 alloca of a constant.
7956
7957 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7958
7959 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7960 hscroll is larger than the line width. Fixes long and futile
7961 looping inside extend_face_to_end_of_line (on a TTY) producing
7962 glyphs that are not needed and thrown away.
7963
7964 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7965
7966 * marker.c (set_marker_restricted_both): Simplify by using
7967 clip_to_bounds.
7968
7969 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7970
7971 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7972
7973 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7974
7975 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7976 not defined (Bug#11768).
7977 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7978 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7979 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7980 followed by gtk_box_set_homogeneous (Bug#11768).
7981 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7982 (update_theme_scrollbar_width, xg_create_scroll_bar):
7983 Use gtk_scrollbar_new (Bug#11768).
7984 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7985 (is_box_type): New function (Bug#11768).
7986 (xg_tool_item_stale_p): Call is_box_type.
7987 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7988 with default display (Bug#11768).
7989
7990 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7991
7992 * xdisp.c (window_hscroll_limited): New function.
7993 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7994 coordinates when window's hscroll is set to insanely large
7995 values. (Bug#11857)
7996
7997 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
7998
7999 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
8000 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
8001
8002 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8003
8004 Cleanup xmalloc.
8005 * lisp.h (xzalloc): New prototype. Omit needless casts.
8006 * alloc.c (xzalloc): New function. Omit needless casts.
8007 * charset.c: Omit needless casts. Convert all calls to
8008 xmalloc with following memset to xzalloc.
8009 * dispnew.c: Likewise.
8010 * fringe.c: Likewise.
8011 * image.c: Likewise.
8012 * sound.c: Likewise.
8013 * term.c: Likewise.
8014 * w32fns.c: Likewise.
8015 * w32font.c: Likewise.
8016 * w32term.c: Likewise.
8017 * xfaces.c: Likewise.
8018 * xfns.c: Likewise.
8019 * xterm.c: Likewise.
8020 * atimer.c: Omit needless casts.
8021 * buffer.c: Likewise.
8022 * callproc.c: Likewise.
8023 * ccl.c: Likewise.
8024 * coding.c: Likewise.
8025 * composite.c: Likewise.
8026 * doc.c: Likewise.
8027 * doprnt.c: Likewise.
8028 * editfns.c: Likewise.
8029 * emacs.c: Likewise.
8030 * eval.c: Likewise.
8031 * filelock.c: Likewise.
8032 * fns.c: Likewise.
8033 * gtkutil.c: Likewise.
8034 * keyboard.c: Likewise.
8035 * lisp.h: Likewise.
8036 * lread.c: Likewise.
8037 * minibuf.c: Likewise.
8038 * msdos.c: Likewise.
8039 * print.c: Likewise.
8040 * process.c: Likewise.
8041 * region-cache.c: Likewise.
8042 * search.c: Likewise.
8043 * sysdep.c: Likewise.
8044 * termcap.c: Likewise.
8045 * terminal.c: Likewise.
8046 * tparam.c: Likewise.
8047 * w16select.c: Likewise.
8048 * w32.c: Likewise.
8049 * w32reg.c: Likewise.
8050 * w32select.c: Likewise.
8051 * w32uniscribe.c: Likewise.
8052 * widget.c: Likewise.
8053 * xdisp.c: Likewise.
8054 * xmenu.c: Likewise.
8055 * xrdb.c: Likewise.
8056 * xselect.c: Likewise.
8057
8058 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8059
8060 * fileio.c (time_error_value): Check the right error number.
8061 Problem reported by Troels Nielsen in
8062 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
8063
8064 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8065
8066 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
8067 This should be fixed in a better way; see Eli Zaretskii in
8068 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
8069 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
8070
8071 * fileio.c (time_error_value): Rename from special_mtime.
8072 The old name's problems were noted by Eli Zaretskii in
8073 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
8074
8075 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
8076 This variable's comment says Emacs needs at least one GDB-visible
8077 symbol of type enum pvec_type, to work around GDB problems.
8078 The symbol's value doesn't matter.
8079
8080 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
8081 that causes compilation to fail on pre-C99 compilers.
8082
8083 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
8084
8085 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
8086 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
8087
8088 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8089
8090 * buffer.c (init_buffer_once): Fix initialization of
8091 headers for buffer_defaults and buffer_local_symbols.
8092 Reported by Juanma Barranquero <lekktu@gmail.com>.
8093
8094 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8095
8096 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
8097 * lisp.h (enum pvec_type): Use fewer bits.
8098 (PSEUDOVECTOR_SIZE_BITS): New constant.
8099 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
8100 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
8101 change in pvec_type.
8102 (PSEUDOVECTOR_TYPEP): New macro.
8103 (TYPED_PSEUDOVECTORP): Use it.
8104 * fns.c (internal_equal): Adapt code to extract pvectype.
8105 * emacs.c (gdb_pvec_type): Update type.
8106 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
8107 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
8108 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
8109 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
8110 (sweep_vectors): Use it. Use local var `total_bytes' instead of
8111 abusing vector->header.next.nbytes.
8112 (live_vector_p): Use PVEC_TYPE.
8113 (mark_object): Adapt code to extract pvectype. Use switch.
8114
8115 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8116
8117 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
8118 Tighten new eassert a bit.
8119
8120 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8121
8122 Fix compilation with --enable-gcc-warnings and -O1
8123 optimization level.
8124 * doprnt.c (doprnt): Change type of tem to int, initialize
8125 to avoid compiler warning. Add eassert.
8126 * search.c (simple_search): Initialize match_byte to avoid
8127 compiler warning. Add eassert.
8128
8129 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8130
8131 Avoid weird behavior with large horizontal scrolls.
8132 Without this change, for example, large hscroll values would
8133 mess up Emacs's display on Fedora 15 x86, presumably due to
8134 overflows in int calculations in the display code.
8135 Also, if buffers had long lines, Emacs would freeze.
8136 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
8137 (set_window_hscroll): New function, containing the old guts of
8138 Fset_window_hscroll. Return the clipped value.
8139 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
8140 This avoids the need to check against PTRDIFF_MAX.
8141
8142 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
8143
8144 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8145
8146 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
8147
8148 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8149
8150 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
8151 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
8152 since GCC 4.4.6 issues a bogus warning for them.
8153
8154 Fix bugs in file timestamp newness comparisons.
8155 * fileio.c (Ffile_newer_than_file_p):
8156 * lread.c (Fload): Use full timestamp resolution of files,
8157 not just the 1-second resolution, so that files that are only
8158 slightly newer still count as newer.
8159 * fileio.c (Ffile_newer_than_file_p): Don't assume file
8160 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
8161
8162 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
8163
8164 * fileio.c: Improve handling of file time marker. (Bug#11852)
8165 (special_mtime): New function.
8166 (Finsert_file_contents, Fverify_visited_file_modtime):
8167 Use it to set special mtime values consistently.
8168
8169 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
8170
8171 * fileio.c (Finsert_file_contents): Properly handle st_mtime
8172 marker for non-existing file. (Bug#11852)
8173
8174 2012-07-03 Glenn Morris <rgm@gnu.org>
8175
8176 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
8177 and did not make it into globals.h).
8178
8179 2012-07-03 Tom Tromey <tromey@redhat.com>
8180
8181 * window.c (Fset_window_margins, Fset_window_fringes)
8182 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
8183 * textprop.c (Fprevious_property_change): No longer static.
8184 * syntax.c (Fsyntax_table_p): No longer static.
8185 * process.c (Fget_process, Fprocess_datagram_address): No longer
8186 static.
8187 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
8188 * keyboard.c (Fcommand_execute): No longer static.
8189 Remove EXFUN.
8190 * insdel.c (Fcombine_after_change_execute): No longer static.
8191 * image.c (Finit_image_library): No longer static.
8192 * fileio.c (Fmake_symbolic_link): No longer static.
8193 * eval.c (Ffetch_bytecode): No longer static.
8194 * editfns.c (Fuser_full_name): No longer static.
8195 * doc.c (Fdocumentation_property, Fsnarf_documentation):
8196 No longer static.
8197 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
8198 static.
8199 * dired.c (Ffile_attributes): No longer static.
8200 * composite.c (Fcomposition_get_gstring): No longer static.
8201 * callproc.c (Fgetenv_internal): No longer static.
8202
8203 * ccl.h: Remove EXFUNs.
8204 * buffer.h: Remove EXFUNs.
8205 * dispextern.h: Remove EXFUNs.
8206 * intervals.h: Remove EXFUNs.
8207 * fontset.h: Remove EXFUN.
8208 * font.h: Remove EXFUNs.
8209 * dosfns.c (system_process_attributes): Remove EXFUN.
8210 * keymap.h: Remove EXFUNs.
8211 * lisp.h: Remove EXFUNs.
8212 * w32term.h: Remove EXFUNs.
8213 * window.h: Remove EXFUNs.
8214 * xsettings.h: Remove EXFUN.
8215 * xterm.h: Remove EXFUN.
8216
8217 2012-07-03 Glenn Morris <rgm@gnu.org>
8218
8219 * lisp.h (Frandom): Make it visible to C.
8220 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
8221 buffer for invisible buffers. (Bug#1229)
8222
8223 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8224
8225 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
8226 values which aren't power of 2.
8227 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
8228 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
8229 accordingly.
8230
8231 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
8232
8233 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
8234
8235 * alloc.c (mark_object): Revert part of last patch to use `switch'.
8236
8237 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8238
8239 * alloc.c (allocate_vector_block): Remove redundant
8240 calls to mallopt if DOUG_LEA_MALLOC is defined.
8241 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
8242 avoid calls to mallopt if zero_vector is returned.
8243
8244 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8245
8246 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8247 is enabled, avoid dereferencing NULL current_sblock if
8248 running undumped.
8249
8250 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8251
8252 Cleanup basic buffer management.
8253 * buffer.h (struct buffer): Change layout to use generic vector
8254 marking code. Fix some comments. Change type of 'clip_changed'
8255 to bitfield. Remove unused #ifndef old.
8256 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8257 (GET_OVERLAYS_AT): Fix indentation.
8258 (for_each_per_buffer_object_at): New macro.
8259 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8260 (Fbuffer_local_variables): Use it.
8261 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8262 * alloc.c (allocate_buffer): Adjust to match new layout of
8263 struct buffer. Fix comment.
8264 (mark_overlay): New function.
8265 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8266 Lisp area of struct buffer.
8267 (mark_object): Use it. Adjust marking of misc objects
8268 and related comments.
8269
8270 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8271
8272 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8273 wrapper that is not needed because the wrapped code is a no-op (zero
8274 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8275 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8276
8277 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8278
8279 * alloc.c (mark_buffer): Simplify. Remove prototype.
8280 (mark_object): Add comment. Reorganize marking of vector-like
8281 objects. Use CHECK_LIVE for all vector-like objects except buffers
8282 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
8283 Avoid redundant calls to mark_vectorlike for bool vectors.
8284
8285 2012-06-30 Glenn Morris <rgm@gnu.org>
8286
8287 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8288
8289 * epaths.in (PATH_SITELOADSEARCH): New.
8290 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8291 This is rather than relying on --enable-locallisppath elements
8292 having "site-lisp" in their names. (Bug#10208#25, 11658)
8293
8294 2012-06-30 Eli Zaretskii <eliz@gnu.org>
8295
8296 * w32proc.c (sys_select): Accept and ignore one more argument.
8297
8298 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8299
8300 * sysselect.h [DOS_NT]: Don't include sys/select.h.
8301 (pselect) [!MS_DOS]: Redirect to sys_select.
8302
8303 * sysdep.c: Don't include dos.h and dosfns.h.
8304
8305 * process.c (sys_select):
8306 * msdos.c (sys_select): Accept one more argument and ignore it.
8307
8308 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8309 adapt data types and code to that.
8310
8311 * dosfns.c:
8312 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8313 which clashes with the gnulib function of the same name.
8314
8315 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8316
8317 * font.c (font_style_to_value, font_style_symbolic)
8318 (font_prop_validate_style): Add type checks for values in
8319 font_style_table.
8320
8321 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8322 argument.
8323 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8324 uses.
8325
8326 2012-06-29 Eli Zaretskii <eliz@gnu.org>
8327
8328 * xdisp.c (try_window_id): Undo last change.
8329
8330 * w32.c (getwd): Adjust commentary about startup_dir.
8331 (init_environment): Always call sys_access, even in non-MSVC
8332 builds. Don't chdir to the directory of the Emacs executable.
8333 This undoes code from 1997 which was justified by the need to
8334 "avoid conflicts when removing and renaming directories". But its
8335 downside was that every relative file name was being interpreted
8336 relative to the directory of the Emacs executable, which can never
8337 be TRT. In particular, it broke sys_access when called with
8338 relative file names.
8339 (sys_access): Map GetLastError to errno.
8340
8341 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8342
8343 * window.h (struct window): Change type of 'fringes_outside_margins'
8344 to bitfield. Fix comment. Adjust users accordingly.
8345 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
8346 Adjust comment.
8347 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8348 to ptrdiff_t.
8349
8350 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
8351
8352 * gnutls.c (emacs_gnutls_handshake):
8353 Add QUIT to make the loop interruptible.
8354
8355 2012-06-29 Glenn Morris <rgm@gnu.org>
8356
8357 * charset.c (init_charset): Make lack of etc/charsets fatal.
8358
8359 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8360
8361 * editfns.c (region_limit): Fix type mismatch.
8362
8363 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8364
8365 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8366 undefined. Convert from xassert to eassert.
8367 * nsmenu.m: Convert from xassert to eassert.
8368 * nsterm.m: Likewise.
8369
8370 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8371
8372 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8373
8374 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8375
8376 Avoid integer overflow on scroll-left and scroll-right.
8377 * window.c (HSCROLL_MAX): New macro.
8378 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8379 overflow when requested scroll falls outside ptrdiff_t range.
8380
8381 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8382
8383 * window.h (struct window): Change type of 'hscroll',
8384 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8385 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8386 Adjust users accordingly.
8387 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8388 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8389 from EMACS_INT to ptrdiff_t.
8390 (make_window): Omit redundant initialization.
8391
8392 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
8393
8394 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8395
8396 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8397
8398 * window.h (struct window): Change type of 'use_time' and
8399 'sequence_number' from Lisp_Object to int.
8400 * frame.c (make_frame): Adjust users accordingly.
8401 * print.c (print_object): Likewise.
8402 * window.c (select_window, Fwindow_use_time, make_parent_window)
8403 (make_window): Likewise.
8404
8405 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8406
8407 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8408 enabled with --enable-checking=[all,glyphs] configure option.
8409 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8410 adjust comments accordingly.
8411 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8412 undefined, adjust comments accordingly.
8413 * image.c: Likewise.
8414 * scroll.c: Likewise.
8415 * w32fns.c: Likewise.
8416 * w32term.c: Likewise.
8417 * xdisp.c: Likewise.
8418 * xfaces.c: Likewise.
8419 * xfns.c: Likewise.
8420 * xterm.c: Likewise.
8421
8422 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8423
8424 Generalize run-time debugging checks.
8425 * dispextern.h (XASSERTS): Remove.
8426 * fontset.c (xassert): Remove.
8427 Convert from xassert to eassert.
8428 * alloc.c: Convert from xassert to eassert.
8429 * bidi.c: Likewise.
8430 * dispnew.c: Likewise.
8431 * fns.c: Likewise.
8432 * fringe.c: Likewise.
8433 * ftfont.c: Likewise.
8434 * gtkutil.c: Likewise.
8435 * image.c: Likewise.
8436 * keyboard.c: Likewise.
8437 * menu.c: Likewise.
8438 * process.c: Likewise.
8439 * scroll.c: Likewise.
8440 * sound.c: Likewise.
8441 * term.c: Likewise.
8442 * w32console.c: Likewise.
8443 * w32fns.c: Likewise.
8444 * w32term.c: Likewise.
8445 * window.c: Likewise.
8446 * xdisp.c: Likewise.
8447 * xfaces.c: Likewise.
8448 * xfns.c: Likewise.
8449 * xselect.c: Likewise.
8450 * xterm.c: Likewise.
8451
8452 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8453
8454 * fns.c (maybe_resize_hash_table): Output message when growing the
8455 purify-hashtable.
8456
8457 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8458
8459 * alloc.c (allocate_string_data): Remove dead code.
8460 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8461 avoid GCC warning about unused macro.
8462
8463 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8464
8465 * alloc.c (allocate_string): Omit intervals initialization.
8466 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8467 as in make_pure_string and make_pure_c_string.
8468
8469 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8470
8471 * alloc.c (allocate_string): Fix last change.
8472
8473 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8474
8475 * alloc.c (allocate_string): Remove two redundant calls
8476 to memset, add explicit initialization where appropriate.
8477
8478 2012-06-27 Glenn Morris <rgm@gnu.org>
8479
8480 * lisp.mk (lisp): Remove paths.elc.
8481
8482 2012-06-27 Chong Yidong <cyd@gnu.org>
8483
8484 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8485
8486 2012-06-26 John Wiegley <johnw@newartisans.com>
8487
8488 * unexmacosx.c (copy_data_segment): Add two section names used
8489 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8490
8491 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8492 when building with Clang.
8493
8494 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8495
8496 * eval.c (Fapply): Allow calling it with a single argument.
8497
8498 2012-06-26 Eli Zaretskii <eliz@gnu.org>
8499
8500 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8501 _stricmp and _strnicmp.
8502 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8503
8504 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8505
8506 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8507 allocated window.
8508 (allocate_process): Likewise for new process.
8509 (allocate_terminal): Change to use offsetof.
8510 (allocate_frame): Likewise.
8511 * frame.c (make_frame): Omit redundant initialization.
8512 * window.c (make_parent_window): Use memset.
8513 (make_window): Omit redundant initialization.
8514 * process.c (make_process): Omit redundant initialization.
8515 * terminal.c (create_terminal): Likewise.
8516
8517 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8518
8519 * term.c (delete_tty): Remove redundant call to memset.
8520
8521 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8522
8523 * alloc.c: Remove build_string.
8524 * lisp.h: Define build_string as static inline. This provides
8525 a better opportunity to optimize away calls to strlen when the
8526 function is called with compile-time constant argument.
8527 * image.c (imagemagick_error): Convert to build_string.
8528 * w32proc.c (sys_spawnve): Likewise.
8529 * xterm.c (x_term_init): Likewise.
8530
8531 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8532
8533 Use sprintf return value instead of invoking strlen on result.
8534 In the old days this wasn't portable, since some sprintf
8535 implementations returned char *. But they died out years ago and
8536 Emacs already assumes sprintf returns int.
8537 Similarly for float_to_string.
8538 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8539 * ccl.c (ccl_driver):
8540 * character.c (string_escape_byte8):
8541 * data.c (Fnumber_to_string):
8542 * doprnt.c (doprnt):
8543 * print.c (print_object):
8544 * xdisp.c (message_dolog):
8545 * xfns.c (syms_of_xfns):
8546 Use sprintf or float_to_string result to avoid need to call strlen.
8547 * data.c (Fnumber_to_string):
8548 Use make_unibyte_string, since the string must be ASCII.
8549 * lisp.h, print.c (float_to_string): Now returns int length.
8550 * term.c (produce_glyphless_glyph):
8551 Use sprintf result rather than recomputing it.
8552
8553 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8554 * Makefile.in (ALL_CFLAGS):
8555 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8556 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8557
8558 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8559
8560 * dispextern.h (xstrcasecmp): Define to library function
8561 strcasecmp if available.
8562 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8563
8564 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8565
8566 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8567 Avoid comma operator.
8568 * menu.c (push_submenu_start, push_submenu_end)
8569 (push_left_right_boundary, push_menu_pane): Likewise.
8570 * msdos.c (dos_rawgetc): Likewise.
8571
8572 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8573
8574 * xfns.c (xic_create_fontsetname): Remove redundant calls
8575 to memset.
8576
8577 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8578
8579 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8580 sprintf already null-terminates its output.
8581
8582 * xfns.c (x_window): Remove redundant cast.
8583
8584 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8585
8586 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8587 `const char *' to `char *' to avoid compiler warning.
8588
8589 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8590
8591 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8592 instead of truncating it to 63 (admittedly a generous limit).
8593
8594 * process.c: Fix spelling and caps in comments.
8595
8596 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8597
8598 * emacs.c (setpgrp): Remove definition, unused.
8599 * sysdep.c (setpgrp): Remove definition, not used in this file.
8600
8601 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
8602
8603 * makefile.w32-in: Update dependencies.
8604
8605 2012-06-24 Eli Zaretskii <eliz@gnu.org>
8606
8607 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8608 (SYSTIME_H): Add nt/inc/sys/time.h.
8609
8610 * systime.h [WINDOWSNT]: Include sys/time.h.
8611
8612 * s/ms-w32.h (struct timespec): Definition moved from
8613 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8614
8615 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8616
8617 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8618 * buffer.h (buffer_slot_type_mismatch):
8619 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8620 * eval.c (unwind_to_catch):
8621 * image.c (my_png_error, my_error_exit):
8622 * keyboard.c (quit_throw_to_read_char, user_error)
8623 (Fexit_recursive_edit, Fabort_recursive_edit):
8624 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8625 (wrong_type_argument, buffer_overflow, __executable_start)
8626 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8627 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8628 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8629 (fatal):
8630 (child_setup) [!DOS_NT]:
8631 * lread.c (end_of_file_error, invalid_syntax):
8632 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8633 * puresize.h (pure_write_error):
8634 * search.c (matcher_overflow):
8635 * sound.c (sound_perror, alsa_sound_perror):
8636 * sysdep.c, syssignal.h (croak):
8637 * term.c (maybe_fatal, vfatal):
8638 * textprop.c (text_read_only):
8639 * undo.c (user_error):
8640 * unexmacosx.c (unexec_error):
8641 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8642 Use _Noreturn rather than NO_RETURN.
8643 No need for separate decl merely because of _Noreturn.
8644 * sound.c (sound_warning, parse_sound):
8645 Remove unnecessary forward decls.
8646
8647 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8648
8649 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8650 * lisp.h (WAIT_READING_MAX): New macro.
8651 * dispnew.c (Fsleep_for, sit_for):
8652 * keyboard.c (kbd_buffer_get_event):
8653 * process.c (Faccept_process_output):
8654 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8655 This improves on the previous patch, which introduced a bug
8656 when time_t is unsigned and as wide as intmax_t.
8657 See <http://bugs.gnu.org/9000#51>.
8658
8659 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8660
8661 * dispnew.c (sit_for, Fsleep_for):
8662 * keyboard.c (kbd_buffer_get_event):
8663 * process.c (Faccept_process_output): Avoid compiler warnings when
8664 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8665
8666 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8667
8668 * makefile.w32-in: Update dependencies.
8669
8670 * w32.c (ltime): Add return type and declare static.
8671 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8672
8673 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8674
8675 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8676 Privately reported by Herbert J. Skuhra.
8677 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8678 All uses changed.
8679 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8680 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8681
8682 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8683
8684 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8685 last argument of make_unibyte_string.
8686
8687 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8688 language ID in the event parameters.
8689
8690 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8691 event.code, not the obscure "character set ID".
8692
8693 2012-06-23 Chong Yidong <cyd@gnu.org>
8694
8695 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8696
8697 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8698
8699 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8700 * w32.c (fdutimens): New function.
8701
8702 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8703
8704 * s/ms-w32.h (pselect): Redirect to sys_select.
8705
8706 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8707
8708 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8709 in the logic of incrementing and decrementing the value of
8710 use_relocatable_buffers.
8711
8712 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8713
8714 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8715 Privately reported by Herbert J. Skuhra.
8716 [__FreeBSD__]: Remove "*/" typo after "#include".
8717 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8718 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8719 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8720 Don't assume EMACS_TIME and struct timeval are the same type.
8721
8722 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8723
8724 Support higher-resolution time stamps (Bug#9000).
8725 The time stamps are only nanosecond-resolution at the C level,
8726 since that's the best that any real-world system supports now.
8727 But they are picosecond-resolution at the Lisp level, as that's
8728 easy, and leaves room for future OS improvements.
8729
8730 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8731 (LIBES): Use it.
8732
8733 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8734 Don't get current time unless it's needed.
8735
8736 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8737 now provides it if it's absent.
8738 (start_atimer): Port to higher-res time stamps.
8739 Check for time stamp overflow. Don't get current time more
8740 often than is needed.
8741
8742 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8743 Include systime.h, not time.h.
8744 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8745
8746 * dired.c: Include stat-time.h.
8747 (Ffile-attributes): File times now have higher resolution.
8748
8749 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8750 (struct image): Timestamp now has higher resolution.
8751
8752 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8753 has at least microseconds now. All uses removed.
8754 (update_frame, update_single_window, update_window, update_frame_1)
8755 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8756 (duration_to_sec_usec): Remove; no longer needed.
8757
8758 * editfns.c (time_overflow): Now extern.
8759 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8760 (float-time, Fformat_time_string, Fcurrent_time_string)
8761 (Fcurrent_time_zone): Accept and generate higher-resolution
8762 time stamps.
8763 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8764 (decode_time_components, lisp_seconds_argument): New functions.
8765 (make_time): Now static.
8766 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8767 Report an error if the time is invalid, rather than having the caller
8768 do that.
8769
8770 * fileio.c: Include <stat-time.h>
8771 (Fcopy_file): Copy higher-resolution time stamps.
8772 Prefer to set the time stamp via a file descriptor if that works.
8773 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8774 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8775 (Fvisited_file_modtime, Fset_visited_file_modtime):
8776 Support higher-resolution time stamps.
8777
8778 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8779
8780 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8781
8782 * image.c (prepare_image_for_display, clear_image_cache)
8783 (lookup_image): Port to higer-resolution time stamps.
8784
8785 * keyboard.c (start_polling, bind_polling_period):
8786 Check for time stamp overflow.
8787 (read_char, kbd_buffer_get_event, timer_start_idle)
8788 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8789 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8790 Port to higher-resolution time stamps. Do not assume time_t is signed.
8791 (decode_timer): New function. Timers are now vectors of length 9,
8792 not 8, to accommodate the picosecond component.
8793 (timer_check_2): Use it.
8794
8795 * nsterm.m (select_timeout, timeval_subtract): Remove.
8796 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8797 as they're a bit more accurate and handle overflow better.
8798 (ns_select): Change prototype to be compatible with pselect.
8799 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8800 * nsterm.h (ns_select): Adjust prototype.
8801
8802 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8803 us-resolution time stamps.
8804 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8805
8806 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8807
8808 * lisp.h (time_overflow): New decl.
8809 (wait_reading_process_output): First arg is now intmax_t, not int,
8810 to accommodate larger waits.
8811
8812 * process.h (struct Lisp_Process.read_output_delay):
8813 Now counts nanoseconds, not microseconds.
8814 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8815 EMACS_HAS_USECS.
8816 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8817 (wait_reading_process_output):
8818 Port to ns-resolution time stamps.
8819 (Faccept_process_output, wait_reading_process_output):
8820 Check for time stamp overflow. Do not assume time_t is signed.
8821 (select_wrapper): Remove; we now use pselect.
8822 (Fprocess_attributes): Now generates ns-resolution time stamps.
8823
8824 * sysdep.c: Include utimens.h. Don't include utime.h
8825 or worry about struct utimbuf; gnulib does that for us now.
8826 (gettimeofday): Remove; gnulib provides a substitute.
8827 (make_timeval): New function.
8828 (set_file_times): Now sets ns-resolution time stamps.
8829 New arg FD; all uses changed.
8830 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8831 (system_process_attributes):
8832 Now returns ns-resolution time stamp. All uses changed.
8833 Check for time stamp overflow.
8834
8835 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8836 provides a substitute now.
8837
8838 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8839 since it guarantees struct timespec.
8840 (EMACS_TIME): Now struct timespec, so that we can support
8841 ns-resolution time stamps.
8842 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8843 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8844 (EMACS_USECS): Remove.
8845 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8846 so multiply the arg by 1000 before storing it.
8847 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8848 New macros.
8849 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8850 Port to ns-resolution time stamps.
8851 (EMACS_TIME_NEG_P): Remove; replaced by....
8852 (EMACS_TIME_SIGN): New macro.
8853 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8854 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8855 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8856 (make_timeval, make_lisp_time, decode_time_components): New decls.
8857 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8858 that it mishandled time_t overflow. You can't compare by subtracting!
8859 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8860 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8861
8862 * term.c: Include <sys/time.h>.
8863 (timeval_to_Time): New function, for proper overflow wraparound.
8864 (term_mouse_position, term_mouse_click): Use it.
8865
8866 * undo.c (record_first_change): Support higher-resolution time stamps
8867 in the undo buffer.
8868 (Fprimitive_undo): Use them when restoring time stamps.
8869
8870 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8871 (w32_get_internal_run_time):
8872 Port to higher-resolution Emacs time stamps.
8873 (ltime): Now accepts single 64-bit integer, as that's more convenient
8874 for callers.
8875
8876 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8877
8878 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8879 for compatibility with pselect. Support ns-resolution time stamps.
8880
8881 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8882
8883 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8884 Check for time stamp overflow, and support ns-resolution time stamps.
8885
8886 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8887 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8888 (timeval_subtract): Remove; no longer needed.
8889 (XTflash, XTring_bell, x_wait_for_event):
8890 Port to ns-resolution time stamps. Don't assume time_t is signed.
8891
8892 2012-06-22 Chong Yidong <cyd@gnu.org>
8893
8894 * xdisp.c (x_consider_frame_title): Revert last change.
8895
8896 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8897
8898 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8899 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8900 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8901 staticidx goes up to 1597 out of 1600 = 0x640.)
8902
8903 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8904
8905 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8906 Otherwise, the umask might be mistakenly 0 while handling input signals.
8907
8908 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8909
8910 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8911
8912 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8913
8914 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8915 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8916 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8917 access to `contents' member of Lisp_Vector objects with AREF and ASET
8918 where appropriate.
8919
8920 2012-06-19 Chong Yidong <cyd@gnu.org>
8921
8922 * frame.c (delete_frame): When selecting a frame on a different
8923 text terminal, do not alter the terminal's top-frame.
8924
8925 * xdisp.c (format_mode_line_unwind_data): Record the target
8926 frame's selected window and its terminal's top-frame.
8927 (unwind_format_mode_line): Restore them.
8928 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8929 Callers changed.
8930 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8931 since tty frames can be explicitly named.
8932 (prepare_menu_bars): Likewise.
8933
8934 * term.c (Ftty_top_frame): New function.
8935
8936 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8937
8938 Port byte-code-meter to modern targets.
8939 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8940 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8941 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8942 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8943 (METER_1, METER_2): Simplify.
8944
8945 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8946
8947 * data.c (Fdefalias): Return `symbol' (bug#11686).
8948
8949 2012-06-18 Martin Rudalics <rudalics@gmx.at>
8950
8951 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8952 gets killed during executing of this function (Bug#11665).
8953 Try to always return Qt when the buffer has been actually killed.
8954 (Vkill_buffer_query_functions): In doc-string say that functions
8955 run by this hook should not change the current buffer.
8956
8957 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8958
8959 Fix recently-introduced process.c problems found by static checking.
8960 * process.c (write_queue_push, write_queue_pop, send_process):
8961 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8962 (write_queue_pop): Fix pointer signedness problem.
8963 (send_process): Remove unused local.
8964
8965 2012-06-17 Chong Yidong <cyd@gnu.org>
8966
8967 * xdisp.c (redisplay_internal): No need to redisplay terminal
8968 frames that are not on top.
8969
8970 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
8971
8972 * process.c (make_process): Initialize write_queue.
8973 (write_queue_push, write_queue_pop): New functions.
8974 (send_process): Use them to maintain correct ordering of process
8975 writes (Bug#10815).
8976
8977 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8978
8979 * lisp.h (eassert): Assume C89 or later.
8980 This removes the need for CHECK.
8981 (CHECK): Remove. Its comments about always evaluating its
8982 argument were confusing, as 'eassert' typically does not evaluate
8983 its argument.
8984
8985 * coding.c (produce_chars): Use ptrdiff_t, not int.
8986
8987 * xterm.c (x_draw_underwave): Check for integer overflow.
8988 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8989
8990 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
8991
8992 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8993 referenced (Bug#11583).
8994
8995 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8996
8997 Implement wave-style variant of underlining.
8998 * dispextern.h (face_underline_type): New enum.
8999 (face): Add field for underline type.
9000 * nsterm.m (ns_draw_underwave): New function.
9001 (ns_draw_text_decoration): Use it.
9002 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
9003 New functions.
9004 (x_draw_glyph_string): Use them.
9005 * xfaces.c (Qline, Qwave): New Lisp objects.
9006 (check_lface_attrs, merge_face_ref)
9007 (Finternal_set_lisp_face_attribute, realize_x_face):
9008 Handle wave-style underline face attributes.
9009 * xterm.c (x_draw_underwave): New function.
9010 (x_draw_glyph_string): Use it.
9011
9012 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
9013
9014 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
9015 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
9016 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
9017 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
9018 ($(BLD)/w32select.$(O)): Update dependencies.
9019
9020 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9021
9022 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
9023 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
9024 * character.c (_fetch_multibyte_char_p): Remove.
9025 * alloc.c: Include "character.h" before "buffer.h".
9026 * bidi.c: Likewise.
9027 * buffer.c: Likewise.
9028 * bytecode.c: Likewise.
9029 * callint.c: Likewise.
9030 * callproc.c: Likewise.
9031 * casefiddle.c: Likewise.
9032 * casetab.c: Likewise.
9033 * category.c: Likewise.
9034 * cmds.c: Likewise.
9035 * coding.c: Likewise.
9036 * composite.c: Likewise.
9037 * dired.c: Likewise.
9038 * dispnew.c: Likewise.
9039 * doc.c: Likewise.
9040 * dosfns.c: Likewise.
9041 * editfns.c: Likewise.
9042 * emacs.c: Likewise.
9043 * fileio.c: Likewise.
9044 * filelock.c: Likewise.
9045 * font.c: Likewise.
9046 * fontset.c: Likewise.
9047 * fringe.c: Likewise.
9048 * indent.c: Likewise.
9049 * insdel.c: Likewise.
9050 * intervals.c: Likewise.
9051 * keyboard.c: Likewise.
9052 * keymap.c: Likewise.
9053 * lread.c: Likewise.
9054 * macros.c: Likewise.
9055 * marker.c: Likewise.
9056 * minibuf.c: Likewise.
9057 * nsfns.m: Likewise.
9058 * nsmenu.m: Likewise.
9059 * print.c: Likewise.
9060 * process.c: Likewise.
9061 * regex.c: Likewise.
9062 * region-cache.c: Likewise.
9063 * search.c: Likewise.
9064 * syntax.c: Likewise.
9065 * term.c: Likewise.
9066 * textprop.c: Likewise.
9067 * undo.c: Likewise.
9068 * unexsol.c: Likewise.
9069 * w16select.c: Likewise.
9070 * w32fns.c: Likewise.
9071 * w32menu.c: Likewise.
9072 * window.c: Likewise.
9073 * xdisp.c: Likewise.
9074 * xfns.c: Likewise.
9075 * xmenu.c: Likewise.
9076 * xml.c: Likewise.
9077 * xselect.c: Likewise.
9078
9079 2012-06-16 Eli Zaretskii <eliz@gnu.org>
9080
9081 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
9082 If all the glyphs of the glyph row came from strings, and we have no
9083 cursor positioning clues, put the cursor on the first glyph of the
9084 row.
9085 (handle_face_prop): Use chunk-relative overlay string index when
9086 indexing into it->string_overlays array. (Bug#11653)
9087 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
9088 the rightmost. (Bug#11720)
9089
9090 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9091
9092 * category.h (CHAR_HAS_CATEGORY): Define as inline.
9093 (CATEGORY_MEMBER): Enforce 1/0 value.
9094 * category.c (_temp_category_set): Remove.
9095
9096 2012-06-16 Eli Zaretskii <eliz@gnu.org>
9097
9098 * window.c (Fdelete_other_windows_internal)
9099 (Fdelete_window_internal): Don't access frame's mouse highlight
9100 info of the initial frame. (Bug#11677)
9101
9102 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
9103
9104 * .gdbinit (xgetint): Fix recently-introduced paren typo.
9105 Assume USE_2_TAGS_FOR_INTS.
9106 (xreload): Adjust $tagmask width to match recent lisp.h change.
9107
9108 Simplify lisp.h in minor ways that should not affect code.
9109 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
9110 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
9111 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
9112 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
9113 (INTTYPEBITS): New macro, for clarity.
9114 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
9115 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
9116 Simplify now that USE_LSB_TAG is always defined.
9117 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
9118 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
9119
9120 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
9121
9122 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
9123
9124 2012-06-13 Glenn Morris <rgm@gnu.org>
9125
9126 * s/bsd-common.h (BSD4_3):
9127 * s/usg5-4-common.h (USG5_4): No longer define; unused.
9128
9129 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
9130
9131 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
9132 instead of union.
9133 (XLI, XIL): Define.
9134 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
9135 Use them.
9136 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
9137 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
9138 * alloc.c (widen_to_Lisp_Object): Remove.
9139 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
9140 * frame.c (delete_frame): Remove outdated comment.
9141 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
9142 USE_LISP_UNION_TYPE.
9143 (Fw32_unregister_hot_key): Likewise.
9144 (Fw32_toggle_lock_key): Likewise.
9145 * w32menu.c (add_menu_item): Likewise.
9146 (w32_menu_display_help): Use XIL instead of checking
9147 USE_LISP_UNION_TYPE.
9148 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
9149 (init_heap): Likewise.
9150 * w32term.c (w32_read_socket): Update comment.
9151
9152 2012-06-13 Glenn Morris <rgm@gnu.org>
9153
9154 * s/usg5-4-common.h, src/s/unixware.h:
9155 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
9156
9157 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
9158
9159 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
9160
9161 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
9162 * alloc.c (make_number) [!defined make_number]:
9163 Remove, as lisp.h always defines this now.
9164 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
9165 (roundup_size): Verify that it is a power of 2.
9166 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
9167 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
9168 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
9169 -DUSE_LSB_TAG=0, to override the automatically-selected default.
9170 USE_LSB_TAG now is always defined to be either 0 or 1.
9171 All uses changed.
9172 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
9173 code works fine either way, and efficiency is not a concern here,
9174 as the union type is for debugging, not for production.
9175 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
9176 Use an inline function on all platforms when using the union type,
9177 since this is simpler and 'static inline' can be used portably
9178 within Emacs now.
9179 (LISP_INITIALLY_ZERO): New macro.
9180 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
9181 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
9182
9183 2012-06-12 Glenn Morris <rgm@gnu.org>
9184
9185 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
9186
9187 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
9188
9189 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
9190 Move BROKEN_SIGIO to configure.
9191
9192 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
9193 Move NO_TERMIO to configure.
9194
9195 2012-06-12 Chong Yidong <cyd@gnu.org>
9196
9197 * image.c (imagemagick_load_image): Use MagickFlattenImage if
9198 MagickMergeImageLayers is undefined. Use pixel pusher loop if
9199 MagickExportImagePixels is undefined.
9200
9201 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
9202
9203 * image.c (imagemagick_load_image): Remove unused label.
9204
9205 2012-06-11 Glenn Morris <rgm@gnu.org>
9206
9207 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9208 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
9209 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
9210 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
9211
9212 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
9213
9214 * alloc.c (make_byte_code): New function.
9215 (Fmake_byte_code): Use it. Don't purify here.
9216 * lread.c (read1): Use it as well to avoid extra allocation.
9217
9218 2012-06-11 Chong Yidong <cyd@gnu.org>
9219
9220 * image.c (imagemagick_load_image): Implement transparency.
9221
9222 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
9223
9224 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
9225 account for preceding backslashes. (Bug#11663)
9226
9227 2012-06-09 Chong Yidong <cyd@gnu.org>
9228
9229 * term.c: Support italics in capable terminals (Bug#9652).
9230 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
9231 (turn_on_face): Output using TS_enter_italic_mode if available.
9232 Don't handle unused blinking and alt-charset cases.
9233 (turn_off_face): Handle italic case; discard unused tty_blinking_p
9234 and tty_alt_charset_p cases.
9235 (tty_capable_p, init_tty): Support italics.
9236
9237 * termchar.h (struct tty_display_info): Add field for italics.
9238 Remove unused blink field.
9239
9240 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
9241 Handle slant.
9242
9243 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
9244 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
9245 tty_alt_charset_p. Add tty_italic_p.
9246
9247 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
9248
9249 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9250 dbus_type_is_basic if available.
9251 (xd_extract_signed, xd_extract_unsigned): Rename from
9252 extract_signed and extract_unsigned, respectively. Adapt callers.
9253
9254 2012-06-09 Chong Yidong <cyd@gnu.org>
9255
9256 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9257
9258 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9259 case (Bug#9752).
9260
9261 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9262
9263 * xdisp.c (vmessage): Treat frame message as multibyte.
9264 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9265 would generate the diagnostic "Making \302\247 buffer-local while
9266 let-bound!".
9267
9268 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9269
9270 * dispnew.c (showing_window_margins_p): Undo last change, which
9271 was done due to an inadvertent commit.
9272 (adjust_frame_glyphs_for_frame_redisplay): Do call
9273 showing_window_margins_p.
9274
9275 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9276
9277 * eval.c (Fmake_var_non_special): New primitive.
9278 (syms_of_eval): Defsubr it.
9279 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9280
9281 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
9282
9283 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9284 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9285
9286 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9287
9288 * alloc.c (allocate_vectorlike): Fix last change.
9289
9290 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9291
9292 Block-based vector allocation of small vectors.
9293 * lisp.h (struct vectorlike_header): New field `nbytes',
9294 adjust comment accordingly.
9295 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
9296 to denote vector blocks. Adjust users (live_vector_p,
9297 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9298 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9299 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9300 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9301 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9302 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9303 (roundup_size): New constant.
9304 (struct vector_block): New data type.
9305 (vector_blocks, vector_free_lists, zero_vector): New variables.
9306 (all_vectors): Rename to `large_vectors'.
9307 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9308 (sweep_vectors): New functions.
9309 (allocate_vectorlike): Return `zero_vector' as the only vector of
9310 0 items. Allocate new vector from block if vector size is less than
9311 or equal to VBLOCK_BYTES_MAX.
9312 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9313 (init_alloc_once): Add call to init_vectors.
9314
9315 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9316
9317 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9318
9319 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9320
9321 * doprnt.c (doprnt): Truncate multibyte char correctly.
9322 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9323 would mishandle a string argument "Xc" if X was a multibyte
9324 character of length 2: it would truncate after X's first byte
9325 rather than including all of X.
9326
9327 2012-06-06 Chong Yidong <cyd@gnu.org>
9328
9329 * buffer.c (word_wrap): Doc fix.
9330
9331 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9332
9333 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9334
9335 2012-06-03 Glenn Morris <rgm@gnu.org>
9336
9337 * xdisp.c (tool-bar-style): Doc fix.
9338
9339 2012-06-03 Ulrich Müller <ulm@gentoo.org>
9340
9341 * Makefile.in (PAXCTL): Define.
9342 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9343 binary via PaX flags if the paxctl utility is available.
9344 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9345 Restore PaX flags to their default. (Bug#11398)
9346
9347 2012-06-03 Chong Yidong <cyd@gnu.org>
9348
9349 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9350 buffer (Bug#11226).
9351
9352 2012-06-03 Chong Yidong <cyd@gnu.org>
9353
9354 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9355 (note_mode_line_or_margin_highlight): If there is no help echo,
9356 use mode-line-default-help-echo. Handle the case where the mouse
9357 position is past the end of the mode line string.
9358
9359 * buffer.c (buffer_local_value_1): New function, split from
9360 Fbuffer_local_value; can return Qunbound.
9361 (Fbuffer_local_value): Use it.
9362 (Vmode_line_format): Docstring tweaks.
9363
9364 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9365
9366 * sysdep.c (system_process_attributes): Improve comment.
9367
9368 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9369
9370 * keyboard.c: Export real-this-command to Elisp.
9371 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9372 and DEFVAR it. Update all users.
9373
9374 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9375
9376 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9377
9378 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9379 Convert pctcpu and pctmem to Lisp float properly.
9380 Let the compiler fold better, as 100.0/0x8000 is exact.
9381
9382 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9383
9384 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9385 cons_block.
9386
9387 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9388
9389 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9390
9391 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9392
9393 For a 'struct window', replace some Lisp_Object fields to
9394 bitfields where appropriate, remove unused fields.
9395 * window.h (struct window): Remove unused 'last_mark_x' and
9396 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
9397 change its type from Lisp_Object to bitfield.
9398 Change type of 'force_start', 'optional_new_start',
9399 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
9400 fields from Lisp_Object to bitfield. Adjust users accordingly.
9401
9402 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9403
9404 Pacify gcc -Wdouble-precision when using Xaw.
9405 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9406 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9407 Use 'float' consistently, rather than 'float' in most places
9408 and 'double' in a couple of places.
9409
9410 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9411
9412 * xdisp.c (handle_stop): Detect whether we have overlay strings
9413 loaded by testing it->current.overlay_string_index to be
9414 non-negative, instead of checking whether n_overlay_strings is
9415 positive. (Bug#11587)
9416
9417 2012-05-31 Chong Yidong <cyd@gnu.org>
9418
9419 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9420
9421 * doc.c (Fsubstitute_command_keys): Doc fix.
9422
9423 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9424
9425 * search.c (search_buffer): Remove calls to
9426 r_alloc_inhibit_buffer_relocation, as it is now called by
9427 maybe_unify_char, which was the cause of relocation of buffer text
9428 in bug#11519.
9429
9430 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9431
9432 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9433 for the duration of call to load_charset, to avoid problems with
9434 callers of maybe_unify_char that access buffer text through C
9435 pointers.
9436
9437 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9438 decrement the inhibition flag, instead of just setting or
9439 resetting it.
9440
9441 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9442
9443 Remove obsolete '#define static' cruft.
9444 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9445 This #undef was "temporary" in 2000; it is no longer needed
9446 now that '#define static' has gone away.
9447 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9448 (gray_bitmap_bits): Remove; no longer needed.
9449 All uses replaced with definiens.
9450 * xterm.c: Include "bitmaps/gray.xbm".
9451
9452 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9453
9454 Clean up __executable_start, monstartup when --enable-profiling.
9455 The following changes affect the code only when profiling.
9456 * dispnew.c (__executable_start): Rename from safe_bcopy.
9457 Define only on platforms that need it.
9458 * emacs.c: Include <sys/gmon.h> when profiling.
9459 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9460 (__executable_start): Remove decl, since lisp.h does it now.
9461 (safe_bcopy): Remove decl; no longer has that name.
9462 (main): Coalesce #if into single bit of code, for simplicity.
9463 Cast pointers to uintptr_t, since standard libraries want integers
9464 and not pointers.
9465 * lisp.h (__executable_start): New decl.
9466
9467 2012-05-31 Glenn Morris <rgm@gnu.org>
9468
9469 * image.c (Fimagemagick_types): Doc fix.
9470
9471 2012-05-30 Jim Meyering <meyering@redhat.com>
9472
9473 * callproc.c (Fcall_process_region): Include directory component
9474 in mkstemp error message (Bug#11586).
9475
9476 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9477
9478 * alloc.c, lisp.h (make_pure_vector): Now static.
9479
9480 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9481
9482 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9483 Move to byte-run.el.
9484 (Fautoload): Do the hash-doc more carefully.
9485 * data.c (Fdefalias): Purify definition, except for keymaps.
9486 (Qdefun): Move from eval.c.
9487 * lisp.h (Qdefun): Remove.
9488 * lread.c (read1): Tiny simplification.
9489
9490 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
9491
9492 Do not create empty overlays with the evaporate property (Bug#9642).
9493 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9494 Bug#9642, but explicitly check that the buffer the overlay would
9495 be moved to is live and rearrange lines to make sure that errors
9496 will not put the overlay in an inconsistent state.
9497 (Fdelete_overlay): Cosmetics.
9498
9499 2012-05-28 Eli Zaretskii <eliz@gnu.org>
9500
9501 * w32term.c (my_bring_window_to_top): New function.
9502 (x_raise_frame): Use handle returned by DeferWindowPos, which
9503 could be different from the original one.
9504 Call my_bring_window_to_top instead of my_set_foreground_window.
9505 (Bug#11513)
9506
9507 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9508 by calling BringWindowToTop.
9509
9510 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9511 (WM_EMACS_END): Increase by one.
9512
9513 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9514
9515 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9516 This avoids undefined behavior that might cause the eassert
9517 to not catch an out-of-range value.
9518
9519 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
9520
9521 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9522 Update dependencies.
9523
9524 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9525
9526 * bidi.c (bidi_mirror_char): Fix last change.
9527
9528 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9529
9530 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9531 when referring to sectname field in printf format.
9532
9533 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9534
9535 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9536 Only r_alloc_inhibit_buffer_relocation needed to be added;
9537 the others were already declared.
9538
9539 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9540 before checking whether it's out of range. Put the check inside
9541 eassert. See
9542 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9543
9544 2012-05-27 Ken Brown <kbrown@cornell.edu>
9545
9546 * callproc.c (Fcall_process): Restore a line that was accidentally
9547 commented out in the 2011-02-13 change (bug#11547).
9548
9549 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9550
9551 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9552 defined on ralloc.c.
9553
9554 * buffer.c [REL_ALLOC]: Remove prototypes of
9555 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9556 they are now on lisp.h.
9557
9558 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9559
9560 * search.c (search_buffer): Use it to inhibit relocation of buffer
9561 text while re_search_2 is doing its job, because re_search_2 is
9562 passed C pointers to buffer text. (Bug#11519)
9563
9564 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9565 Update value to 24.
9566
9567 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9568 state after an additional call to move_it_in_display_line_to, keep
9569 the values of it->max_ascent and it->max_descent found for the
9570 entire line.
9571 (pos_visible_p): Revert the comparison against bottom_y to what it
9572 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9573 (Bug#11464)
9574
9575 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9576
9577 Fix coding-related core dumps with gcc -ftrapv.
9578 The code was computing A - B, where A and B are pointers, and B is
9579 random garbage. This can lead to core dumps on platforms that
9580 have special pointer registers, and it also leads to core dumps on
9581 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9582 A - B only when B is initialized properly.
9583 * coding.c (coding_set_source, coding_set_destination): Return void.
9584 (coding_change_source, coding_change_destinations): New functions,
9585 with the old behaviors of coding_set_source and coding_set_destination.
9586 All callers that need an offset changed to use these new functions.
9587
9588 2012-05-26 Glenn Morris <rgm@gnu.org>
9589
9590 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9591
9592 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9593
9594 Extend mouse support on W32 text-mode console.
9595 * xdisp.c (draw_row_with_mouse_face):
9596 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9597
9598 * w32console.c: Include window.h.
9599 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9600 New functions.
9601 (initialize_w32_display): Initialize mouse-highlight data.
9602
9603 * w32inevt.c: Include termchar.h and window.h.
9604 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9605 moves, call note_mouse_highlight. If help_echo changed, call
9606 gen_help_event to produce help-echo message in the echo area.
9607 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9608 highlight info.
9609
9610 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9611
9612 * lread.c (read1): Simplify slightly to avoid an overflow warning
9613 with GCC 4.7.0 on x86-64.
9614
9615 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9616
9617 * bidi.c (bidi_mirror_char): Revert last change: an int is
9618 definitely wide enough here.
9619
9620 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
9621
9622 Fix integer width and related bugs (Bug#9874).
9623 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9624 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9625 (string_bytes, check_sblock, allocate_string_data):
9626 (compact_small_strings, Fmake_bool_vector, make_string)
9627 (make_unibyte_string, make_multibyte_string)
9628 (make_string_from_bytes, make_specified_string)
9629 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9630 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9631 (mark_vectorlike):
9632 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9633 (allocate_pseudovector):
9634 Use int, not EMACS_INT, where int is wide enough.
9635 (inhibit_garbage_collection, Fgarbage_collect):
9636 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9637 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9638 int might not be wide enough.
9639 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9640 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9641 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9642 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9643 (bidi_level_of_next_char, bidi_move_to_visually_next):
9644 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9645 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9646 (Fkill_buffer, Fset_buffer_major_mode)
9647 (advance_to_char_boundary, Fbuffer_swap_text)
9648 (Fset_buffer_multibyte, overlays_at, overlays_in)
9649 (overlay_touches_p, struct sortvec, record_overlay_string)
9650 (overlay_strings, recenter_overlay_lists)
9651 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9652 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9653 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9654 (Foverlay_recenter, last_overlay_modification_hooks_used)
9655 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9656 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9657 (validate_region): Omit unnecessary test for b <= e,
9658 since that's guaranteed by the previous test.
9659 (adjust_overlays_for_delete): Avoid pos + length overflow.
9660 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9661 (report_overlay_modification):
9662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9663 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9664 Omit pointer cast, which isn't needed anyway, and doesn't work
9665 after the EMACS_INT -> ptrdiff_t change.
9666 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9667 * buffer.h: Adjust decls to match defn changes elsewhere.
9668 (struct buffer_text, struct buffer):
9669 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9670 Use EMACS_INT, not int, where int might not be wide enough.
9671 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9672 not int, to avoid needless 32-bit limit on 64-bit hosts.
9673 (exec_byte_code): Use tighter memory-full test, one that checks
9674 for alloca overflow. Don't compute the address of the object just
9675 before an array, as that's not portable. Use EMACS_INT, not
9676 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9677 * callint.c (Fcall_interactively):
9678 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9679 * callproc.c (call_process_kill, Fcall_process):
9680 Don't assume pid_t fits into an Emacs fixnum.
9681 (call_process_cleanup, Fcall_process, child_setup):
9682 Don't assume pid_t fits into int.
9683 (call_process_cleanup, Fcall_process, delete_temp_file)
9684 (Fcall_process_region):
9685 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9686 (Fcall_process): Simplify handling of volatile integers.
9687 Use int, not EMACS_INT, where int will do.
9688 * casefiddle.c (casify_object, casify_region, operate_on_word)
9689 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9691 (casify_object): Avoid integer overflow when overallocating buffer.
9692 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9693 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9694 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9695 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9696 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9697 integers are now checked earlier. All uses replaced with XINT.
9698 (ccl_driver):
9699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9700 For CCL_MapSingle, check that content and value are in int range.
9701 (ccl_driver, Fregister_code_conversion_map):
9702 Check that Vcode_version_map_vector is a vector.
9703 (resolve_symbol_ccl_program): Check that vector header is in range.
9704 Always copy the vector, so that we can check its contents reliably
9705 now rather than having to recheck each instruction as it's being
9706 executed. Check that vector words fit in 'int'.
9707 (ccl_get_compiled_code, Fregister_ccl_program)
9708 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9709 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9710 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9711 contents are in range.
9712 (Fccl_execute_on_string): Check that status is in range.
9713 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9714 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9715 Accept and return EMACS_INT, not int, because callers can pass values
9716 out of 'int' range.
9717 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9718 (multibyte_chars_in_text, parse_str_as_multibyte)
9719 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9720 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9721 (string_escape_byte8, Fget_byte):
9722 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9723 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9724 avoid mishandling large integers.
9725 * character.h: Adjust decls to match defn changes elsewhere.
9726 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9727 (Ffind_charset_region):
9728 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9729 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9730 (load_charset_map_from_vector, Fdefine_charset_internal):
9731 Don't assume fixnum fits in int.
9732 (load_charset_map_from_vector, Fmap_charset_chars):
9733 Remove now-unnecessary CHECK_NATNUMs.
9734 (Fdefine_charset_internal): Check ranges here, more carefully.
9735 Don't rely on undefined behavior with signed left shift overflow.
9736 Don't assume unsigned int fits into fixnum, or that fixnum fits
9737 into unsigned int. Don't require max_code to be a valid fixnum;
9738 that's not true for gb10830 4-byte on a 32-bit host. Allow
9739 invalid_code to be a cons, for the same reason. Require code_offset
9740 to be a character. Avoid int overflow if max_char is close
9741 to INT_MAX.
9742 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9743 this is intended anyway and avoids some undefined behavior.
9744 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9745 INDEX_TO_CODE_POINT, as that's what it expects.
9746 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9747 * charset.h (DECODE_CHAR): Return int, not unsigned;
9748 this is what was intended anyway, and it avoids undefined behavior.
9749 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9750 integer-overflow issues.
9751 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9752 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9753 where the argument is EMACS_INT, and this behavior is not intended.
9754 * chartab.c (Fmake_char_table, Fset_char_table_range)
9755 (uniprop_get_decoder, uniprop_get_encoder):
9756 Don't assume fixnum fits in int.
9757 * cmds.c (move_point): New function, that does the gist of
9758 Fforward_char and Fbackward_char, but does so while checking
9759 for integer overflow more accurately.
9760 (Fforward_char, Fbackward_char): Use it.
9761 (Fforward_line, Fend_of_line, internal_self_insert)
9762 (internal_self_insert):
9763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9764 Fix a FIXME, by checking for integer overflow when calculating
9765 target_clm and actual_clm.
9766 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9767 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9768 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9769 (coding_alloc_by_making_gap, alloc_destination)
9770 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9771 (encode_coding_utf_16, detect_coding_emacs_mule)
9772 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9773 (detect_coding_iso_2022, decode_coding_iso_2022)
9774 (encode_invocation_designation, encode_designation_at_bol)
9775 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9776 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9777 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9778 (encode_coding_ccl, encode_coding_raw_text)
9779 (detect_coding_charset, decode_coding_charset)
9780 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9781 (produce_composition, produce_charset, produce_annotation)
9782 (decode_coding, handle_composition_annotation)
9783 (handle_charset_annotation, consume_chars, decode_coding_gap)
9784 (decode_coding_object, encode_coding_object, detect_coding_system)
9785 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9786 (code_convert_region, code_convert_string)
9787 (Fdefine_coding_system_internal)
9788 (coding_set_source, coding_set_destination):
9789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9790 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9791 (Fdefine_coding_system_internal):
9792 Don't assume fixnums fit in int.
9793 (decode_coding_gap, decode_coding_object, encode_coding_object)
9794 (Fread_coding_system, Fdetect_coding_region)
9795 (Funencodable_char_position, Fcheck_coding_systems_region)
9796 (get_translation, handle_composition_annotation, consume_chars):
9797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9798 (consume_chars): Rewrite to not calculate an address outside buffer.
9799 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9800 Don't access memory outside of the args array.
9801 (Fdefine_coding_system_internal): Check for charset-id overflow.
9802 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9803 result of ENCODE_CHAR.
9804 * coding.h: Adjust decls to match defn changes elsewhere.
9805 (struct coding_system):
9806 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9807 * composite.c (get_composition_id, find_composition)
9808 (run_composition_function, update_compositions)
9809 (compose_text, composition_gstring_put_cache)
9810 (composition_gstring_p, composition_gstring_width)
9811 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9812 (composition_compute_stop_pos, composition_reseat_it)
9813 (composition_update_it, struct position_record)
9814 (find_automatic_composition, composition_adjust_point)
9815 (Fcomposition_get_gstring, Ffind_composition_internal):
9816 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9817 (update_compositions):
9818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9819 * composite.h: Adjust decls to match defn changes elsewhere.
9820 (struct composition):
9821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9822 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9823 Do not attempt to compute the address of the object just before a
9824 buffer; this is not portable.
9825 (Faref, Faset):
9826 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9827 (Faset): Use int, not EMACS_INT, where int is wide enough.
9828 (Fstring_to_number): Don't assume fixnums fit in int.
9829 (Frem): Don't assume arg is nonnegative.
9830 * dbusbind.c (xd_append_arg): Check for integers out of range.
9831 (Fdbus_call_method): Don't overflow the timeout int.
9832 (extract_signed, extract_unsigned): New functions.
9833 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9834 (xd_get_connection_references): Return ptrdiff_t, not int.
9835 All uses changed.
9836 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9837 (xd_read_message_1):
9838 Use int, not unsigned, where the dbus API uses int.
9839 (Fdbus_message_internal): Don't overflow mtype.
9840 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9841 * dired.c (directory_files_internal, file_name_completion, scmp)
9842 (file_name_completion_stat):
9843 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9844 (file_name_completion): Don't overflow matchcount.
9845 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9846 * dispextern.h: Adjust decls to match defn changes elsewhere.
9847 (struct text_pos, struct glyph, struct bidi_saved_info)
9848 (struct bidi_string_data, struct bidi_it, struct composition_it)
9849 (struct it):
9850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9851 (struct display_pos, struct composition_it, struct it):
9852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9853 * dispnew.c (increment_matrix_positions)
9854 (increment_row_positions, mode_line_string)
9855 (marginal_area_string):
9856 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9857 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9858 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9859 (duration_to_sec_usec): New function, to check for overflow better.
9860 (Fsleep_for, sit_for): Use it.
9861 * doc.c (get_doc_string, store_function_docstring):
9862 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9863 (get_doc_string, Fsnarf_documentation):
9864 Use int, not EMACS_INT, where int is wide enough.
9865 (get_doc_string):
9866 Use SAFE_ALLOCA, not alloca.
9867 Check for overflow when converting EMACS_INT to off_t.
9868 * doprnt.c (doprnt):
9869 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9870 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9871 Don't assume uid_t fits into fixnum.
9872 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9873 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9874 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9875 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9876 (general_insert_function)
9877 (Finsert_char, make_buffer_string, make_buffer_string_both)
9878 (update_buffer_properties, Fbuffer_substring)
9879 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9880 (Fsubst_char_in_region, check_translation)
9881 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9882 (transpose_markers, Ftranspose_regions):
9883 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9884 (clip_to_bounds): Move to lisp.h as an inline function).
9885 (Fconstrain_to_field): Don't assume integers are nonnegative.
9886 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9887 (Fsubst_char_in_region, Fsave_restriction):
9888 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9889 (Femacs_pid): Don't assume pid_t fits into fixnum.
9890 (lo_time): Use int, not EMACS_INT, when int suffices.
9891 (lisp_time_argument): Check for usec out of range.
9892 (Fencode_time): Don't assume fixnum fits in int.
9893 (Fuser_login_name, Fuser_full_name): Signal an error
9894 if a uid argument is out of range, rather than relying on
9895 undefined behavior.
9896 (Fformat_time_string): Remove now-unnecessary check.
9897 lisp_time_argument checks for out-of-range usec now.
9898 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9899 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9900 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9901 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9902 (init_cmdargs, Fdump_emacs):
9903 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9904 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9905 the bottom (typically) 32 bits of the fixnum.
9906 * eval.c (specpdl_size, call_debugger):
9907 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9908 (when_entered_debugger, Fbacktrace_debug):
9909 Don't assume fixnum can fit in int.
9910 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9911 the object just before a buffer; this is not portable.
9912 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9913 (grow_specpdl, unbind_to):
9914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9915 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9916 (grow_specpdl): Simplify allocation by using xpalloc.
9917 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
9918 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9919 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9921 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9922 (a_write, e_write):
9923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9924 (Fcopy_file, non_regular_nbytes, read_non_regular)
9925 (Finsert_file_contents):
9926 Use int, not EMACS_INT, where int is wide enough.
9927 (READ_BUF_SIZE): Verify that it fits in int.
9928 (Finsert_file_contents): Check that counts are in proper range,
9929 rather than assuming fixnums fit into ptrdiff_t etc.
9930 Don't assume fixnums fit into int.
9931 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9932 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9933 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9934 (string_char_to_byte, string_byte_to_char)
9935 (string_make_multibyte, string_to_multibyte)
9936 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9937 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9938 (substring_both, Fdelete, internal_equal, Ffillarray)
9939 (Fclear_string, mapcar1)
9940 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9941 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9942 (larger_vector, make_hash_table, maybe_resize_hash_table)
9943 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9944 (Fmaphash, secure_hash):
9945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9946 (concat): Check for string index and length overflow.
9947 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9948 (Frequire):
9949 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9950 (larger_vector): New API (vec, incr_min, size_max) replaces old
9951 one (vec, new_size, init). This catches size overflow.
9952 INIT was removed because it was always Qnil.
9953 All callers changed.
9954 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9955 the upper bound on a hash table index size.
9956 (make_hash_table, maybe_resize_hash_table): Use it.
9957 (secure_hash): Computer start_byte and end_byte only after
9958 they're known to be in ptrdiff_t range.
9959 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9960 (Ffont_get_glyphs, Ffont_at):
9961 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9962 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9963 (Flist_fonts, Fopen_font):
9964 Don't assume fixnum can fit in int.
9965 (check_gstring): Don't assume index can fit in int.
9966 (font_match_p): Check that fixnum is a character, not a nonnegative
9967 fixnum, since the later code needs to stuff it into an int.
9968 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9969 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9970 conversion overflow issues.
9971 (Fopen_font): Check for integer out of range.
9972 (Ffont_get_glyphs): Don't assume index can fit in int.
9973 * font.h: Adjust decls to match defn changes elsewhere.
9974 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9975 integer overflow.
9976 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9977 printmax_t, where ptrdiff_t is wide enough.
9978 (Finternal_char_font):
9979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9980 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9981 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9982 (Fset_frame_position, x_set_frame_parameters)
9983 (x_set_line_spacing, x_set_border_width)
9984 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9985 Check that fixnums are in proper range for system types.
9986 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9987 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9988 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9989 Use SAFE_ALLOCA_LISP, not alloca.
9990 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9991 intptr_t is wide enough.
9992 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9993 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9994 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9995 Check for fixnum out of range.
9996 * ftfont.c (ftfont_list): Don't assume index fits in int.
9997 Check that fixnums are in proper range for system types.
9998 (ftfont_shape_by_flt):
9999 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10000 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10002 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
10003 Check that fixnums are in proper range for system types.
10004 * gnutls.h: Adjust decls to match defn changes elsewhere.
10005 * gtkutil.c (xg_dialog_run):
10006 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10007 (update_frame_tool_bar):
10008 Check that fixnums are in proper range for system types.
10009 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
10010 (lookup_image): Check that fixnums are in range for system types.
10011 * indent.c (last_known_column, last_known_column_point):
10012 (current_column_bol_cache):
10013 (skip_invisible, current_column, check_display_width):
10014 (check_display_width, scan_for_column, current_column_1)
10015 (Findent_to, Fcurrent_indentation, position_indentation)
10016 (indented_beyond_p, Fmove_to_column, compute_motion):
10017 (Fcompute_motion, Fvertical_motion):
10018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10019 (last_known_column_modified): Use EMACS_INT, not int.
10020 (check_display_width):
10021 (Fcompute_motion):
10022 Check that fixnums and floats are in proper range for system types.
10023 (compute_motion): Don't assume index or fixnum fits in int.
10024 (compute_motion, Fcompute_motion):
10025 Use int, not EMACS_INT, when it is wide enough.
10026 (vmotion): Omit local var start_hpos that is always 0; that way
10027 we don't need to worry about overflow in expressions involving it.
10028 * indent.h: Adjust decls to match defn changes elsewhere.
10029 (struct position):
10030 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10031 Use int, not EMACS_INT, where int is wide enough.
10032 Remove unused members ovstring_chars_done and tab_offset;
10033 all uses removed.
10034 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
10035 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
10036 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
10037 (make_gap, copy_text, insert, insert_and_inherit)
10038 (insert_before_markers, insert_before_markers_and_inherit)
10039 (insert_1, count_combining_before, count_combining_after)
10040 (insert_1_both, insert_from_string)
10041 (insert_from_string_before_markers, insert_from_string_1)
10042 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
10043 (adjust_after_replace, adjust_after_insert, replace_range)
10044 (replace_range_2, del_range, del_range_1, del_range_byte)
10045 (del_range_both, del_range_2, modify_region)
10046 (prepare_to_modify_buffer, signal_before_change)
10047 (signal_after_change, Fcombine_after_change_execute):
10048 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10049 * intervals.c (traverse_intervals, rotate_right, rotate_left)
10050 (balance_an_interval, split_interval_right, split_interval_left)
10051 (find_interval, next_interval, update_interval)
10052 (adjust_intervals_for_insertion, delete_node, delete_interval)
10053 (interval_deletion_adjustment, adjust_intervals_for_deletion)
10054 (static_offset_intervals, offset_intervals)
10055 (merge_interval_right, merge_interval_left, make_new_interval)
10056 (graft_intervals_into_buffer, temp_set_point_both)
10057 (temp_set_point, set_point, adjust_for_invis_intang)
10058 (set_point_both, move_if_not_intangible, get_property_and_range)
10059 (get_local_map, copy_intervals, copy_intervals_to_string)
10060 (compare_string_intervals, set_intervals_multibyte_1):
10061 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10062 * intervals.h: Adjust decls to match defn changes elsewhere.
10063 (struct interval):
10064 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10065 * keyboard.c (this_command_key_count, this_single_command_key_start)
10066 (before_command_key_count, before_command_echo_length, echo_now)
10067 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
10068 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
10069 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
10070 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
10071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10072 (last_non_minibuf_size, last_point_position, echo_truncate)
10073 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
10074 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
10075 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
10076 (stuff_buffered_input):
10077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10078 (last_auto_save, command_loop_1, read_char):
10079 Use EMACS_INT, not int, to avoid integer overflow.
10080 (record_char): Avoid overflow in total_keys computation.
10081 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
10082 * keyboard.h: Adjust decls to match defn changes elsewhere.
10083 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
10084 (Fkey_description, Fdescribe_vector, Flookup_key):
10085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10086 (click_position): New function, to check that positions are in range.
10087 (Fcurrent_active_maps):
10088 (describe_command):
10089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10090 (Faccessible_keymaps, Fkey_description):
10091 (preferred_sequence_p):
10092 Don't assume fixnum can fit into int.
10093 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
10094 Check for integer overflow in size calculations.
10095 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
10096 avoid mishandling large integers.
10097 * lisp.h: Adjust decls to match defn changes elsewhere.
10098 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
10099 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
10100 (struct Lisp_Marker):
10101 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10102 (clip_to_bounds): Now an inline function, moved here from editfns.c.
10103 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
10104 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
10105 All callers changed.
10106 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
10107 Assume the arg has valid form, since it always does.
10108 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
10109 unsigned integer system type.
10110 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
10111 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
10112 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10113 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
10114 (duration_to_sec_usec): New decl.
10115 * lread.c (read_from_string_index, read_from_string_index_byte)
10116 (read_from_string_limit, readchar, unreadchar, openp)
10117 (read_internal_start, read1, oblookup):
10118 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10119 (Fload, readevalloop, Feval_buffer, Feval_region):
10120 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10121 (openp): Check for out-of-range argument to 'access'.
10122 (read1): Use int, not EMACS_INT, where int is wide enough.
10123 Don't assume fixnum fits into int.
10124 Fix off-by-one error that can read outside a buffer.
10125 (read_filtered_event): Use duration_to_sec_usec
10126 to do proper overflow checking on durations.
10127 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
10128 in size calculation.
10129 (Fexecute_kbd_macro):
10130 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10131 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
10132 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
10133 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
10134 (set_marker_both, set_marker_restricted_both, marker_position)
10135 (marker_byte_position, Fbuffer_has_markers_at):
10136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10137 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
10138 * menu.c (ensure_menu_items): Rename from grow_menu_items.
10139 It now merely ensures that the menu is large enough, without
10140 necessarily growing it, as this avoids some integer overflow issues.
10141 All callers changed.
10142 (keymap_panes, parse_single_submenu, Fx_popup_menu):
10143 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10144 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
10145 Use SAFE_ALLOCA_LISP, not alloca.
10146 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
10147 to EMACS_INT. Check that fixnums are in proper range for system types.
10148 * minibuf.c (minibuf_prompt_width, string_to_object)
10149 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
10150 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
10151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10152 (get_minibuffer, read_minibuf_unwind):
10153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10154 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
10155 this simplifies overflow checking. All callers changed.
10156 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
10157 (Ftest_completion):
10158 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10159 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
10160 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
10161 Check that fixnums are in proper range for system types.
10162 (Fx_create_frame, Fx_show_tip):
10163 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10164 * nsfont.m (ns_findfonts, nsfont_list_family):
10165 Don't assume fixnum fits in long.
10166 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
10167 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10168 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
10169 wide enough.
10170 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
10171 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10172 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
10173 (PRINTDECLARE, PRINTPREPARE):
10174 (strout, print_string):
10175 (print, print_preprocess, print_check_string_charset_prop)
10176 (print_object):
10177 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10178 (PRINTDECLARE):
10179 (temp_output_buffer_setup, Fprin1_to_string, print_object):
10180 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10181 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
10182 (printchar, strout): Use xpalloc to catch size calculation overflow.
10183 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
10184 (print_error_message): Use SAFE_ALLOCA, not alloca.
10185 (print_object): Use int, not EMACS_INT, where int is wide enough.
10186 (print_depth, new_backquote_output, print_number_index):
10187 Use ptrdiff_t, not int, where int might not be wide enough.
10188 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
10189 (Fset_process_window_size, Fformat_network_address)
10190 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
10191 (sigchld_handler):
10192 Check that fixnums are in proper range for system types.
10193 (Fsignal_process): Simplify by avoiding a goto.
10194 Check for process-ids out of pid_t range rather than relying on
10195 undefined behavior.
10196 (process_tick, update_tick): Use EMACS_INT, not int.
10197 (Fformat_network_address, read_process_output, send_process)
10198 (Fprocess_send_region, status_notify):
10199 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10200 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
10201 (wait_reading_process_output, read_process_output, exec_sentinel):
10202 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10203 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
10204 (Faccept_process_output): Use duration_to_sec_usec to do proper
10205 overflow checking on durations.
10206 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
10207 Don't assume pid_t fits in int.
10208 * process.h (struct Lisp_Process): Members tick and update_tick
10209 are now of type EMACS_INT, not int.
10210 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
10211 configured --with-wide-int.
10212 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
10213 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
10214 * search.c (looking_at_1, string_match_1):
10215 (fast_string_match, fast_c_string_match_ignore_case)
10216 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
10217 (scan_newline, find_before_next_newline, search_command)
10218 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
10219 (set_search_regs, wordify):
10220 (Freplace_match):
10221 (Fmatch_data):
10222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10223 (string_match_1, search_buffer, set_search_regs):
10224 (Fmatch_data):
10225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10226 (wordify): Check for overflow in size calculation.
10227 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
10228 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
10229 Check that fixnums are in proper range for system types.
10230 * sound.c (struct sound_device)
10231 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
10232 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10233 (Fplay_sound_internal):
10234 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10235 * syntax.c (struct lisp_parse_state, find_start_modiff)
10236 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
10237 (Fparse_partial_sexp):
10238 Don't assume fixnums can fit in int.
10239 (struct lisp_parse_state, find_start_pos, find_start_value)
10240 (find_start_value_byte, find_start_begv)
10241 (update_syntax_table, char_quoted, dec_bytepos)
10242 (find_defun_start, prev_char_comend_first, back_comment):
10243 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
10244 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
10245 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10246 (Finternal_describe_syntax_value): Check that match_lisp is a
10247 character, not an integer, since the code stuffs it into int.
10248 (scan_words, scan_sexps_forward):
10249 Check that fixnums are in proper range for system types.
10250 (Fforward_word):
10251 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10252 (scan_sexps_forward):
10253 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10254 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10255 * syntax.h: Adjust decls to match defn changes elsewhere.
10256 (struct gl_state_s):
10257 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10258 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10259 MOST_POSITIVE_FIXNUM.
10260 * sysdep.c (wait_for_termination_1, wait_for_termination)
10261 (interruptible_wait_for_termination, mkdir):
10262 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10263 (emacs_read, emacs_write):
10264 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10265 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10266 and double all fit in int.
10267 * term.c (set_tty_color_mode):
10268 Check that fixnums are in proper range for system types.
10269 * termhooks.h (struct input_event):
10270 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10271 * textprop.c (validate_interval_range, interval_of)
10272 (Fadd_text_properties, set_text_properties_1)
10273 (Fremove_text_properties, Fremove_list_of_text_properties)
10274 (Ftext_property_any, Ftext_property_not_all)
10275 (copy_text_properties, text_property_list, extend_property_ranges)
10276 (verify_interval_modification):
10277 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10278 (Fnext_single_char_property_change)
10279 (Fprevious_single_char_property_change):
10280 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10281 (copy_text_properties):
10282 Check for integer overflow in index calculation.
10283 * undo.c (last_boundary_position, record_point, record_insert)
10284 (record_delete, record_marker_adjustment, record_change)
10285 (record_property_change):
10286 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10287 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10288 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10289 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10290 (Fx_hide_tip, Fx_file_dialog):
10291 * w32menu.c (set_frame_menubar):
10292 Use ptrdiff_t, not int, for consistency with rest of code.
10293 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10294 (select_window, Fdelete_other_windows_internal)
10295 (window_scroll_pixel_based, window_scroll_line_based)
10296 (Frecenter, Fset_window_configuration):
10297 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10298 (Fset_window_hscroll, run_window_configuration_change_hook)
10299 (set_window_buffer, temp_output_buffer_show, scroll_command)
10300 (Fscroll_other_window, Frecenter):
10301 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10302 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10303 Don't assume fixnum fits in int.
10304 (Fset_window_scroll_bars):
10305 Check that fixnums are in proper range for system types.
10306 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10307 (string_pos, c_string_pos, number_of_chars, init_iterator)
10308 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10309 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10310 (compute_display_string_end, handle_face_prop)
10311 (face_before_or_after_it_pos, handle_invisible_prop)
10312 (handle_display_prop, handle_display_spec, handle_single_display_spec)
10313 (display_prop_intangible_p, string_buffer_position_lim)
10314 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10315 (get_overlay_strings_1, get_overlay_strings)
10316 (iterate_out_of_display_property, forward_to_next_line_start)
10317 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10318 (get_next_display_element, set_iterator_to_next)
10319 (get_visually_first_element, compute_stop_pos_backwards)
10320 (handle_stop_backwards, next_element_from_buffer)
10321 (move_it_in_display_line_to, move_it_in_display_line)
10322 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10323 (add_to_log, message_dolog, message_log_check_duplicate)
10324 (message2, message2_nolog, message3, message3_nolog
10325 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10326 (current_message_1, truncate_echo_area, truncate_message_1)
10327 (set_message, set_message_1, store_mode_line_noprop)
10328 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10329 (text_outside_line_unchanged_p, check_point_in_composition)
10330 (reconsider_clip_changes)
10331 (redisplay_internal, set_cursor_from_row, try_scrolling)
10332 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10333 (redisplay_window, find_last_unchanged_at_beg_row)
10334 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10335 (trailing_whitespace_p, find_row_edges, display_line)
10336 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10337 (display_mode_element, store_mode_line_string)
10338 (pint2str, pint2hrstr, decode_mode_spec)
10339 (display_count_lines, display_string, draw_glyphs)
10340 (x_produce_glyphs, x_insert_glyphs)
10341 (rows_from_pos_range, mouse_face_from_buffer_pos)
10342 (fast_find_string_pos, mouse_face_from_string_pos)
10343 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10344 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10345 (safe_call, init_from_display_pos, handle_fontified_prop)
10346 (handle_single_display_spec, load_overlay_strings)
10347 (with_echo_area_buffer, setup_echo_area_for_printing)
10348 (display_echo_area, echo_area_display)
10349 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10350 (update_tool_bar, hscroll_window_tree, redisplay_internal)
10351 (redisplay_window, dump_glyph_row, display_mode_line)
10352 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
10353 (handle_display_spec, display_prop_string_p):
10354 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10355 (handle_single_display_spec, build_desired_tool_bar_string)
10356 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10357 (get_specified_cursor_type):
10358 Check that fixnums are in proper range for system types.
10359 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10360 (Flookup_image_map):
10361 Don't assume fixnums fit in int.
10362 (compare_overlay_entries):
10363 Avoid mishandling comparisons due to subtraction overflow.
10364 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10365 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10366 (handle_tool_bar_click):
10367 Use int, not unsigned, since we prefer signed and the signedness
10368 doesn't matter here.
10369 (get_next_display_element, next_element_from_display_vector):
10370 Use int, not EMACS_INT, when int is wide enough.
10371 (start_hourglass): Use duration_to_sec_usec to do proper
10372 overflow checking on durations.
10373 * xfaces.c (Fbitmap_spec_p):
10374 Check that fixnums are in proper range for system types.
10375 (compare_fonts_by_sort_order):
10376 Avoid mishandling comparisons due to subtraction overflow.
10377 (Fx_family_fonts, realize_basic_faces):
10378 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10379 (Fx_family_fonts):
10380 Don't assume fixnum fits in int.
10381 Use SAFE_ALLOCA_LISP, not alloca.
10382 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10383 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10384 (face_at_buffer_position, face_for_overlay_string)
10385 (face_at_string_position):
10386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10387 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10388 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10389 (Fx_show_tip):
10390 Check that fixnums are in proper range for system types.
10391 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10392 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10393 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10394 (Fx_change_window_property): Don't assume fixnums fit in int.
10395 * xfont.c (xfont_chars_supported):
10396 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10397 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10398 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10399 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10400 * xml.c (parse_region):
10401 * xrdb.c (magic_file_p):
10402 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10403 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10404 (x_get_local_selection, x_reply_selection_request)
10405 (x_handle_selection_request, wait_for_property_change):
10406 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10407 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10408 short is wide enough.
10409 (x_send_client_event): Don't assume fixnum fits in int.
10410 * xterm.c (x_x_to_emacs_modifiers):
10411 Don't assume EMACS_INT overflows nicely into int.
10412 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10413 may come from Lisp.
10414 (handle_one_xevent): NATNUMP can eval its arg twice.
10415 (x_connection_closed):
10416 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10417 * xterm.h: Adjust decls to match defn changes elsewhere.
10418 (struct scroll_bar): Use struct vectorlike_header
10419 rather than rolling our own approximation.
10420 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10421
10422 2012-05-25 Glenn Morris <rgm@gnu.org>
10423
10424 * lisp.mk (lisp): Update for more files being compiled now.
10425
10426 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10427
10428 * lread.c: Remove `read_pure' which makes no difference.
10429 (read_pure): Remove var.
10430 (unreadpure): Remove function.
10431 (readevalloop): Don't call read_list with -1 flag.
10432 (read1, read_vector): Don't test read_pure any more.
10433 (read_list): Simplify.
10434
10435 * fileio.c, character.h: Minor style tweaks.
10436
10437 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10438
10439 * window.h (clip_changed): Remove useless declaration.
10440
10441 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
10442
10443 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10444 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10445
10446 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10447
10448 Remove src/m/*.
10449 This directory predates autoconf and is no longer needed nowadays.
10450 Move its few remaining bits of functionality to where they're needed.
10451 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10452 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10453 * m/template.h: Remove.
10454 * Makefile.in (M_FILE): Remove. All uses removed.
10455 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10456 * lisp.h (USE_LSB_TAG):
10457 * mem-limits.h (EXCEEDS_LISP_PTR):
10458 Use VAL_MAX, not VALBITS, in #if.
10459 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10460 (EMACS_UINT): Define unconditionally now.
10461 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10462 (BITS_PER_EMACS_INT): New constants, replacing
10463 what used to be in config.h, but not useful in #if.
10464 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10465 define them any more.
10466 (VAL_MAX): New macro.
10467 (VALMASK): Use it.
10468 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10469 BITS_PER_EMACS_INT, in #if.
10470 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10471 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10472 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10473 * s/ms-w32.h (DATA_START):
10474 Move here from removed file m/intel386.h.
10475 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10476 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10477
10478 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10479
10480 Assume C89 or later.
10481 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10482 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10483 (xrealloc):
10484 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10485 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10486 * textprop.c, tparam.c (NULL): Remove.
10487 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10488 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10489 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10490 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10491 * xterm.c (input_signal_count): Assume volatile works.
10492
10493 2012-05-21 Ken Brown <kbrown@cornell.edu>
10494
10495 * xgselect.c (xg_select): Fix first argument in call to 'select'
10496 (bug#11508).
10497
10498 2012-05-20 Ken Brown <kbrown@cornell.edu>
10499
10500 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
10501 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
10502
10503 2012-05-19 Ken Brown <kbrown@cornell.edu>
10504
10505 * xfns.c (x_in_use): Remove `static' qualifier.
10506 * xterm.h (x_in_use): Declare.
10507 * xgselect.c: Include xterm.h.
10508 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10509 and `display_arg' (bug#9754).
10510
10511 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10512
10513 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10514
10515 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10516 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10517
10518 2012-05-18 Eli Zaretskii <eliz@gnu.org>
10519
10520 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10521
10522 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10523 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10524
10525 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10526 reference to image_cache->refcount.
10527 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10528
10529 2012-05-17 Juri Linkov <juri@jurta.org>
10530
10531 * search.c (Fword_search_regexp, Fword_search_backward)
10532 (Fword_search_forward, Fword_search_backward_lax)
10533 (Fword_search_forward_lax): Move functions to isearch.el
10534 (bug#10145, bug#11381).
10535
10536 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10537
10538 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10539
10540 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10541
10542 * lread.c (init_obarray): Declare Qt and Qnil as special.
10543
10544 2012-05-14 Glenn Morris <rgm@gnu.org>
10545
10546 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10547 Put "libexec" before "bin", for the sake of init_callproc_1.
10548
10549 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10550
10551 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10552
10553 * unexaix.c: Port to more-recent AIX compilers.
10554 (report_error, report_error_1, make_hdr, copy_sym)
10555 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10556 Make arguments const char *, not char *, to avoid violations of C
10557 standard and to fix some AIX warnings reported by Gilles Pion.
10558
10559 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10560
10561 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10562 already have overlays loaded.
10563 (handle_single_display_spec): Before returning without displaying
10564 fringe bitmap, synchronize the bidi iterator with the main display
10565 iterator, by calling iterate_out_of_display_property.
10566 (iterate_out_of_display_property): Detect buffer iteration by
10567 testing that it->string is a Lisp string.
10568 (get_next_display_element): When the current object is exhausted,
10569 and there's something on it->stack, call set_iterator_to_next to
10570 proceed with what's on the stack, instead of returning zero.
10571 (set_iterator_to_next): If called at the end of a Lisp string,
10572 proceed to consider_string_end without incrementing string
10573 position. Don't increment display vector index past the end of
10574 the display vector. (Bug#11417)
10575 (pos_visible_p): Don't report a position visible when move_it_to
10576 stopped at the last line of window, which happens to be scanned
10577 backwards by the bidi iteration. (Bug#11464)
10578
10579 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10580
10581 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10582 and right-margin display specs even if the spec is invalid or we
10583 are on a TTY, and thus unable to display on the fringes.
10584 That's because the text with the property will not be displayed anyway,
10585 so we need to signal to the caller that this is a "replacing"
10586 display spec. This fixes display when the spec is invalid or we
10587 are on a TTY.
10588
10589 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10590
10591 * unexaix.c (make_hdr): Fix typo in prototype.
10592 This bug broke the build on AIX. Problem reported by Gilles Pion.
10593
10594 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
10595
10596 * keyboard.c (kbd_buffer_get_event): Read special events also in
10597 batch mode. (Bug#11415)
10598
10599 2012-05-12 Glenn Morris <rgm@gnu.org>
10600
10601 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10602
10603 2012-05-12 Eli Zaretskii <eliz@gnu.org>
10604
10605 * lisp.mk (lisp): Add newcomment.elc.
10606
10607 2012-05-12 Glenn Morris <rgm@gnu.org>
10608
10609 * Makefile.in (MKDIR_P): New, set by configure.
10610 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10611
10612 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10613
10614 Remove unused function hourglass_started.
10615 * dispextern.h (hourglass_started):
10616 * w32fns.c (hourglass_started):
10617 * xdisp.c (hourglass_started): Remove.
10618
10619 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
10620
10621 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10622 Update dependencies.
10623
10624 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10625
10626 * xgselect.c (xg_select): Put maxfds+1 into a var.
10627 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10628
10629 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10630
10631 2012-05-10 Dave Abrahams <dave@boostpro.com>
10632
10633 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10634 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10635
10636 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10637
10638 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10639 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10640 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10641 Initialize xd_registered_buses.
10642
10643 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10644
10645 Untag more efficiently if USE_LSB_TAG.
10646 This is based on a proposal by YAMAMOTO Mitsuharu in
10647 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10648 For an admittedly artificial (nth 8000 longlist) benchmark on
10649 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10650 Emacs's overall text size by 1%.
10651 * lisp.h (XUNTAG): New macro.
10652 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10653 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10654 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10655 * eval.c (Fautoload):
10656 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10657 * frame.h (XFRAME): Use XUNTAG.
10658
10659 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10660 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10661 Remove unportable assumptions about print widths of types like
10662 dbus_uint32_t.
10663 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10664 intptr_t when converting between pointer and integer, to avoid GCC
10665 warnings about wrong width.
10666
10667 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10668
10669 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10670 stack for each reader_thread, instead of defaulting to 8MB
10671 determined by the linker. This avoids failures in creating
10672 subprocesses on Windows 7, see the discussion in this thread:
10673 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10674
10675 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10676
10677 Fix up display of the *Minibuf-0* buffer in the mini window.
10678 * keyboard.c (read_char): Don't clear the echo area if there's no
10679 message to clear.
10680 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10681 contents of *Minibuf-0*) if there's no message displayed in its stead.
10682
10683 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10684
10685 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10686 batch mode.
10687
10688 2012-05-06 Chong Yidong <cyd@gnu.org>
10689
10690 * lisp.mk (lisp): Update.
10691
10692 2012-05-05 Jim Meyering <meyering@redhat.com>
10693
10694 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10695
10696 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10697
10698 * data.c (PUT_ERROR): New macro.
10699 (syms_of_data): Use it. Add new error type `user-error'.
10700 * undo.c (user_error): New function.
10701 (Fprimitive_undo): Use it.
10702 * print.c (print_error_message): Adjust print style for `user-error'.
10703 * keyboard.c (user_error): New function.
10704 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10705
10706 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10707
10708 Do not limit current-time-string to years 1000..9999.
10709 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10710 (Fcurrent_time_string): Support any year that is supported by the
10711 underlying localtime representation. Don't use asctime, as it
10712 has undefined behavior for years outside the range -999..9999.
10713
10714 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10715
10716 Fix race conditions involving setenv, gmtime, localtime, asctime.
10717 Without this fix, interrupts could mess up code that uses these
10718 nonreentrant functions, since setting TZ invalidates existing
10719 tm_zone or tzname values, and since most of these functions return
10720 pointers to static storage.
10721 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10722 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10723 Grow the critical sections to include not just invoking
10724 localtime/gmtime, but also accessing these functions' results
10725 including their tm_zone values if any, and any related TZ setting.
10726 (format_time_string): Last arg is now struct tm *, not struct tm **,
10727 so that the struct tm is saved in the critical section.
10728 All callers changed. Simplify allocation of initial buffer, partly
10729 motivated by the fact that memory allocation needs to be outside
10730 the critical section.
10731
10732 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10733
10734 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10735 with RESET_INTERVAL.
10736
10737 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10738 Remove duplicated buffer name initialization.
10739
10740 2012-05-02 Jim Meyering <jim@meyering.net>
10741
10742 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10743
10744 * xfns.c (x_window): Use xstrdup (Bug#11375).
10745
10746 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10747
10748 * xdisp.c (pos_visible_p): If already at a newline from the
10749 display string before the 'while' loop, don't walk back the glyphs
10750 from it3.glyph_row. Solves assertion violation when the display
10751 string begins with a newline (egg.el). (Bug#11367)
10752
10753 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10754
10755 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10756 Move to simple.el.
10757
10758 2012-05-01 Glenn Morris <rgm@gnu.org>
10759
10760 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10761 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10762 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10763 All were removed before 23.1.
10764
10765 * dispnew.c: Remove HAVE_LIBNCURSES test;
10766 it is always true on relevant platforms.
10767
10768 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10769 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10770
10771 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10772
10773 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10774
10775 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10776 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10777 Remove.
10778
10779 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10780
10781 Do not avoid creating empty evaporating overlays (Bug#9642).
10782 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10783 That is, do not delete an evaporating overlay if it becomes
10784 empty after its bounds are adjusted to fit within its buffer.
10785 This fix caused other problems, and I'm reverting it until we get
10786 to the bottom of them.
10787
10788 2012-04-27 Chong Yidong <cyd@gnu.org>
10789
10790 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10791
10792 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10793
10794 * xdisp.c (pos_visible_p): If the window start position is beyond
10795 ZV, start the display from buffer beginning. Prevents assertion
10796 violation in init_iterator when the minibuffer window is scrolled
10797 via the scroll bar.
10798
10799 * window.c (window_scroll_pixel_based): Likewise.
10800
10801 2012-04-27 Chong Yidong <cyd@gnu.org>
10802
10803 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10804
10805 2012-04-27 Glenn Morris <rgm@gnu.org>
10806
10807 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10808 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10809
10810 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10811
10812 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10813 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10814
10815 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10816
10817 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10818 display element, check also the underlying string or buffer
10819 character. (Bug#11341)
10820
10821 * w32menu.c: Include w32heap.h.
10822 (add_menu_item): If the call to AppendMenuW (via
10823 unicode_append_menu) fails, disable Unicode menus only if we are
10824 running on Windows 9X/Me.
10825
10826 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10827
10828 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10829 (xgetint): Add missing shift for LSB tags.
10830
10831 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10832
10833 * keyboard.c (read_char): Don't wipe echo area for select window
10834 events: These might get delayed via `mouse-autoselect-window'
10835 (Bug#11304).
10836
10837 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10838
10839 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10840 manipulation of :loaded-from data.
10841
10842 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10843
10844 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10845 now a cons (bug#11311).
10846
10847 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10848
10849 Do not create empty overlays with the evaporate property (Bug#9642).
10850 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10851 if it becomes empty after its bounds are adjusted to fit within
10852 its buffer. Without this fix, in a nonempty buffer (let ((o
10853 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10854 yields an empty overlay that has the evaporate property, which is
10855 not supposed to happen.
10856
10857 Fix minor GTK3 problems found by static checking.
10858 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10859 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10860 (struct _EmacsFixedClass, emacs_fixed_get_type):
10861 Move decls here from emacsgtkfixed.h, since they needn't be public.
10862 (emacs_fixed_get_type): Now static.
10863 (emacs_fixed_class_init): Omit unused local.
10864 (emacs_fixed_child_type): Remove; unused.
10865 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10866 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10867 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10868 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10869 (EMACS_FIXED_GET_CLASS): Remove; unused.
10870 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10871
10872 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10873 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10874
10875 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10876
10877 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10878 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10879 (__malloc_size_t, __malloc_ptrdiff_t):
10880 Remove. All uses removed, replaced by the definiens if needed,
10881 since we can assume C89 or better now.
10882 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10883 (protect_malloc_state, align, get_contiguous_space)
10884 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10885 (malloc_atfork_handler_child, malloc_enable_thread)
10886 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10887 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10888 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10889 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10890 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10891 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10892 Define using prototypes, not old style.
10893 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10894 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10895 (align): Don't assume that signed integer overflow wraps around.
10896 Omit unused local var.
10897 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10898 (_free_internal_nolock, memalign, mallochook, reallochook):
10899 Omit no-longer-needed casts.
10900 (valloc): Use getpagesize, not __getpagesize.
10901 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10902 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10903
10904 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10905
10906 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10907
10908 Move functions from C to Lisp. Make non-blocking method calls
10909 the default. Implement further D-Bus standard interfaces.
10910
10911 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10912 (QCdbus_request_name_allow_replacement)
10913 (QCdbus_request_name_replace_existing)
10914 (QCdbus_request_name_do_not_queue)
10915 (QCdbus_request_name_reply_primary_owner)
10916 (QCdbus_request_name_reply_in_queue)
10917 (QCdbus_request_name_reply_exists)
10918 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10919 (QCdbus_registered_serial, QCdbus_registered_method)
10920 (QCdbus_registered_signal): New Lisp objects.
10921 (XD_DEBUG_MESSAGE): Use sizeof.
10922 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10923 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10924 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10925 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10926 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10927 (xd_signature, xd_append_arg): Allow float for integer types.
10928 (xd_get_connection_references): New function.
10929 (xd_get_connection_address): Rename from xd_initialize.
10930 Return cached address.
10931 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10932 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10933 level.
10934 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
10935 Return number of refcounts.
10936 (Fdbus_get_unique_name): Make stronger parameter check.
10937 (Fdbus_message_internal): New defun.
10938 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10939 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10940 (Fdbus_send_signal, Fdbus_register_service)
10941 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10942 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10943 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10944 (Vdbus_compiled_version, Vdbus_runtime_version)
10945 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10946 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10947 (Vdbus_message_type_signal): New defvars.
10948 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10949 Adapt docstring.
10950
10951 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10952
10953 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10954 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10955 Do not assume ptrdiff_t is the same width as 'int'.
10956
10957 * alloc.c: Handle unusual debugging option combinations.
10958 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10959 since the two debugging options are incompatible.
10960 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10961 is defined.
10962 (mem_init, mem_insert, mem_insert_fixup):
10963 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10964 (NEED_MEM_INSERT): Remove; no longer needed.
10965
10966 2012-04-22 Leo Liu <sdl.web@gmail.com>
10967
10968 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10969
10970 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10971
10972 * sysdep.c [__FreeBSD__]: Minor cleanups.
10973 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10974 Use Emacs indenting style more consistently. Avoid some casts.
10975 Use 'double' consistently rather than mixing 'float' and 'double'.
10976
10977 2012-04-21 Eduard Wiebe <usenet@pusto.de>
10978
10979 * sysdep.c (list_system_processes, system_process_attributes):
10980 Add implementation for FreeBSD (Bug#5243).
10981
10982 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10983
10984 * lisp.mk (lisp): Update.
10985
10986 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10987
10988 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10989 It is never used otherwise.
10990
10991 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10992
10993 * print.c (print_preprocess): Only check print_depth if print-circle
10994 is nil.
10995 (print_object): Check for cycles even when print-circle is nil and
10996 print-gensym is t, but only check print_depth if print-circle is nil.
10997
10998 2012-04-20 Chong Yidong <cyd@gnu.org>
10999
11000 * process.c (wait_reading_process_output): If EIO occurs on a pty,
11001 set the status to "failed" and ensure that sentinel is run.
11002
11003 2012-04-20 Glenn Morris <rgm@gnu.org>
11004
11005 * process.c (Fset_process_inherit_coding_system_flag)
11006 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
11007 (Fmake_network_process, Fmake_serial_process): Doc fix.
11008
11009 2012-04-20 Eli Zaretskii <eliz@gnu.org>
11010
11011 * xdisp.c (string_buffer_position_lim): Limit starting position to
11012 BEGV.
11013 (set_cursor_from_row): If called for a mode-line or header-line
11014 row, return zero immediately.
11015 (try_cursor_movement): If inside continuation line, don't back up
11016 farther than the first row after the header line, if any.
11017 Don't consider the header-line row as "partially visible", even if
11018 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
11019
11020 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
11021
11022 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
11023 (bug#11238).
11024
11025 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
11026 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
11027
11028 configure: new option --enable-gcc-warnings (Bug#11207)
11029 * Makefile.in (C_WARNINGS_SWITCH): Remove.
11030 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
11031 (ALL_CFLAGS): Use new macros rather than old.
11032 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
11033 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
11034 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
11035 -Wunused-result, -Wunused-variable. This should go away once
11036 the Emacs and Gnulib regex code is merged.
11037 (xmalloc, xrealloc): Now static.
11038
11039 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
11040
11041 * dired.c (Fsystem_groups): Remove unused local.
11042
11043 2012-04-17 Glenn Morris <rgm@gnu.org>
11044
11045 * dired.c (Fsystem_users): Doc fix.
11046
11047 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
11048
11049 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
11050 (syms_of_dired): Add them.
11051
11052 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
11053
11054 Fix minor alloc.c problems found by static checking.
11055 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
11056 New extern decls, to avoid calling undeclared functions.
11057 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
11058 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
11059 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
11060 (NEED_MEM_INSERT): New macro.
11061 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
11062 Remove one incorrect comment and fix another.
11063
11064 Fix minor ralloc.c problems found by static checking.
11065 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11066 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
11067 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
11068 (r_alloc_sbrk): Now static.
11069
11070 Improve ralloc.c interface checking.
11071 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11072 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
11073 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
11074 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
11075 [REL_ALLOC]: ... to here, to check interface.
11076 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
11077 Remove decls. This fixes an "It stinks!".
11078
11079 * alloc.c (which_symbols): Fix alignment issue / type clash.
11080
11081 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
11082
11083 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
11084 (struct Lisp_Misc_Any): Likewise.
11085 (struct Lisp_Free): Likewise.
11086 * alloc.c (union aligned_Lisp_Symbol): Define.
11087 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
11088 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
11089 (union aligned_Lisp_Misc): Define.
11090 (MARKER_BLOCK_SIZE, struct marker_block): Use union
11091 aligned_Lisp_Misc instead of union Lisp_Misc.
11092 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
11093
11094 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
11095
11096 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
11097 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
11098 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
11099 * s/netbsd.h, s/sol2-6.h:
11100 Remove definition of GC_MARK_STACK, since the default now works.
11101 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
11102 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
11103 no longer the default.
11104 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
11105
11106 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
11107
11108 * lread.c (lisp_file_lexically_bound_p):
11109 Fix hang at ";-*-\n" (bug#11238).
11110
11111 2012-04-14 Eli Zaretskii <eliz@gnu.org>
11112
11113 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
11114 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
11115
11116 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
11117
11118 * nsterm.m (constrainFrameRect): Always constrain when there is only
11119 one screen (Bug#10962).
11120
11121 2012-04-13 Ken Brown <kbrown@cornell.edu>
11122
11123 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
11124
11125 2012-04-13 Reuben Thomas <rrt@sc3d.org>
11126
11127 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
11128
11129 2012-04-11 Daniel Colascione <dancol@dancol.org>
11130
11131 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
11132 against is gone. It's better to use vfork now so that when Cygwin
11133 gains a new, working vfork, we use it automatically (bug#10398).
11134
11135 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11136
11137 * window.c (save_window_save): Obey window-point-insertion-type.
11138
11139 2012-04-11 Glenn Morris <rgm@gnu.org>
11140
11141 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
11142
11143 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11144
11145 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
11146
11147 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
11148
11149 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
11150 (force_quit_count): New var.
11151 (handle_interrupt): Use it.
11152
11153 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
11154
11155 * w32.c (w32_delayed_load): Record the full path of the library
11156 being loaded (bug#10424).
11157
11158 2012-04-09 Glenn Morris <rgm@gnu.org>
11159
11160 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
11161 not just in the obarray, before snarfing them. (Bug#11036)
11162
11163 * Makefile.in ($(leimdir)/leim-list.el):
11164 Pass EMACS rather than BUILT_EMACS.
11165
11166 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
11167
11168 * process.c (make_process):
11169 * process.h: Add integer `gnutls_handshakes_tried' member to
11170 process struct.
11171
11172 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
11173 Add convenience `GNUTLS_LOG2i' macro.
11174
11175 * gnutls.c (gnutls_log_function2i): Convenience log function.
11176 (emacs_gnutls_read): Use new log functions,
11177 `gnutls_handshakes_tried' process member, and
11178 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
11179 attempts per process (connection).
11180
11181 2012-04-09 Chong Yidong <cyd@gnu.org>
11182
11183 * eval.c (Fuser_variable_p, user_variable_p_eh)
11184 (lisp_indirect_variable): Functions deleted.
11185 (Fdefvar): Caller changed.
11186
11187 * callint.c (Finteractive, Fcall_interactively):
11188 * minibuf.c (Fread_variable): Callers changed.
11189
11190 2012-04-09 Eli Zaretskii <eliz@gnu.org>
11191
11192 * xdisp.c (set_cursor_from_row): If the display string appears in
11193 the buffer at position that is closer to point than the position
11194 after the display string, display the cursor on the first glyph of
11195 the display string. Fixes cursor display when a 'display' text
11196 property immediately follows invisible text. (Bug#11094)
11197
11198 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
11199
11200 composite.c: use 'double' consistently
11201 * composite.c (get_composition_id): Use 'double' consistently
11202 instead of converting 'float' to 'double' and vice versa; this is
11203 easier to understand and avoids a GCC warning.
11204
11205 2012-04-09 Glenn Morris <rgm@gnu.org>
11206
11207 * Makefile.in: Generate leim-list with bootstrap-emacs, in
11208 preparation for dumping it with emacs. (Bug#4789)
11209 (leimdir): New variable.
11210 ($(leimdir)/leim-list.el): New rule.
11211 (emacs$(EXEEXT)): Depend on leim-list.el.
11212
11213 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
11214 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
11215 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
11216
11217 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
11218
11219 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
11220 proper alignment.
11221
11222 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
11223
11224 * xml.c (init_libxml2_functions) [WINDOWSNT]:
11225 Remove unused local variable.
11226
11227 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11228
11229 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
11230 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
11231 (mark_memory): Mark Lisp_Objects only if pointers might hide in
11232 objects, as mark_maybe_pointer will catch them otherwise.
11233 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
11234 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
11235
11236 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11237
11238 Fix typo that broke non-Windows builds.
11239 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
11240
11241 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11242
11243 Support building on MS-Windows with libxml2.
11244
11245 * makefile.w32-in (OBJ2): Add xml.$(O).
11246 (GLOBAL_SOURCES): Add xml.c.
11247 ($(BLD)/xml.$(O)): New dependency list.
11248
11249 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11250 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11251 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11252 [!WINDOWSNT]: New macros.
11253 (init_libxml2_functions, libxml2_loaded_p): New functions.
11254 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11255 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11256 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11257 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11258 linked in).
11259 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11260 Call init_libxml2_functions before calling libxml2 functions.
11261 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11262
11263 * emacs.c: Don't include libxml/parser.h.
11264 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11265 xmlCleanupParser directly.
11266
11267 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11268
11269 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11270
11271 * indent.c (Fvertical_motion): If there is a display string at
11272 point, use it.vpos to compute how many lines to backtrack after
11273 move_it_to point. (Bug#11133)
11274
11275 2012-04-06 Eli Zaretskii <eliz@gnu.org>
11276
11277 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11278 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11279 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11280 macros related to unification of CJK characters. For the details,
11281 see the discussion following the message here:
11282 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
11283
11284 2012-04-04 Chong Yidong <cyd@gnu.org>
11285
11286 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11287
11288 2012-04-01 Eli Zaretskii <eliz@gnu.org>
11289
11290 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11291 instead of alloca. (Bug#11138)
11292
11293 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11294
11295 * w32menu.c (is_simple_dialog): Properly check lisp types.
11296 (Bug#11141)
11297
11298 2012-03-31 Eli Zaretskii <eliz@gnu.org>
11299
11300 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11301 position we get to after a call to move_it_to fails the
11302 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11303 only if we wind up in a string from display property. (Bug#11063)
11304
11305 * window.c (Fdelete_other_windows_internal): Invalidate the row
11306 and column information about mouse highlight, so that redisplay
11307 restores it after reallocating the glyph matrices. (Bug#7464)
11308
11309 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11310 string comes from a `display' text property, use the buffer
11311 position of that property as if we actually saw that position in
11312 the row's glyphs.
11313 (move_it_by_lines): Remove the assertion that
11314 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11315 violated when there's a before-string at the beginning of a line.
11316 (Bug#11063)
11317
11318 2012-03-30 Eli Zaretskii <eliz@gnu.org>
11319
11320 * xdisp.c (append_space_for_newline): If the default face was
11321 remapped, use the remapped face for the appended newline.
11322 (extend_face_to_end_of_line): Use the remapped default face for
11323 extending the face to the end of the line.
11324 (display_line): Call extend_face_to_end_of_line when the default
11325 face was remapped. (Bug#11068)
11326
11327 2012-03-29 Eli Zaretskii <eliz@gnu.org>
11328
11329 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11330
11331 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11332
11333 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11334
11335 2012-03-27 Glenn Morris <rgm@gnu.org>
11336
11337 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11338 Doc fixes.
11339
11340 2012-03-26 Kenichi Handa <handa@m17n.org>
11341
11342 * dispextern.h (struct glyph): Fix previous change. Change the
11343 bit length of glyphless.ch to 25 (Bug#11082).
11344
11345 2012-03-26 Chong Yidong <cyd@gnu.org>
11346
11347 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11348 (command_loop_1): Use it; inhibit selection update for
11349 handle-select-window too (Bug#8996).
11350
11351 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11352
11353 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
11354
11355 2012-03-25 Kenichi Handa <handa@m17n.org>
11356
11357 * dispextern.h (struct glyph): Change the bit length of
11358 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11359
11360 2012-03-24 Eli Zaretskii <eliz@gnu.org>
11361
11362 * s/ms-w32.h (tzname): Include time.h before redirecting to
11363 _tzname. Fixes the MSVC build. (Bug#9960)
11364
11365 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11366
11367 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11368 characters.
11369
11370 * xterm.c (XTread_socket): Only modify handling_signal if
11371 !SYNC_INPUT. (Bug#11080)
11372
11373 2012-03-23 Eli Zaretskii <eliz@gnu.org>
11374
11375 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11376 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11377 when fetching a multibyte character consumes more bytes than
11378 CHAR_BYTES returns, due to unification of CJK characters in
11379 string_char. (Bug#11073)
11380
11381 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11382
11383 * process.c (wait_reading_process_output): Handle pty disconnect
11384 by refraining from sending oneself a SIGCHLD (bug#10933).
11385
11386 2012-03-22 Chong Yidong <cyd@gnu.org>
11387
11388 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11389
11390 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
11391 Mark string as coming from a prefix property.
11392 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11393 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11394
11395 2012-03-21 Chong Yidong <cyd@gnu.org>
11396
11397 * xfaces.c (Vface_remapping_alist): Doc fix.
11398
11399 2012-03-20 Eli Zaretskii <eliz@gnu.org>
11400
11401 * w32proc.c (Fw32_set_console_codepage)
11402 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11403 Doc fixes.
11404
11405 2012-03-20 Chong Yidong <cyd@gnu.org>
11406
11407 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11408 to reflect default non-nil value of redisplay-dont-pause.
11409
11410 2012-03-19 Kenichi Handa <handa@m17n.org>
11411
11412 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11413 it fit in a valid range (Bug#11003).
11414
11415 2012-03-18 Eli Zaretskii <eliz@gnu.org>
11416
11417 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11418 that is not from display property, accept the row as a "cursor
11419 row" if one of the string's character has a non-nil `cursor'
11420 property. Fixes cursor positioning when there are newlines in
11421 overlay strings, e.g. in icomplete.el. (Bug#11035)
11422
11423 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11424
11425 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11426
11427 2012-03-12 Chong Yidong <cyd@gnu.org>
11428
11429 * eval.c (inhibit_lisp_code): Rename from
11430 inhibit_window_configuration_change_hook; move from window.c.
11431
11432 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11433 * window.c (run_window_configuration_change_hook)
11434 (syms_of_window): Callers changed.
11435
11436 2012-03-11 Chong Yidong <cyd@gnu.org>
11437
11438 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11439
11440 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11441
11442 2012-03-10 Chong Yidong <cyd@gnu.org>
11443
11444 * frame.c (other_visible_frames): Don't assume the selected frame
11445 is visible (Bug#10955).
11446
11447 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11448
11449 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11450
11451 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11452
11453 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11454 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11455 zero (Bug#10954).
11456
11457 2012-03-03 Glenn Morris <rgm@gnu.org>
11458
11459 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
11460
11461 2012-03-02 Eli Zaretskii <eliz@gnu.org>
11462
11463 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11464 position past the first glyph_row that ends at ZV. (Bug#10902)
11465 (redisplay_window, next_element_from_string): Fix typos in
11466 comments.
11467 (redisplay_window): Pass to move_it_vertically the margin in
11468 pixels, not in screen lines.
11469
11470 2012-03-02 Glenn Morris <rgm@gnu.org>
11471
11472 * buffer.c (buffer-list-update-hook): Doc fix.
11473
11474 2012-02-29 Eli Zaretskii <eliz@gnu.org>
11475
11476 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11477 push_it before setting up the iterator for the first overlay
11478 string, even if we have an empty string loaded.
11479 (next_overlay_string): If there's an empty string on the iterator
11480 stack, pop the stack. (Bug#10903)
11481
11482 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11483
11484 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11485 Suggested by Stefan Monnier in
11486 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11487 * alloc.c (widen_to_Lisp_Object): New static function.
11488 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11489 and widening them to Lisp_Objects. This would work even if
11490 USE_LSB_TAG is defined and wide integers are used, which might
11491 happen in a future version of Emacs.
11492
11493 2012-02-25 Chong Yidong <cyd@gnu.org>
11494
11495 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11496 Doc fix.
11497
11498 * xselect.c (Fx_selection_exists_p): Doc fix.
11499 (x_clipboard_manager_save_all): Print an informative message
11500 before saving to clipboard manager.
11501
11502 2012-02-24 Chong Yidong <cyd@gnu.org>
11503
11504 * keyboard.c (process_special_events): Handle all X selection
11505 requests in kbd_buffer, not just the next one (Bug#8869).
11506
11507 2012-02-23 Chong Yidong <cyd@gnu.org>
11508
11509 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11510 call when setting menu-bar-lines and tool-bar-lines parameters.
11511 (unwind_create_frame_1): New helper function.
11512
11513 * window.c (inhibit_window_configuration_change_hook): New var.
11514 (run_window_configuration_change_hook): Obey it.
11515 (syms_of_window): Initialize it.
11516
11517 2012-02-22 Chong Yidong <cyd@gnu.org>
11518
11519 * xterm.c (x_draw_image_relief): Add missing type check for
11520 Vtool_bar_button_margin (Bug#10743).
11521
11522 2012-02-21 Chong Yidong <cyd@gnu.org>
11523
11524 * fileio.c (Vfile_name_handler_alist): Doc fix.
11525
11526 * buffer.c (Fget_file_buffer): Protect against invalid file
11527 handler return value.
11528
11529 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11530
11531 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11532 when computing $valmask.
11533
11534 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11535 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11536 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11537 It's useless in that case, and it can cause problems on hosts
11538 that allocate halves of EMACS_INT values separately.
11539 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11540 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11541 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11542 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11543 it avoids undefined behavior on hosts where shifting right by more
11544 than the word width has undefined behavior.
11545
11546 2012-02-19 Chong Yidong <cyd@gnu.org>
11547
11548 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11549 (Funhandled_file_name_directory, Ffile_name_as_directory)
11550 (Fdirectory_file_name, Fexpand_file_name)
11551 (Fsubstitute_in_file_name): Protect against invalid file handler
11552 return values (Bug#10845).
11553
11554 2012-02-18 Eli Zaretskii <eliz@gnu.org>
11555
11556 * .gdbinit (pitx): Fix incorrect references to fields of the
11557 iterator stack.
11558
11559 2012-02-17 Chong Yidong <cyd@gnu.org>
11560
11561 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11562
11563 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11564
11565 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11566 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11567
11568 2012-02-15 Chong Yidong <cyd@gnu.org>
11569
11570 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11571 marked as special. Also, starting docstrings with * is obsolete.
11572
11573 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11574
11575 * gnutls.c (emacs_gnutls_write): Fix last change.
11576
11577 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11578
11579 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11580 send_process.
11581
11582 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11583
11584 * keymap.c (Fsingle_key_description): Handle char ranges.
11585
11586 2012-02-12 Chong Yidong <cyd@gnu.org>
11587
11588 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11589 as that creates a dangerous corner case.
11590
11591 * window.c (Fdelete_window_internal): Invalidate the mouse
11592 highlight (Bug#9904).
11593
11594 2012-02-12 Glenn Morris <rgm@gnu.org>
11595
11596 * xselect.c (Fx_own_selection_internal)
11597 (Fx_get_selection_internal, Fx_disown_selection_internal)
11598 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11599 * nsselect.m (Fx_own_selection_internal)
11600 (Fx_disown_selection_internal, Fx_selection_exists_p)
11601 (Fx_selection_owner_p, Fx_get_selection_internal):
11602 Sync docs and argument specs with the xselect.c versions.
11603
11604 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11605
11606 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11607
11608 2012-02-11 Eli Zaretskii <eliz@gnu.org>
11609
11610 * w32select.c (Fx_selection_exists_p): Sync doc string and
11611 argument list with xselect.c. (Bug#10783)
11612
11613 * w16select.c (Fx_selection_exists_p): Sync doc string and
11614 argument list with xselect.c. (Bug#10783)
11615
11616 2012-02-10 Glenn Morris <rgm@gnu.org>
11617
11618 * fns.c (Fsecure_hash): Doc fix.
11619
11620 2012-02-09 Kenichi Handa <handa@m17n.org>
11621
11622 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11623
11624 2012-02-07 Chong Yidong <cyd@gnu.org>
11625
11626 * buffer.c (Fbuffer_local_variables)
11627 (buffer_lisp_local_variables): Handle unbound vars correctly;
11628 don't let Qunbound leak into Lisp.
11629
11630 2012-02-07 Glenn Morris <rgm@gnu.org>
11631
11632 * image.c (Fimagemagick_types): Doc fix.
11633
11634 * image.c (imagemagick-render-type): Change it from a lisp object
11635 to an integer. Move the doc here from the lisp manual.
11636 Treat all values not equal to 0 the same.
11637
11638 2012-02-06 Chong Yidong <cyd@gnu.org>
11639
11640 * doc.c (store_function_docstring): Avoid applying docstring of
11641 alias to base function (Bug#2603).
11642
11643 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11644
11645 * .gdbinit (pp1, pv1): Remove redundant defines.
11646 (pr): Use pp.
11647
11648 2012-02-04 Chong Yidong <cyd@gnu.org>
11649
11650 * nsterm.m: Declare a global (Bug#10694).
11651
11652 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11653
11654 * w32.c (get_emacs_configuration_options):
11655 Include --enable-checking, if specified, in the return value.
11656
11657 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11658
11659 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11660 after rounding frame sizes. (Bug#9723)
11661
11662 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11663
11664 * keyboard.c (adjust_point_for_property): Don't position point
11665 before BEGV. (Bug#10696)
11666
11667 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11668
11669 Handle overflow when computing char display width (Bug#9496).
11670 * character.c (char_width): Return EMACS_INT, not int.
11671 (char_width, c_string_width): Check for overflow when
11672 computing the width; this is possible now that individual
11673 characters can have unbounded width. Problem introduced
11674 by merge from Emacs 23 on 2012-01-19.
11675
11676 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11677
11678 * dbusbind.c (Fdbus_register_method): Mention the return value
11679 :ignore in the docstring.
11680
11681 2012-02-02 Glenn Morris <rgm@gnu.org>
11682
11683 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11684
11685 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11686 Unconditionally set to t. (Bug#10673)
11687 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11688 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11689 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11690
11691 2012-02-02 Kenichi Handa <handa@m17n.org>
11692
11693 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11694 0, do not call append_composite_glyph.
11695
11696 2012-02-02 Kenichi Handa <handa@m17n.org>
11697
11698 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11699 NULL (Bug#6988).
11700 (x_produce_glyphs): If the component of a composition is a null
11701 string, set it->pixel_width to 1 to avoid zero-width glyph.
11702
11703 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11704
11705 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11706 first 2 arguments are identical. This makes inserting large
11707 output from a subprocess an order of magnitude faster on
11708 MS-Windows, where all sbrk'ed memory is always contiguous.
11709
11710 2012-01-31 Glenn Morris <rgm@gnu.org>
11711
11712 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11713 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11714 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11715
11716 2012-01-29 Glenn Morris <rgm@gnu.org>
11717
11718 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11719
11720 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11721
11722 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11723
11724 2012-01-28 Chong Yidong <cyd@gnu.org>
11725
11726 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11727
11728 2012-01-26 Chong Yidong <cyd@gnu.org>
11729
11730 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11731
11732 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11733 repeat counts (Bug#10507).
11734
11735 2012-01-26 Glenn Morris <rgm@gnu.org>
11736
11737 * lread.c (syms_of_lread): Doc fix.
11738
11739 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11740
11741 * coding.c (encode_designation_at_bol): Change return value to
11742 EMACS_INT.
11743
11744 2012-01-25 Chong Yidong <cyd@gnu.org>
11745
11746 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11747
11748 2012-01-21 Chong Yidong <cyd@gnu.org>
11749
11750 * floatfns.c (Fcopysign): Make the second argument non-optional,
11751 since nil is not allowed anyway.
11752
11753 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11754
11755 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11756 (send_process): Likewise.
11757
11758 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11759
11760 * window.c (save_window_save, Fcurrent_window_configuration)
11761 (Vwindow_persistent_parameters): Do not use Qstate.
11762 Rewrite doc-strings.
11763
11764 2012-01-19 Kenichi Handa <handa@m17n.org>
11765
11766 * character.c (char_width): New function.
11767 (Fchar_width, c_string_width, lisp_string_width):
11768 Use char_width (Bug#9496).
11769
11770 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11771
11772 * window.c (Vwindow_persistent_parameters): New variable.
11773 (Fset_window_configuration, save_window_save): Handle persistent
11774 window parameters.
11775
11776 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11777
11778 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11779 thrashing the stack of the thread. (Bug#9087)
11780
11781 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11782
11783 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11784
11785 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11786
11787 * xdisp.c (rows_from_pos_range): Handle the case where the
11788 highlight ends on a newline. (Bug#10464)
11789 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11790 he end column for display of highlight that ends on a newline
11791 before a R2L line.
11792
11793 2012-01-11 Glenn Morris <rgm@gnu.org>
11794
11795 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11796 from load-path also when installation-directory is nil. (Bug#10208)
11797
11798 2012-01-10 Glenn Morris <rgm@gnu.org>
11799
11800 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11801
11802 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11803 Update template values to be closer to their typical values these days.
11804
11805 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11806
11807 * xdisp.c (rows_from_pos_range): Accept additional argument
11808 DISP_STRING, and accept any glyph in a row whose object is that
11809 string as eligible for mouse highlight. Fixes mouse highlight of
11810 display strings from overlays. (Bug#10464)
11811
11812 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11813
11814 emacs: fix an auto-save permissions race condition (Bug#10400)
11815 * fileio.c (auto_saving_dir_umask): New static var.
11816 (Fmake_directory_internal): Use it.
11817 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11818 creating the directory. The old code temporarily assigns
11819 too-generous permissions to the directory.
11820 (do_auto_save_eh): Clear it.
11821 (Fdo_auto_save): Catch all errors, not just file errors, so
11822 that the var is always cleared.
11823
11824 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11825
11826 * search.c (scan_buffer): Pass character positions to
11827 know_region_cache, not byte positions. (Bug#6540)
11828
11829 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11830
11831 * w32.c (sys_rename): Report EXDEV when rename of a directory
11832 fails because the target is on another logical disk. (Bug#10284)
11833
11834 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11835
11836 * xterm.c (x_embed_request_focus): New function.
11837
11838 * xterm.h: Add prototype.
11839
11840 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11841
11842 2012-01-05 Glenn Morris <rgm@gnu.org>
11843
11844 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11845
11846 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11847
11848 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11849 Load gnutls_transport_set_lowat only if GnuTLS version is below
11850 2.11.1.
11851 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11852 GnuTLS versions below 2.11.1.
11853
11854 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11855
11856 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11857 to the doc string advising against its use for altering the way
11858 windows are scrolled.
11859
11860 2011-12-28 Kenichi Handa <handa@m17n.org>
11861
11862 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11863 coding-system ASCII compatible only when it does not produce BOM
11864 on encoding (Bug#10383).
11865
11866 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11867
11868 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11869 can scroll.
11870 (create_and_show_popup_menu): Always use menu_position_func for
11871 Gtk3 (Bug#10361).
11872
11873 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11874
11875 * callint.c (Fcall_interactively): Don't truncate prompt string.
11876
11877 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11878
11879 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11880 property that ends at ZV, so that the bidi iteration could be
11881 resumed from there (after widening). (Bug#10360)
11882
11883 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11884
11885 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11886
11887 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11888
11889 * nsterm.m (x_free_frame_resources):
11890 Release f->output_data.ns->miniimage.
11891 (ns_index_color): Fix indentation. Do not retain
11892 color_table->colors[i].
11893
11894 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11895 before returning.
11896
11897 * nsfns.m (x_set_background_color): Assign return value from
11898 ns_index_color to face-background instead of NSColor*.
11899 (ns_implicitly_set_icon_type): Fix indentation.
11900 Change assignment in for loop to comparison.
11901
11902 * emacs.c (ns_pool): New variable.
11903 (main): Assign ns_pool.
11904 (Fkill_emacs): Call ns_release_autorelease_pool.
11905
11906 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11907 autorelease fdesc, release fdAttrs and tdict.
11908 (ns_get_covering_families): Release charset.
11909 (ns_findfonts): Release NSFontDescriptor created with new.
11910 (ns_uni_to_glyphs): Fix indentation.
11911 (setString): Release attrStr before assigning new value.
11912
11913 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11914
11915 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11916 and NS_IMPL_COCOA.
11917 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11918 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11919
11920 2011-12-18 David Reitter <reitter@cmu.edu>
11921
11922 * nsterm.m (ns_term_init): Subscribe for notifications
11923 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11924 to method trackingNotification in EmacsMenu.
11925
11926 * nsmenu.m (trackingMenu): New variable.
11927 (trackingNotification): New method (from Aquamacs).
11928 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11929 from Aquamacs (Bug#7030).
11930
11931 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11932
11933 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11934 (symbol_to_nsstring): Fix indentation.
11935 (ns_symbol_to_pb): New function.
11936 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11937 (Fns_rotate_cut_buffers_internal): Remove.
11938 (Fns_store_selection_internal): Rename from
11939 Fns_store_cut_buffer_internal.
11940 (ns_get_foreign_selection, Fx_own_selection_internal)
11941 (Fx_disown_selection_internal, Fx_selection_exists_p)
11942 (Fns_get_selection_internal, Fns_store_selection_internal):
11943 Use ns_symbol_to_pb and check if return value is nil.
11944 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11945 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
11946 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11947 renamed to Sns_store_selection_internal.
11948 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11949 and remove this function.
11950 (ns_handle_selection_clear): Remove, never used.
11951 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11952 here.
11953
11954 2011-12-17 Ken Brown <kbrown@cornell.edu>
11955
11956 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11957 GID is unknown (Bug#10257).
11958
11959 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11960
11961 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11962 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11963 which caused a build failure on GNU/Linux IA-64. This problem was
11964 introduced by my 2011-10-07 patch.
11965
11966 2011-12-15 Juri Linkov <juri@jurta.org>
11967
11968 * image.c (imagemagick_error): New function. (Bug#10112)
11969 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11970 Use `imagemagick_error' where ImageMagick functions return
11971 `MagickFalse'.
11972 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11973 proper order.
11974
11975 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11976
11977 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11978 fill background (Bug#8992).
11979
11980 2011-12-13 Martin Rudalics <rudalics@gmx.at>
11981
11982 * window.c (Vwindow_combination_resize)
11983 (Vwindow_combination_limit): Use t instead of non-nil in
11984 doc-strings.
11985 (Vrecenter_redisplay): Add first sentence of doc-string on
11986 separate line.
11987 (Frecenter): Fix doc-string typo.
11988
11989 2011-12-11 Kenichi Handa <handa@m17n.org>
11990
11991 * coding.c (Funencodable_char_position): Pay attention to the
11992 buffer text relocation (Bug#9389).
11993
11994 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11995
11996 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11997 gtk_init (Bug#10100).
11998
11999 2011-12-10 Eli Zaretskii <eliz@gnu.org>
12000
12001 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
12002 IT->string is nil. (Bug#10263)
12003
12004 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12005
12006 * nsterm.h (x_free_frame_resources): Declare.
12007
12008 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
12009 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
12010
12011 * nsterm.h (ns_get_defaults_value): Declare.
12012
12013 * nsterm.m (ns_default): Call ns_get_defaults_value.
12014
12015 2011-12-09 Eli Zaretskii <eliz@gnu.org>
12016
12017 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
12018 (Bug#10170)
12019
12020 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12021
12022 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
12023 that where the value of an _OBJC_* symbol points to is in the .bss
12024 section (Bug#10240).
12025
12026 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12027
12028 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
12029 after the loop to call ccl_driver at least once (Bug#8619).
12030
12031 2011-12-08 Kenichi Handa <handa@m17n.org>
12032
12033 * ftfont.c (get_adstyle_property): Fix previous change
12034 (Bug#10233).
12035
12036 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
12037
12038 * w32.c (init_environment): If no_site_lisp, remove site-lisp
12039 dirs from the default value of EMACSLOADPATH (bug#10208).
12040
12041 2011-12-07 Glenn Morris <rgm@gnu.org>
12042
12043 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
12044 installation and source directories as well. (Bug#10208)
12045
12046 2011-12-06 Chong Yidong <cyd@gnu.org>
12047
12048 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
12049
12050 2011-12-06 Glenn Morris <rgm@gnu.org>
12051
12052 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
12053 as an error, not just -1. (Bug#10217)
12054
12055 2011-12-05 Chong Yidong <cyd@gnu.org>
12056
12057 * keyboard.c (process_special_events): New function.
12058 (swallow_events, Finput_pending_p): Use it (Bug#10195).
12059
12060 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
12061
12062 * coding.c (encode_designation_at_bol): Don't use uninitialized
12063 local variable (Bug#9318).
12064
12065 2011-12-05 Kenichi Handa <handa@m17n.org>
12066
12067 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
12068 return Qnil (Bug#8046, Bug#10193).
12069
12070 2011-12-05 Kenichi Handa <handa@m17n.org>
12071
12072 * coding.c (encode_designation_at_bol): New args charbuf_end and
12073 dst. Return the number of produced bytes. Callers changed.
12074 (coding_set_source): Return how many bytes coding->source was
12075 relocated.
12076 (coding_set_destination): Return how many bytes
12077 coding->destination was relocated.
12078 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
12079 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
12080
12081 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12082
12083 * coding.c (CODING_CHAR_CHARSET_P): New macro.
12084 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
12085 macro (Bug#9318).
12086
12087 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
12088
12089 The following changes are to fix Bug#9318.
12090
12091 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
12092 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
12093 (encode_coding_iso_2022, encode_coding_sjis)
12094 (encode_coding_big5, encode_coding_charset): Use the above macros.
12095
12096 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
12097
12098 * lisp.h (process_quit_flag): Fix external declaration.
12099
12100 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
12101
12102 Don't macro-inline non-performance-critical code.
12103 * eval.c (process_quit_flag): New function.
12104 * lisp.h (QUIT): Use it.
12105
12106 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
12107
12108 * nsfns.m (get_geometry_from_preferences): New function.
12109 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
12110
12111 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
12112
12113 * emacs.c (Qkill_emacs): Define.
12114 (syms_of_emacs): Initialize it.
12115 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
12116 Qquit_flag to `kill-emacs' instead.
12117 (quit_throw_to_read_char): Add parameter `from_signal'.
12118 All callers changed. Call Fkill_emacs if requested and safe.
12119 * lisp.h (QUIT): Call Fkill_emacs if requested.
12120
12121 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
12122
12123 * widget.c (update_wm_hints): Return if wmshell is null.
12124 (widget_update_wm_size_hints): New function.
12125
12126 * widget.h (widget_update_wm_size_hints): Declare.
12127
12128 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
12129 widget_update_wm_size_hints (Bug#10104).
12130
12131 2011-12-03 Eli Zaretskii <eliz@gnu.org>
12132
12133 * xdisp.c (handle_invisible_prop): If the invisible text ends just
12134 before a newline, prepare the bidi iterator for consuming the
12135 newline, and keep the current paragraph direction. (Bug#10183)
12136 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
12137
12138 2011-12-02 Juri Linkov <juri@jurta.org>
12139
12140 * search.c (Fword_search_regexp): New Lisp function created from
12141 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
12142 (Fword_search_backward, Fword_search_forward)
12143 (Fword_search_backward_lax, Fword_search_forward_lax):
12144 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
12145 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
12146
12147 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
12148
12149 * fileio.c (Finsert_file_contents): Move after-change-function call
12150 to before the "handled:" label, since all "goto handled" appear in
12151 cases where the *-change-functions have already been properly called
12152 (bug#10117).
12153
12154 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
12155
12156 * keyboard.c (interrupt_signal): Don't call kill-emacs when
12157 waiting for input. (Bug#10169)
12158
12159 2011-11-30 Eli Zaretskii <eliz@gnu.org>
12160
12161 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
12162 verifies glyph row's hash code--we have just reallocated the
12163 glyphs, so their contents can be complete garbage. (Bug#10164)
12164
12165 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
12166
12167 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
12168
12169 2011-11-30 Eli Zaretskii <eliz@gnu.org>
12170
12171 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
12172 attributes are tested _before_ calling verify_row_hash, to protect
12173 against GCC re-ordering of the tests. (Bug#10164)
12174
12175 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
12176
12177 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
12178
12179 * xterm.c (handle_one_xevent): Only set async_visible and friends
12180 if net_wm_state_hidden_seen is non-zero (Bug#10002)
12181 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
12182 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
12183
12184 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
12185
12186 Remove GCPRO-related macros that exist only to avoid shadowing locals.
12187 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
12188 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
12189 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12190 All uses changed to use GCPRO1 etc.
12191 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
12192 Revert to old implementation (i.e., before 2011-03-11).
12193
12194 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12195
12196 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
12197 of scroll runs so as to avoid assigning disabled bogus rows and
12198 unnecessary graphics copy operations.
12199
12200 2011-11-27 Eli Zaretskii <eliz@gnu.org>
12201
12202 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
12203 (snprintf) [_MSC_VER]: Redirect to _snprintf.
12204 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
12205 (malloc, free, realloc, calloc): Redirect to e_* only when
12206 compiling Emacs.
12207
12208 * lisp.h (GCTYPEBITS): Move before first use.
12209 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
12210 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
12211 this macro definition.
12212
12213 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
12214 _MSC_VER.
12215
12216 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
12217
12218 * gtkutil.c (xg_create_frame_widgets):
12219 Call gtk_window_set_has_resize_grip (FALSE) if that function is
12220 present with Gtk+ 2.0.
12221
12222 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12223
12224 * fileio.c (Finsert_file_contents): Undo previous change; see
12225 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12226
12227 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12228
12229 Rename locals to avoid shadowing.
12230 * fileio.c (Finsert_file_contents):
12231 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
12232 * process.c (wait_reading_process_output):
12233 Rename inner 'proc' to 'p' to avoid shadowing.
12234 Indent for consistency with usual Emacs style.
12235
12236 2011-11-25 Eli Zaretskii <eliz@gnu.org>
12237
12238 * xdisp.c (redisplay_window): If cursor row is not fully visible
12239 after recentering, and scroll-conservatively is set to a large
12240 number, scroll window by a few more lines to make the cursor fully
12241 visible and out of scroll-margin. (Bug#10105)
12242 (start_display): Don't move to the next line if the display should
12243 start at a newline that is part of a display vector or an overlay
12244 string. (Bug#10119)
12245
12246 2011-11-24 Juri Linkov <juri@jurta.org>
12247
12248 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12249 after the `MagickPingImage' call. (Bug#10112)
12250
12251 2011-11-23 Chong Yidong <cyd@gnu.org>
12252
12253 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12254
12255 2011-11-23 Martin Rudalics <rudalics@gmx.at>
12256
12257 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12258 making another buffer current. (Bug#10114)
12259
12260 2011-11-23 Glenn Morris <rgm@gnu.org>
12261
12262 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12263
12264 2011-11-23 Chong Yidong <cyd@gnu.org>
12265
12266 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12267 using it (Bug#5984).
12268
12269 2011-11-22 Eli Zaretskii <eliz@gnu.org>
12270
12271 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12272 and header-lines, as they don't have one computed for them.
12273 (Bug#10098)
12274
12275 * .gdbinit (prow): Make displayed values more self-explaining.
12276 Add row's hash code.
12277
12278 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12279
12280 * process.c (wait_reading_process_output): Fix asynchrounous
12281 GnuTLS socket handling on some versions of the GnuTLS library.
12282 (wait_reading_process_output): Add comment and URL.
12283
12284 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12285
12286 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12287
12288 2011-11-21 Chong Yidong <cyd@gnu.org>
12289
12290 * window.c (Fnext_window, Fprevious_window): Doc fix.
12291
12292 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12293
12294 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12295
12296 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12297
12298 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12299
12300 2011-11-20 Martin Rudalics <rudalics@gmx.at>
12301
12302 * window.c (Fset_window_combination_limit): Rename argument
12303 STATUS to LIMIT.
12304 (Vwindow_combination_limit): Remove "status" from doc-string.
12305
12306 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12307
12308 * m/ibms390.h: Remove.
12309 * m/ibms390x.h: Don't include "ibms390.h".
12310
12311 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12312
12313 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12314 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12315
12316 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12317
12318 * casetab.c (Fset_case_table):
12319 * charset.c (Fcharset_after): Fix typos.
12320
12321 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
12322
12323 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12324 Otherwise, valgrind does not work on some platforms.
12325 Problem reported by Andreas Schwab in
12326 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12327 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12328 is set, removing the need for VIRT_ADDRESS_VARIES.
12329 (PURE_P): Use a more-efficient implementation that needs just one
12330 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12331 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12332 to 4 (xorl, subq, cmpq, setbe).
12333 * alloc.c (pure): Always extern now, since that's the
12334 VIRT_ADDR_VARIES behavior.
12335 (PURE_POINTER_P): Use a single comparison, not two, for
12336 consistency with the new puresize.h.
12337 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12338 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12339 Remove VIRT_ADDR_VARIES no longer needed.
12340
12341 2011-11-19 Eli Zaretskii <eliz@gnu.org>
12342
12343 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12344 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12345 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12346 behave as if the cursor position were at the window margin.
12347
12348 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12349 and the cursor position is out of bounds, behave as if the cursor
12350 position were at the window margin. (Bug#10075)
12351
12352 2011-11-18 Chong Yidong <cyd@gnu.org>
12353
12354 * window.c (Fwindow_combination_limit): Make first argument
12355 non-optional, since it is meaningless for live windows like the
12356 selected window.
12357
12358 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12359
12360 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12361
12362 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12363
12364 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12365 (graft_intervals_into_buffer): Simplify.
12366
12367 2011-11-18 Eli Zaretskii <eliz@gnu.org>
12368
12369 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12370 hash values of the two rows.
12371 (copy_row_except_pointers): Preserve the used[] arrays and the
12372 hash values of the two rows. (Bug#10035)
12373 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
12374
12375 * xdisp.c (row_hash): New function, body extracted from
12376 compute_line_metrics.
12377 (compute_line_metrics): Call row_hash, instead of computing the
12378 hash code inline.
12379
12380 * dispnew.c (verify_row_hash): Call row_hash for computing the
12381 hash code of a row, instead of duplicating code from xdisp.c.
12382
12383 * dispextern.h (row_hash): Add prototype.
12384
12385 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12386
12387 * frame.c (delete_frame): Don't delete the terminal when the last
12388 X frame is closed if emacs is built with GTK toolkit.
12389
12390 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
12391
12392 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12393
12394 2011-11-17 Martin Rudalics <rudalics@gmx.at>
12395
12396 * window.c (Vwindow_splits): Rename to
12397 Vwindow_combination_resize. Suggested by Juri Linkov.
12398 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12399 of Vwindow_splits.
12400
12401 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
12402
12403 * nsfns.m (Fns_font_name):
12404 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
12405
12406 2011-11-16 Martin Rudalics <rudalics@gmx.at>
12407
12408 * window.h (window): Rename slot "nest" to "combination_limit".
12409 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12410 (Fset_window_nest): Rename to Fset_window_combination_limit.
12411 (Vwindow_nest): Rename to Vwindow_combination_limit.
12412 (recombine_windows, make_parent_window, make_window)
12413 (Fsplit_window_internal, saved_window)
12414 (Fset_window_configuration, save_window_save): Rename all
12415 occurrences of window_nest to window_combination_limit.
12416
12417 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
12418
12419 * image.c (imagemagick_load_image): Fix typo.
12420
12421 2011-11-14 Eli Zaretskii <eliz@gnu.org>
12422
12423 * xdisp.c (display_line): Move the call to
12424 highlight_trailing_whitespace before the call to
12425 compute_line_metrics, since the latter needs to see the final
12426 faces of all the glyphs to compute ROW's hash value.
12427 Fixes assertion violations in row_equal_p. (Bug#10035)
12428
12429 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
12430
12431 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12432 just return (bug#10044).
12433
12434 2011-11-12 Eli Zaretskii <eliz@gnu.org>
12435
12436 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12437 with user-defined heap size. Bump the default size of the temacs
12438 heap to 27MB, to avoid memory warning when running temacs.
12439 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12440
12441 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12442 current_matrix and desired_matrix. (Bug#9990)
12443 (verify_row_hash) [XASSERTS]: New function.
12444 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12445 that the hash value of glyph rows is correct.
12446
12447 2011-11-12 Martin Rudalics <rudalics@gmx.at>
12448
12449 * window.h (window): Remove splits slot.
12450 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12451 (Fdelete_other_windows_internal, make_parent_window)
12452 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12453 (Fset_window_configuration, save_window_save): Don't deal with
12454 split status of windows.
12455 (saved_window): Remove splits slot.
12456 (Vwindow_splits): Rewrite doc-string.
12457
12458 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12459
12460 * xfns.c (unwind_create_frame):
12461 * nsfns.m (unwind_create_frame):
12462 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12463 Vframe_list (Bug#9999).
12464
12465 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12466
12467 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
12468
12469 2011-11-11 Kenichi Handa <handa@m17n.org>
12470
12471 * callproc.c (Fcall_process): Set the member dst_multibyte of
12472 process_coding.
12473
12474 2011-11-11 Johan Bockgård <bojohan@gnu.org>
12475
12476 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12477 avoid a crash (bug#9496).
12478
12479 2011-11-09 Chong Yidong <cyd@gnu.org>
12480
12481 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12482 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12483
12484 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12485
12486 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12487
12488 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12489
12490 Avoid some portability problems by eschewing 'extern inline' functions.
12491 The trivial performance wins aren't worth the portability hassles; see
12492 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12493 et seq.
12494 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12495 (window_box_width, window_box_left, window_box_left_offset)
12496 (window_box_right, window_box_right_offset): Undo previous change,
12497 by removing the "extern"s.
12498 * intervals.c (adjust_intervals_for_insertion)
12499 (adjust_intervals_for_deletion): Undo previous change,
12500 making these static again.
12501 (offset_intervals, temp_set_point_both, temp_set_point)
12502 (copy_intervals_to_string): No longer inline.
12503 * xdisp.c (window_text_bottom_y, window_box_width)
12504 (window_box_height, window_box_left_offset)
12505 (window_box_right_offset, window_box_left, window_box_right)
12506 (window_box): No longer inline.
12507
12508 2011-11-08 Chong Yidong <cyd@gnu.org>
12509
12510 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12511 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12512 Signal an error if not a live window.
12513 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12514 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12515
12516 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
12517
12518 * lisp.h (syms_of_abbrev): Remove declaration.
12519 Reported by CHENG Gao <chenggao@royau.me>.
12520
12521 2011-11-07 Eli Zaretskii <eliz@gnu.org>
12522
12523 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12524 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12525 of temacs in GUI mode.
12526
12527 2011-11-07 Martin Rudalics <rudalics@gmx.at>
12528
12529 * window.h: Declare delete_all_child_windows instead of
12530 delete_all_subwindows.
12531 * window.c (Fwindow_nest, Fset_window_nest)
12532 (Fset_window_new_total, Fset_window_new_normal)
12533 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12534 (delete_all_subwindows): Rename to delete_all_child_windows.
12535 (Fdelete_other_windows_internal, Fset_window_configuration):
12536 Call delete_all_child_windows instead of delete_all_subwindows.
12537 * frame.c (delete_frame): Call delete_all_child_windows instead
12538 of delete_all_subwindows.
12539
12540 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12541
12542 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12543 This is also needed for porting to any host where GC_MARK_STACK is
12544 not GC_MAKE_GCPROS_NOOPS.
12545 (which_symbols): Use it.
12546
12547 2011-11-07 Kenichi Handa <handa@m17n.org>
12548
12549 * coding.c (coding_set_destination): Check coding->src_pos only
12550 when coding->src_object is a buffer (bug#9910).
12551
12552 * process.c (send_process): Set the member src_multibyte of coding
12553 to 0 (bug#9911) when sending a unibyte text.
12554
12555 * callproc.c (Fcall_process): Set the member src_multibyte of
12556 process_coding to 0 (bug#9912).
12557
12558 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12559
12560 * xmenu.c (cleanup_widget_value_tree): New function.
12561 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12562 calling free_menubar_widget_value_tree directly (Bug#9830).
12563
12564 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12565
12566 Fix some portability problems with 'inline'.
12567 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12568 (window_box_width, window_box_left, window_box_left_offset)
12569 (window_box_right, window_box_right_offset): Declare extern.
12570 Otherwise, these inline functions do not conform to C99 and
12571 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12572 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12573 * intervals.c (adjust_intervals_for_insertion)
12574 (adjust_intervals_for_deletion): Now extern, because otherwise the
12575 extern inline functions 'offset_intervals' couldn't refer to it.
12576 (static_offset_intervals): Remove.
12577 (offset_intervals): Rewrite using the old contents of
12578 static_offset_intervals. The old version didn't conform to C99
12579 because an extern inline function contained a reference to an
12580 identifier with static linkage.
12581
12582 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12583
12584 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12585 GC.
12586
12587 2011-11-06 Eli Zaretskii <eliz@gnu.org>
12588
12589 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12590 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12591 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12592 return Qleft_to_right.
12593
12594 2011-11-06 Chong Yidong <cyd@gnu.org>
12595
12596 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12597 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12598 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12599 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12600 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12601 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12602 (Fwindow_vscroll): Doc fix.
12603 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12604 argument, since it makes no sense to pass a live window and for
12605 consistency with window-child.
12606
12607 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12608
12609 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12610 support MSVC.
12611
12612 2011-11-05 Jason Rumney <jasonr@gnu.org>
12613
12614 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12615 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12616 fonts (Bug#6029).
12617 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12618 bitwise arithmetic preventing use of unicode-sip and non-truetype
12619 opentype fonts.
12620
12621 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12622
12623 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12624 "emacs"-only part.
12625
12626 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12627 initialization code to keep similarity to xfns.c after changes
12628 from 2011-11-05.
12629
12630 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12631
12632 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12633 (unwind_create_frame): New function (Bug#9943).
12634 (Fx_create_frame): Restructure code to be more similar to the one in
12635 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12636 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12637 Move terminal->reference_count++ just before making the frame official
12638 (Bug#9943).
12639
12640 * nsterm.m (x_free_frame_resources): New function.
12641 (x_destroy_window): Move code to x_free_frame_resources.
12642
12643 * xfns.c (unwind_create_frame): Fix comment.
12644 (Fx_create_frame, x_create_tip_frame):
12645 Move terminal->reference_count++ just before making the frame
12646 official. Move initialization of image_cache_refcount and
12647 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12648
12649 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12650
12651 Support MSVC build with newer versions of Visual Studio.
12652 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12653 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12654 nt/gmake.defs.
12655
12656 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12657 which are not supported by MSVC.
12658 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12659 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12660 bitfields.
12661 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12662 types in bitfields.
12663 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12664
12665 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12666
12667 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12668
12669 Support MSVC build with newer versions of Visual Studio.
12670 * w32.c: Don't include w32api.h for MSVC.
12671 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12672
12673 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12674 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12675 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12676 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12677 e_* cousins.
12678 (alloca) [_MSC_VER]: Define to _alloca.
12679
12680 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12681
12682 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12683
12684 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12685
12686 * xdisp.c (note_mouse_highlight): If either of
12687 previous/next-single-property-change returns nil, treat that as
12688 the beginning or the end of the buffer. (Bug#9955)
12689
12690 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12691
12692 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12693 label is not null (Bug#9951).
12694 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12695 may be NULL.
12696
12697 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12698
12699 * window.c (Fwindow_body_size): Mention in the doc string that the
12700 return value is in frame's canonical units. (Bug#9949)
12701
12702 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12703
12704 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12705
12706 * w32fns.c (unwind_create_frame): If needed, free the glyph
12707 matrices of the partially constructed frame. (Bug#9943)
12708 * xfns.c (unwind_create_frame): Likewise.
12709
12710 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12711
12712 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12713 Don't stop backward scan on the continuation glyph, even though
12714 its CHARPOS is positive.
12715 (mouse_face_from_buffer_pos, note_mouse_highlight):
12716 Rename cover_string to disp_string.
12717
12718 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12719
12720 * window.c (temp_output_buffer_show): Don't use
12721 Vtemp_buffer_show_specifiers.
12722 (Vtemp_buffer_show_specifiers): Remove unused variable.
12723
12724 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12725
12726 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12727 past the beginning of the current glyph matrix.
12728
12729 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12730
12731 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12732 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12733 HAVE_GTK3 (Bug#9869).
12734
12735 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12736 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12737
12738 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12739
12740 * xterm.c: Declare x_handle_net_wm_state to return int.
12741 (handle_one_xevent): Check if we are iconified but don't have
12742 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12743 (get_current_wm_state): Return non-zero if not hidden,
12744 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12745 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12746 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12747 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12748
12749 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12750
12751 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12752 so that this new function doesn't get optimized away by a
12753 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12754
12755 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12756
12757 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12758
12759 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12760
12761 Fix the `xbytecode' command.
12762 * .gdbinit (xprintbytestr): New command.
12763 (xwhichsymbols): Rename from `which'; all callers changed.
12764 (xbytecode): Print the byte-code string as well.
12765
12766 2011-10-29 Kim Storm <storm@cua.dk>
12767
12768 * alloc.c (which_symbols): New function.
12769
12770 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12771
12772 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12773 line. (Bug#9903)
12774
12775 2011-10-29 Glenn Morris <rgm@gnu.org>
12776
12777 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12778 Not clear what it was for, and it causes various bugs. (Bug#9839)
12779
12780 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12781
12782 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12783 possible random value that matches one of those tested as
12784 condition to clear the mouse face.
12785
12786 2011-10-28 Chong Yidong <cyd@gnu.org>
12787
12788 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12789
12790 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12791
12792 * window.c (make_window): Initialize phys_cursor_on_p.
12793
12794 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12795
12796 * lisp.h (struct Lisp_Symbol): Update comments.
12797
12798 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12799
12800 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12801
12802 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12803
12804 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12805 <oslsachem@gmail.com> for helping to debug this.
12806
12807 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12808 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12809 (g_b_init_get_glyph_outline_w): New static variables.
12810 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12811 (GetGlyphOutlineW_Proc): New typedefs.
12812 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12813 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12814 New functions.
12815 (w32font_open_internal, compute_metrics):
12816 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12817 instead of calling the "wide" APIs directly.
12818
12819 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12820
12821 * w32.h (syms_of_w32font): Add prototype.
12822
12823 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12824
12825 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12826 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12827 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12828 (Fmove_to_window_line): Doc fix.
12829
12830 2011-10-27 Chong Yidong <cyd@gnu.org>
12831
12832 * process.c (make_process): Set gnutls_state to NULL.
12833
12834 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12835 non-NULL, regardless of GNUTLS_INITSTAGE.
12836 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12837 an error. Set process slots as soon as we allocate them.
12838
12839 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12840
12841 2011-10-27 Chong Yidong <cyd@gnu.org>
12842
12843 * gnutls.c (emacs_gnutls_deinit): New function.
12844 Deallocate credentials structures as well as calling gnutls_deinit.
12845 (Fgnutls_deinit, Fgnutls_boot): Use it.
12846
12847 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12848 (deactivate_process): Call emacs_gnutls_deinit.
12849
12850 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12851
12852 * image.c (x_create_x_image_and_pixmap):
12853 * w32.c (sys_rename, w32_delayed_load):
12854 * w32font.c (fill_in_logfont):
12855 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12856
12857 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12858
12859 * w32fns.c (w32_default_color_map): New function,
12860 extracted from Fw32_default_color_map.
12861 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12862
12863 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12864
12865 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12866
12867 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12868
12869 * keyboard.c (test_undefined): New function (bug#9751).
12870 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12871
12872 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12873
12874 * sysdep.c (init_sys_modes): Fix the check for the controlling
12875 terminal (Bug#6649).
12876
12877 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12878
12879 * dispextern.h (struct bidi_it): New member next_en_type.
12880
12881 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12882 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12883 current character, check also for next_en_type being WEAK_EN.
12884 (bidi_resolve_weak): Don't enter the expensive loop if the current
12885 position is before next_en_pos. Record the bidi type of the first
12886 non-ET, non-BN character we find, in addition to its position.
12887 (bidi_level_of_next_char): Invalidate next_en_type when
12888 next_en_pos is over-stepped.
12889
12890 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12891
12892 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12893 * editfns.c: Rewrite current-time-zone so that it invokes
12894 the equivalent of (format-time-string "%Z") to get the time zone name.
12895 This fixes a bug when the time zone name contains characters that
12896 need converting from the system time locale to Emacs internal format.
12897 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12898 that patch fixed format-time-string to do the conversion, but
12899 I forgot to fix current-time-zone.
12900 (format_time_string): New function, containing most of
12901 what Fformat_time_string used to contain.
12902 (Fformat_time_string): Rewrite in terms of format_time_string.
12903 This doesn't change this function's behavior.
12904 (current-time-zone): Rewrite to use format_time_string.
12905 This fixes the bug reported by Michael Schierl in
12906 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12907 Jason Rumney's 2007-06-07 change worked around this bug, but
12908 didn't fix it.
12909 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12910
12911 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12912
12913 * xdisp.c (start_display): If the character at POS is displayed
12914 via a display vector, reset IT->current.dpvec_index to zero.
12915 (try_window_reusing_current_matrix): If a line ends in a display
12916 vector or the next line starts in a display vector, continue
12917 redrawing the window even though the character position of
12918 start_row was reached.
12919 (Bug#9771, part 2)
12920
12921 2011-10-18 Chong Yidong <cyd@gnu.org>
12922
12923 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12924 with nobreak-char-display too.
12925
12926 2011-10-18 Eli Zaretskii <eliz@gnu.org>
12927
12928 Fix part 3 of bug#9771.
12929 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12930 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12931 non-neutral characters if the current character is a paragraph
12932 separator (a.k.a. Newline). This avoids running the same
12933 expensive loop twice, once when we consume the preceding newline
12934 and the other time when the line actually needs to be displayed.
12935 Avoid the loop when we see neutrals on the base embedding level
12936 following a character whose directionality is the same as the
12937 paragraph's. This avoids running the expensive loop when a line
12938 ends in a long sequence of neutrals, like control characters.
12939 Add assertion against STRONG_AL type. Slightly rearrange code
12940 that determines the type of a neutral given the first non-neutral
12941 that follows it.
12942 (bidi_level_of_next_char): Set next_en_pos to zero when
12943 invalidating its info.
12944
12945 2011-10-17 Eli Zaretskii <eliz@gnu.org>
12946
12947 * xdisp.c (push_display_prop): Determine whether to record string
12948 or buffer position by IT->string, not by IT->method. Allow
12949 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
12950 (move_it_vertically_backward): Don't look for character position
12951 immediately after the newline when in a continuation line.
12952 (Bug#9771, part 1)
12953
12954 2011-10-15 Martin Rudalics <rudalics@gmx.at>
12955
12956 * window.c (coordinates_in_window): Rewrite and delabelize
12957 vertical border check. (Bug#5357) (Bug#9618)
12958
12959 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12960
12961 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12962 errors in XSetWindowBorder (bug#9310).
12963
12964 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12965
12966 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12967 avoid crash when xmalloc overrun checking is enabled.
12968
12969 2011-10-13 Eli Zaretskii <eliz@gnu.org>
12970
12971 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12972 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12973 cursor motion with <left> and <right> arrow keys.
12974
12975 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12976 some callers set that themselves.
12977
12978 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12979
12980 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12981 display string and the previous row comes from the same string and
12982 is empty. (Bug#9739) (Bug#9738)
12983
12984 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12985
12986 * doc.c (get_doc_string): Encode file name (bug#9735).
12987
12988 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12989
12990 * bidi.c (bidi_level_of_next_char):
12991 * xdisp.c (get_visually_first_element): Remove old incorrect
12992 comments regarding the Unicode Line Separator character.
12993
12994 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12995
12996 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12997
12998 * alloc.c (Fgc_status): Do not access beyond zombies array
12999 boundary if nzombies > MAX_ZOMBIES.
13000 * alloc.c (dump_zombies): Add missing format specifier.
13001
13002 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
13003
13004 * xdisp.c (set_cursor_from_row): Simplify conditionals,
13005 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
13006
13007 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
13008 Some packages use them to denote characters with modifiers.
13009
13010 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
13011
13012 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
13013 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
13014 matching a pp-number. Rename parameter var to var1.
13015
13016 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
13017
13018 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
13019
13020 2011-10-08 Glenn Morris <rgm@gnu.org>
13021
13022 * callint.c (Fcall_interactively): Give a more explicit error for the
13023 'c' case with a non-character input. (Bug#8479)
13024
13025 2011-10-08 Eli Zaretskii <eliz@gnu.org>
13026
13027 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
13028 lines.
13029 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
13030 lines that are hscrolled on the left.
13031
13032 * dispnew.c (buffer_posn_from_coords): Account for a possible
13033 presence of header-line. (Bug#4426)
13034
13035 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
13036
13037 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
13038 Don't advertise functionality which we discourage or doesn't work.
13039
13040 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
13041
13042 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
13043 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
13044 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
13045 this makes Emacs dump core during garbage collection on rare
13046 occasions. sizeof is obviously inferior to offsetof here, so
13047 stick with offsetof.
13048 (GC_POINTER_ALIGNMENT): New macro.
13049 (mark_memory): Omit 3rd (offset) arg; caller changed.
13050 Don't assume EMACS_INT alignment is the same as pointer alignment.
13051
13052 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
13053
13054 * keyboard.c (read_key_sequence_remapped): New var.
13055 (read_key_sequence): Compute remapping in the right buffer.
13056 (command_loop_1): Use read_key_sequence's remapping directly.
13057
13058 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
13059
13060 * dired.c (file_name_completion): Don't expand file name.
13061 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
13062 before checking file name handler.
13063
13064 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
13065 they've been requested explicitly (bug#9591).
13066
13067 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
13068
13069 * keymap.c (Fsingle_key_description): Use make_specified_string
13070 instead of build_string to build string from push_key_description.
13071 (Bug#5193)
13072
13073 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13074
13075 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
13076 This fixes a Y2038 bug on 64-bit hosts.
13077 * buffer.c (reset_buffer):
13078 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
13079 (Fclear_buffer_auto_save_failure):
13080 Use 0, not -1, to represent an unset failure time, since time_t
13081 might not be signed.
13082
13083 Remove dependency on glibc malloc internals.
13084 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13085 Move back here from lisp.h, but with their new implementations.
13086 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13087 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
13088 * charset.c (charset_table_init): New static var.
13089 (syms_of_charset): Use it instead of xmalloc. This removes a
13090 dependency on glibc malloc internals. See Eli Zaretskii's comment in
13091 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
13092 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13093 Move back to alloc.c.
13094 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13095 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
13096
13097 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
13098
13099 * nsterm.m (windowDidResize): Call x_set_window_size only when
13100 ns_in_resize is true. Otherwise set pixelwidth/height and
13101 call change_frame_size (Bug#9628).
13102
13103 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13104
13105 Port --enable-checking=all to Fedora 14 x86-64.
13106 * charset.c (syms_of_charset): Also account for glibc malloc's
13107 internal overhead when calculating the initial malloc maximum.
13108
13109 Port --enable-checking=all to Fedora 14 x86.
13110 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13111 Move to lisp.h.
13112 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
13113 (overrun_check_realloc, overrun_check_free):
13114 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
13115 That way, xmalloc returns a properly-aligned pointer even if
13116 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
13117 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
13118 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
13119 into account when calculating the initial malloc maximum.
13120 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13121 Move here from alloc.c, so that charset.c can use it too.
13122 Properly align; the old code wasn't right for common 32-bit hosts
13123 when configured with --enable-checking=all.
13124 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13125 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
13126
13127 2011-09-29 Eli Zaretskii <eliz@gnu.org>
13128
13129 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
13130 use EDOM.
13131
13132 2011-09-28 Eli Zaretskii <eliz@gnu.org>
13133
13134 * xdisp.c (compute_display_string_end): If there's no display
13135 string at CHARPOS, return -1.
13136
13137 * bidi.c (bidi_fetch_char): When compute_display_string_end
13138 returns a negative value, treat the character as a normal
13139 character not covered by a display string. (Bug#9624)
13140
13141 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
13142
13143 * lread.c (Fread_from_string): Fix typo in docstring.
13144
13145 2011-09-27 Eli Zaretskii <eliz@gnu.org>
13146
13147 * xdisp.c (handle_invisible_prop): If invisible text ends on a
13148 newline, reseat the iterator instead of bidi-iterating there one
13149 character at a time. (Bug#9610)
13150 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
13151 TO_CHARPOS if the bidi iterator is at base embedding level.
13152
13153 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
13154
13155 * lread.c (readevalloop): Use correct code for NBSP.
13156 (read1): Likewise. (Bug#9608)
13157
13158 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
13159
13160 * dbusbind.c (Fdbus_register_signal): When service is not
13161 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
13162
13163 2011-09-25 Glenn Morris <rgm@gnu.org>
13164
13165 * buffer.c (truncate-lines): Doc fix.
13166
13167 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
13168
13169 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
13170 (Fset_window_next_buffers): Doc fix.
13171
13172 2011-09-24 Glenn Morris <rgm@gnu.org>
13173
13174 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
13175
13176 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
13177
13178 Fix minor problems found by static checking.
13179 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
13180 * indent.c (Fvertical_motion): Fix == vs = typo.
13181
13182 2011-09-24 Eli Zaretskii <eliz@gnu.org>
13183
13184 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
13185 Default value is now t. Doc fix.
13186
13187 * indent.c (Fvertical_motion): Compute and apply the overshoot
13188 logic when moving up, not only when moving down. Fix the
13189 confusing name and values of the it_overshoot_expected variable;
13190 logic changes accordingly. (Bug#9254) (Bug#9549)
13191
13192 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
13193 CHARPOS is covered by a display string which includes newlines.
13194 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
13195 is covered by a display string with embedded newlines.
13196
13197 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
13198
13199 * dbusbind.c (Fdbus_register_signal): Add match rule to
13200 Vdbus_registered_objects_table. (Bug#9581)
13201 (Fdbus_register_method, Vdbus_registered_objects_table):
13202 Fix docstring.
13203
13204 2011-09-24 Jim Meyering <meyering@redhat.com>
13205
13206 do not ignore write error for any output size
13207 The previous change was incomplete.
13208 While it makes emacs --batch detect the vast majority of stdout
13209 write failures, errors were still ignored whenever the output size is
13210 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
13211 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
13212 && echo FAIL: ignored write error
13213 FAIL: ignored write error
13214 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
13215 && echo FAIL: ignored write error
13216 FAIL: ignored write error
13217 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
13218
13219 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
13220
13221 * emacs.c (Fkill_emacs): In noninteractive mode exit
13222 non-successfully if a write error occurred on stdout. (Bug#9574)
13223
13224 2011-09-21 Eli Zaretskii <eliz@gnu.org>
13225
13226 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
13227 the xassert test.
13228
13229 * dispextern.h (struct it): Update the comment documenting what
13230 can it->OBJECT be.
13231
13232 2011-09-20 Eli Zaretskii <eliz@gnu.org>
13233
13234 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
13235 a display string, extend search for cursor position to end of row.
13236 (find_row_edges): If the row ends in a newline from a display
13237 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
13238 Handle the case of a display string with multiple newlines.
13239 (Fcurrent_bidi_paragraph_direction): Fix search for previous
13240 non-empty line. Fixes confusing cursor motion with arrow keys at
13241 the beginning of a line that starts with whitespace.
13242
13243 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13244
13245 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13246 (bug#9493).
13247
13248 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
13249
13250 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13251 boolean (Bug#9154).
13252
13253 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13254
13255 * xdisp.c (display_line): Record maximum and minimum buffer
13256 positions even if no glyphs were produced (e.g., by a zero-width
13257 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13258 buffer positions that will be removed from the glyph row because
13259 they don't fit.
13260 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13261 column is beyond frame width: don't subtract 1 "pixel" when
13262 computing width of the stretch.
13263 (reseat_at_next_visible_line_start): Undo the change made on
13264 2011-09-17 that saved paragraph information and restored it after
13265 the call to `reseat'. (Bug#9545)
13266
13267 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13268
13269 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13270 and turn window cursor on if cleared (Bug#9415).
13271
13272 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
13273
13274 * search.c (boyer_moore): Take unibyte characters from pattern
13275 literally. (Bug#9458)
13276
13277 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13278
13279 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13280
13281 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13282
13283 Fix minor problem found by static checking.
13284 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13285 initialized, to pacify gcc -Wuninitialized.
13286
13287 * fileio.c: Report proper errno when syscall falls.
13288 (Finsert_file_contents): Save and restore errno,
13289 so that report_file_error outputs the correct diagnostic.
13290 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13291
13292 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13293
13294 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13295
13296 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13297
13298 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13299 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13300
13301 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13302
13303 * xdisp.c (reseat_at_next_visible_line_start): Keep information
13304 about the current paragraph and restore it after the call to reseat.
13305
13306 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13307 (bidi_find_paragraph_start): Search back for paragraph beginning
13308 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13309 (bidi_move_to_visually_next): Only trigger paragraph-related
13310 computations when the last character is a newline or at EOB, not
13311 just any NEUTRAL_B. (Bug#9470)
13312
13313 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13314 truncated lines if point is covered by a display string. (Bug#9524)
13315
13316 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13317
13318 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13319 (cons_to_x_long): New function.
13320 (lisp_data_to_selection_data): Use it. Correct the test for
13321 short-versus-long data; it was negated. Break out of vector
13322 loop, for efficiency, when a long datum is discovered.
13323
13324 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13325
13326 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13327
13328 2011-09-16 Eli Zaretskii <eliz@gnu.org>
13329
13330 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13331 GCC PR/17406) by declaring this function with external scope.
13332
13333 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13334
13335 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13336 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13337
13338 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13339
13340 * editfns.c (Fformat): Correctly handle text properties on "%%".
13341
13342 2011-09-15 Eli Zaretskii <eliz@gnu.org>
13343
13344 * xterm.c (x_draw_composite_glyph_string_foreground):
13345 * w32term.c (x_draw_composite_glyph_string_foreground):
13346 * term.c (encode_terminal_code):
13347 * composite.c (composition_update_it, get_composition_id):
13348 * xdisp.c (get_next_display_element)
13349 (fill_composite_glyph_string): Add comments about special meaning
13350 of TAB characters in a composition.
13351
13352 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13353
13354 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
13355 This occurs when processing a multibyte format.
13356 Problem reported by Wolfgang Jenker.
13357
13358 2011-09-15 Johan Bockgård <bojohan@gnu.org>
13359
13360 * xdisp.c (try_cursor_movement): Only check for exact match if
13361 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13362
13363 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13364
13365 Remove unused external symbols.
13366 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13367 * xdisp.c (calc_pixel_width_or_height): Now static.
13368 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13369 * indent.c (check_display_width):
13370 * w32term.c: Fix comment to match code.
13371 * xterm.c, xterm.h (x_catching_errors): Remove.
13372
13373 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13374
13375 * xselect.c: Use signed conversions more consistently (Bug#9498).
13376 (selection_data_to_lisp_data): Assume incoming selection data are
13377 signed integers, not unsigned. This is to be consistent with
13378 outgoing selection data, which was modified to use signed integers
13379 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13380 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13381 expects long, not unsigned long.
13382
13383 2011-09-14 Eli Zaretskii <eliz@gnu.org>
13384
13385 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13386 computation of loop end. Reported by Johan Bockgård
13387 <bojohan@gnu.org>.
13388
13389 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
13390
13391 * frame.c (Fother_visible_frames_p): Function deleted.
13392
13393 2011-09-12 Eli Zaretskii <eliz@gnu.org>
13394
13395 * indent.c (compute_motion): Process display vector front to back
13396 rather than the other way around. (Bug#2496)
13397
13398 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13399
13400 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13401
13402 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
13403
13404 * minibuf.c (Fread_from_minibuffer): Doc fix.
13405
13406 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13407
13408 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13409 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13410
13411 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13412
13413 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13414 value for non-existent files.
13415
13416 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13417
13418 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13419 set its "size" to -1. This will set the modtime_size field of
13420 the corresponding buffer to -1, which is what
13421 verify-visited-file-modtime expects for files that do not exist.
13422 (Bug#9139)
13423
13424 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13425
13426 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13427 here ...
13428 * lisp.h: ... from here. push_key_description is no longer
13429 defined in keyboard.c, so its declaration should not be in
13430 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13431 logically belongs with push_key_description.
13432
13433 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13434
13435 * buffer.h: Include <sys/types.h> instead of <time.h>.
13436 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13437 Problem reported by Herbert J. Skuhra.
13438
13439 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13440
13441 * xml.c (parse_region): Make the parsing work for
13442 non-comment-starting XML files again (bug#9144).
13443
13444 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13445
13446 * image.c (gif_load): Fix calculation of bottom and right corner.
13447 (Bug#9468)
13448
13449 2011-09-10 Eli Zaretskii <eliz@gnu.org>
13450
13451 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13452 redisplay in small windows.
13453
13454 2011-09-09 Eli Zaretskii <eliz@gnu.org>
13455
13456 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13457
13458 2011-09-08 Martin Rudalics <rudalics@gmx.at>
13459
13460 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13461 Operate on live windows only.
13462
13463 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
13464
13465 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13466
13467 2011-09-07 Eli Zaretskii <eliz@gnu.org>
13468
13469 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13470 only under bidi iteration.
13471
13472 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13473
13474 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13475
13476 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13477
13478 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13479 Without this fix, the command to link temacs failed due to an
13480 undefined symbol __builtin_isnan. This is because
13481 /usr/include/iso/math_c99.h #defines isnan(x) to
13482 __builtin_isnan(x), but the bundled gcc, which identifies itself
13483 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13484 a __builtin_isnan.
13485 * floatfns.c (isnan): #undef, and then #define to a clone of
13486 what's in data.c.
13487 (Fisnan): Always define, since it's always available now.
13488 (syms_of_floatfns): Always define isnan at the Lisp level.
13489
13490 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13491
13492 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13493
13494 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13495
13496 * fileio.c: Fix bugs with large file offsets (Bug#9428).
13497 The previous code assumed that file offsets (off_t values) fit in
13498 EMACS_INT variables, which is not true on typical 32-bit hosts.
13499 The code messed up by falsely reporting buffer overflow in cases
13500 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13501 when "big" contains more than 2**29 bytes, even though this
13502 inserts just one byte and does not overflow the buffer.
13503 (Finsert_file_contents): Store file offsets as off_t
13504 values, not as EMACS_INT values. Check for overflow when
13505 converting between EMACS_INT and off_t. When checking for
13506 buffer overflow or for overlap, take the offsets into account.
13507 Don't use EMACS_INT for small values where int suffices.
13508 When checking for overlap, fix a typo: ZV was used where
13509 ZV_BYTE was intended.
13510 (Fwrite_region): Don't assume off_t fits into 'long'.
13511 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13512
13513 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
13514
13515 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13516
13517 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13518
13519 sprintf-related integer and memory overflow issues (Bug#9412).
13520
13521 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13522 (esprintf, exprintf, evxprintf): New functions.
13523 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13524 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13525 (modify_event_symbol): Do not assume that the length of
13526 name_alist_or_stem is safe to alloca and fits in int.
13527 (Fexecute_extended_command): Likewise for function name and binding.
13528 (Frecursion_depth): Wrap around reliably on integer overflow.
13529 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13530 since some callers pass EMACS_INT values.
13531 (Fsingle_key_description): Don't crash if symbol name contains more
13532 than MAX_ALLOCA bytes.
13533 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13534 (get_minibuffer): Arg is now EMACS_INT, not int.
13535 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13536 (esprintf, exprintf, evxprintf): New decls.
13537 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13538
13539 * dbusbind.c (signature_cat): New function.
13540 (xd_signature, Fdbus_register_signal):
13541 Do not overrun buffer; instead, report string overflow.
13542
13543 * dispnew.c (add_window_display_history): Don't overrun buffer.
13544 Truncate instead; this is OK since it's just a log.
13545
13546 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13547 even if the time zone offset is outlandishly large.
13548 Don't mishandle offset == INT_MIN.
13549
13550 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13551 when creating daemon; the previous buffer-overflow check was incorrect.
13552
13553 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13554 which has the guts of the old verror function.
13555
13556 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13557 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13558
13559 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13560 (font_unparse_xlfd): Don't blindly alloca long strings.
13561 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13562 fits in int, when using sprintf. Use single snprintf to count
13563 length of string rather than counting it via multiple sprintfs;
13564 that's simpler and more reliable.
13565 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13566 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13567 sprintf, in case result does not fit in int.
13568
13569 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13570 (fontset_from_font): Print it.
13571
13572 * frame.c (tty_frame_count): Now printmax_t, not int.
13573 (make_terminal_frame, set_term_frame_name): Print it.
13574 (x_report_frame_params): In X, window IDs are unsigned long,
13575 not signed long, so print them as unsigned.
13576 (validate_x_resource_name): Check for implausibly long names,
13577 and don't assume name length fits in 'int'.
13578 (x_get_resource_string): Don't blindly alloca invocation name;
13579 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13580 not fit in int.
13581
13582 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13583 (xg_check_special_colors, xg_set_geometry):
13584 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13585
13586 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13587 Use esprintf, not sprintf, in case result does not fit in int.
13588
13589 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13590 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13591 it as a large positive number.
13592 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13593 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13594
13595 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13596 in case result does not fit in int.
13597
13598 * print.c (float_to_string): Detect width overflow more reliably.
13599 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13600 buffer overrun. Don't assume list length fits in 'int'. Treat
13601 print length of 0 as 0, not as infinity; to be consistent with other
13602 uses of print length in this function. Don't overflow print length
13603 index. Don't assume hash table size fits in 'long', or that
13604 vectorlike size fits in 'unsigned long'.
13605
13606 * process.c (make_process): Use printmax_t, not int, to format
13607 process-name gensyms.
13608
13609 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13610
13611 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13612 to avoid potential buffer overrun.
13613
13614 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13615 if X resource line is longer than 512 bytes.
13616
13617 * xfns.c (x_window): Make sprintf buffer a bit bigger
13618 to avoid potential buffer overrun.
13619
13620 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13621
13622 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13623
13624 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13625
13626 Integer overflow fixes for scrolling, etc.
13627 Without these, Emacs silently mishandles large integers sometimes.
13628 For example, "C-u 4294967297 M-x recenter" was treated as if
13629 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13630
13631 * xdisp.c (try_window_id): Check Emacs fixnum range before
13632 converting to 'int'.
13633
13634 * window.c (window_scroll_line_based, Frecenter):
13635 Check that an Emacs fixnum is in range before assigning it to 'int'.
13636 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13637 values converted from Emacs fixnums.
13638 (Frecenter): Don't wrap around a line count if it is out of 'int'
13639 range; instead, treat it as an extreme value.
13640 (Fset_window_configuration, compare_window_configurations):
13641 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13642
13643 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13644 that can exceed INT_MAX. Check that EMACS_INT value is in range
13645 before assigning it to the (possibly-narrower) index.
13646 (match_limit): Don't assume that a fixnum can fit in 'int'.
13647
13648 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13649 exceed INT_MAX.
13650
13651 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13652 (Fvertical_motion): Don't wrap around LINES values that don't fit
13653 in 'int'. Instead, treat them as extreme values. This is good
13654 enough for windows, which can't have more than INT_MAX lines anyway.
13655
13656 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13657
13658 * Require libxml/parser.h to avoid compilation warning.
13659
13660 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13661
13662 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13663 since this reportedly can destroy thread storage.
13664
13665 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13666
13667 * syntax.c (find_defun_start): Update all cache variables if
13668 exiting early (Bug#9401).
13669
13670 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13671
13672 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13673
13674 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13675 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13676 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13677
13678 * term.c (tty_append_glyph): New function.
13679 (produce_stretch_glyph): Static function and its prototype deleted.
13680
13681 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13682 Add prototypes.
13683
13684 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13685
13686 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13687 when checking :margin (Bug#9390).
13688 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13689 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13690 so that the name doesn't mislead. All uses changed.
13691
13692 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13693
13694 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13695 set_tty_hooks.
13696
13697 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13698
13699 * xdisp.c (move_it_to): Don't bail out early when reaching
13700 position beyond to_charpos, if we are scanning backwards.
13701 (move_it_vertically_backward): When DY == 0, make sure we get to
13702 the first character in the line after the newline.
13703
13704 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13705
13706 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13707 (ccl_driver): Do not generate an out-of-range pointer.
13708 (Fccl_execute_on_string): Remove unnecessary check for
13709 integer overflow, noted by Stefan Monnier in
13710 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13711 Remove a FIXME that didn't need fixing.
13712 Simplify the newly-introduced buffer reallocation code.
13713
13714 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13715
13716 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13717
13718 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13719
13720 Integer and memory overflow issues (Bug#9196).
13721
13722 * doc.c (get_doc_string): Rework so that
13723 get_doc_string_buffer_size is the actual buffer size, rather than
13724 being 1 less than the actual buffer size; this makes xpalloc more
13725 convenient.
13726
13727 * image.c (x_allocate_bitmap_record, cache_image):
13728 * xselect.c (Fx_register_dnd_atom):
13729 Simplify previous changes by using xpalloc.
13730
13731 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13732 since either will do and ptrdiff_t is convenient with xpalloc.
13733
13734 * charset.c (charset_table_size)
13735 (struct charset_sort_data.priority): Now ptrdiff_t.
13736 (charset_compare): Don't overflow if priorities differ greatly.
13737 (Fsort_charsets): Don't assume list length fits in int.
13738 Check for size-calculation overflow when allocating sort data.
13739 (syms_of_charset): Allocate an initial charset table that is
13740 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13741
13742 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13743
13744 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13745 The actual value is always <= INT_MAX, and leaving it unsigned made
13746 overflow checking harder.
13747
13748 * dispextern.h (struct glyph_matrix.rows_allocated)
13749 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13750 with xpalloc. The values are still always <= INT_MAX.
13751
13752 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13753
13754 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13755 (SAFE_NALLOCA): New macro.
13756
13757 * region-cache.c (struct boundary.pos, find_cache_boundary)
13758 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13759 (set_cache_region, invalidate_region_cache)
13760 (revalidate_region_cache, know_region_cache, region_cache_forward)
13761 (region_cache_backward, pp_cache):
13762 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13763 so that ptrdiff_t * can be passed to xpalloc.
13764 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13765 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13766 (pp_cache): Don't assume cache_len fits in int.
13767 * region-cache.h: Adjust extern decls to match.
13768
13769 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13770 EMACS_INT, since either will do, for xpalloc.
13771
13772 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13773 (xnmalloc, xnrealloc, xpalloc): New functions.
13774
13775 * bidi.c (bidi_shelve_header_size): New constant.
13776 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13777 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13778
13779 * bidi.c (bidi_cache_shrink):
13780 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13781 (overlay_strings):
13782 Don't update size of array until after memory allocation succeeds,
13783 because xmalloc/xrealloc may not return.
13784 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13785 now that we have proper integer overflow checking.
13786 (record_overlay_string, overlay_strings): Catch overflows when
13787 calculating size of overlay_str_buf.
13788
13789 * callproc.c (Fcall_process): Check for size overflow when
13790 calculating size of args2.
13791 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13792 Normally we prefer signed values, but sticking with ptrdiff_t would
13793 require adding more-complicated checks.
13794
13795 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13796 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13797 Redo buffer-overflow calculations to avoid integer overflow.
13798 Add a FIXME comment where memory seems to be over-allocated.
13799
13800 * character.c (Fstring): Check for size-calculation overflow.
13801
13802 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13803 unnecessary integer overflow. Check for size overflow.
13804 (encode_coding_object): Don't update size until xmalloc succeeds.
13805
13806 * composite.c (get_composition_id): Check for overflow in glyph
13807 length calculations.
13808
13809 Integer and memory overflow fixes for display code.
13810 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13811 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13812 (scrolling_window): Check for overflow in size calculations.
13813 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13814 Don't assume glyph table len fits in int.
13815 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13816 (row_table_size): Now ptrdiff_t, not int.
13817 (scrolling_window): Avoid overflow in size calculations.
13818 Don't update size until allocation succeeds.
13819 * fns.c (concat): Check for overflow in size calculations.
13820 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13821 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13822 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13823
13824 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13825 (get_doc_string): Check for size calculation overflow.
13826 Don't update size until allocation succeeds.
13827 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13828 EMACS_INT, where ptrdiff_t will do.
13829 (Fsubstitute_command_keys): Check for string overflow.
13830
13831 * editfns.c (set_time_zone_rule): Don't assume environment length
13832 fits in int.
13833 (message_length): Now ptrdiff_t, not int.
13834 (Fmessage_box): Don't update size until allocation succeeds.
13835 Don't assume message length fits in int.
13836 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13837
13838 * emacs.c (main): Do not reallocate argv, since there is a null at
13839 the end that can be overwritten, and this way there's no need to
13840 worry about size-calculation overflow.
13841 (sort_args): Check for size-calculation overflow.
13842
13843 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13844 alloc succeeds.
13845 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13846
13847 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13848 (x_set_scroll_bar_width, x_figure_window_size):
13849 Check for integer overflow.
13850 (x_set_alpha): Do not assume XINT fits in int.
13851
13852 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13853 This is for the members text_lines, text_cols, total_lines, total_cols,
13854 where the system imposes an 'int' limit.
13855
13856 * fringe.c (Fdefine_fringe_bitmap):
13857 Don't update size until alloc works.
13858
13859 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13860 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13861
13862 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13863 Check for size-calculation overflow.
13864 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13865 do, as we prefer signed integers.
13866 (id_to_widget.max_size, id_to_widget.used)
13867 (xg_store_widget_in_map, xg_remove_widget_from_map)
13868 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13869 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13870 Use and return ptrdiff_t, not int.
13871 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13872 * gtkutil.h: Change prototypes to match the above.
13873
13874 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13875 are duplicate now that they've been promoted to lisp.h.
13876 (x_allocate_bitmap_record, x_alloc_image_color)
13877 (make_image_cache, cache_image, xpm_load):
13878 Don't update size until alloc is done.
13879 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13880 (x_detect_edges):
13881 Check for size calculation overflow.
13882 (ct_colors_allocated_max): New constant.
13883 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13884 overflow.
13885
13886 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13887 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13888 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13889 Use ptrdiff_t, not int, to count maps.
13890 (read_char_minibuf_menu_prompt): Check for overflow in size
13891 calculations. Don't update size until allocation succeeds.
13892 Redo calculations to avoid overflow.
13893 * keyboard.h: Change prototypes to match the above.
13894
13895 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13896 to count maps.
13897 (current_minor_maps): Check for size calculation overflow.
13898 * keymap.h: Change prototypes to match the above.
13899
13900 * lread.c (read1, init_obarray): Don't update size until alloc done.
13901
13902 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13903 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13904
13905 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13906 Now ptrdiff_t, not int.
13907 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13908 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13909
13910 * process.c (Fnetwork_interface_list): Check for overflow
13911 in size calculation.
13912
13913 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13914
13915 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13916 overflow. Don't bother calling xmalloc when xrealloc will do.
13917
13918 * search.c (Freplace_match): Check for size calculation overflow.
13919 (Fset_match_data): Don't assume list lengths fit in 'int'.
13920
13921 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13922 for command line length. Do not attempt to address one before the
13923 beginning of an array, as that's not portable.
13924
13925 * term.c (max_frame_lines): Remove; unused.
13926 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13927 not int.
13928 (encode_terminal_code, calculate_costs): Check for size
13929 calculation overflow.
13930 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13931 table lengths and related sizes. Don't update size until alloc
13932 done. Redo calculations to avoid overflow.
13933 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13934
13935 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13936 subtracting pointers.
13937 (gobble_line): Check for overflow more carefully. Don't update size
13938 until alloc done.
13939
13940 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13941 Don't update size until alloc done.
13942 Redo size calculations to avoid overflow.
13943 Check for size calculation overflow.
13944 (main) [DEBUG]: Fix typo in invoking tparam1.
13945
13946 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13947 Use ptrdiff_t, not int, for sizes.
13948 (store_mode_line_noprop_char): Don't update size until alloc done.
13949
13950 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13951 Use ptrdiff_t, not int, for sizes.
13952 (Finternal_make_lisp_face, cache_face):
13953 Check for size calculation overflow.
13954 (cache_face): Treat size calculation overflows as if they were
13955 memory exhaustion (the usual treatment), rather than aborting.
13956
13957 * xfns.c (x_encode_text, x_set_name_internal)
13958 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13959 sizes, since they can exceed INT_MAX in size. Check for size
13960 calculation overflow.
13961
13962 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13963 (xg_select): Check for size calculation overflow.
13964 Don't update size until alloc done.
13965
13966 * xrdb.c (get_environ_db): Don't assume path length fits in int,
13967 as sprintf is limited to int lengths.
13968
13969 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13970 (X_LONG_MIN): New macros.
13971 Use them to make the following changes clearer.
13972 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13973 This change doesn't affect the value now, but it may help remind
13974 future maintainers not to raise the value too much later.
13975 (SELECTION_QUANTUM): Remove, replacing with ...
13976 (selection_quantum): ... new function, which avoids overflow.
13977 All uses changed.
13978 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13979 assumption that selection length fits in 'int'.
13980 (x_reply_selection_request, x_handle_selection_request)
13981 (x_get_window_property, receive_incremental_selection)
13982 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13983 (lisp_data_to_selection_data, clean_local_selection_data):
13984 Use ptrdiff_t, not int, to record length of selection.
13985 (x_reply_selection_request, x_get_window_property)
13986 (receive_incremental_selection, x_property_data_to_lisp):
13987 Redo calculations to avoid overflow.
13988 (x_reply_selection_request): When sending hint, ceiling it at
13989 X_LONG_MAX rather than relying on wraparound overflow to send
13990 something.
13991 (x_get_window_property, receive_incremental_selection)
13992 (lisp_data_to_selection_data, x_property_data_to_lisp):
13993 Check for size-calculation overflow.
13994 (x_get_window_property, receive_incremental_selection)
13995 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13996 Don't store size until memory allocation succeeds.
13997 (x_get_window_property): Plug memory leak on memory exhaustion.
13998 Don't double-block input; malloc is safe here. Don't assume 2**34
13999 - 4 fits in unsigned long. Add an xassert to check
14000 XGetWindowProperty overflow. Be more careful about overflow
14001 calculations, and distinguish size from memory overflow better.
14002 (receive_incremental_selection): When tracing, don't assume
14003 unsigned int is less than INT_MAX.
14004 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
14005 harmful) conversions of unsigned short to int.
14006 (lisp_data_to_selection_data): Don't assume that integers
14007 in the range -65535 through -1 fit in an X unsigned short.
14008 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
14009 result parameters unless successful. Rely on cons_to_unsigned
14010 to report problems with elements; the old code wasn't right anyway.
14011 (x_check_property_data): Check for int overflow; we cannot use
14012 a wider type due to X limits.
14013 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
14014
14015 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
14016
14017 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
14018 (x_term_init): Check for size calculation overflow.
14019 (x_color_cells): Don't store size until memory allocation succeeds.
14020 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
14021 Don't assume alloca size is less than MAX_ALLOCA.
14022 (x_term_init): Don't assume length fits in int (sprintf is limited
14023 to int size).
14024
14025 Use ptrdiff_t for composition IDs.
14026 * character.c (lisp_string_width):
14027 * composite.c (composition_table_size, n_compositions)
14028 (get_composition_id, composition_gstring_from_id):
14029 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
14030 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
14031 * window.c (Frecenter):
14032 Use ptrdiff_t, not int, for composition IDs.
14033 * composite.c (get_composition_id): Check for integer overflow.
14034 * composite.h: Adjust prototypes to match the above changes.
14035
14036 Use ptrdiff_t for hash table indexes.
14037 * category.c (hash_get_category_set):
14038 * ccl.c (ccl_driver):
14039 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
14040 * coding.c (coding_system_charset_list, detect_coding_system):
14041 * coding.h (struct coding_system.id):
14042 * composite.c (get_composition_id, gstring_lookup_cache):
14043 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
14044 * image.c (xpm_get_color_table_h):
14045 * lisp.h (hash_lookup, hash_put):
14046 * minibuf.c (Ftest_completion):
14047 Use ptrdiff_t for hash table indexes, not int (which is too
14048 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
14049 32-bit --with-wide-int hosts).
14050
14051 * charset.c (Fdefine_charset_internal): Check for integer overflow.
14052 Add a FIXME comment about memory leaks.
14053 (syms_of_charset): Don't assume xmalloc returns.
14054
14055 Don't assume that stated character widths fit in int.
14056 * character.c (Fchar_width, c_string_width, lisp_string_width):
14057 * character.h (CHAR_WIDTH):
14058 * indent.c (MULTIBYTE_BYTES_WIDTH):
14059 Use sanitize_char_width to avoid undefined and/or bad behavior
14060 with outlandish widths.
14061 * character.h (sanitize_tab_width): Rename from sanitize_width,
14062 now that we have two such functions. All uses changed.
14063 (sanitize_char_width): New inline function.
14064
14065 Don't assume that tab-width fits in int.
14066 * character.h (sanitize_width): New inline function.
14067 (SANE_TAB_WIDTH): New macro.
14068 (ASCII_CHAR_WIDTH): Use it.
14069 * indent.c (sane_tab_width): Remove. All uses replaced by
14070 SANE_TAB_WIDTH (current_buffer).
14071 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
14072
14073 * fileio.c: Integer overflow issues with file modes.
14074 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
14075
14076 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
14077 Remove unreachable code.
14078 (read_hex, load_charset_map_from_file): Check for integer overflow.
14079
14080 * xterm.c: Don't go over XClientMessageEvent limit.
14081 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
14082 (x_send_scroll_bar_event): Likewise. Check that the size does not
14083 exceed limits imposed by XClientMessageEvent, as well as the usual
14084 ptrdiff_t and size_t limits.
14085
14086 * keyboard.c: Overflow, signedness and related fixes.
14087 (make_lispy_movement): Use same integer type in forward decl
14088 that is used in the definition.
14089 (read_key_sequence, keyremap_step):
14090 Change bufsize argument back to int, undoing my 2011-03-30 change.
14091 We prefer signed types, and int is wide enough here.
14092 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
14093 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
14094 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
14095 length, not size_t. Use ptrdiff_t for index, not int.
14096 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
14097 possibility of integer overflow.
14098
14099 Overflow, signedness and related fixes for images.
14100
14101 * dispextern.h (struct it.stack[0].u.image.image_id)
14102 (struct_it.image_id, struct image.id, struct image_cache.size)
14103 (struct image_cache.used, struct image_cache.ref_count):
14104 * gtkutil.c (update_frame_tool_bar):
14105 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
14106 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
14107 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
14108 * nsmenu.m (update_frame_tool_bar):
14109 * xdisp.c (calc_pixel_width_or_height):
14110 * xfns.c (image_cache_refcount):
14111 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
14112 on typical 64-bit hosts.
14113
14114 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14115 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
14116 Omit unnecessary casts to int.
14117 (parse_image_spec): Check that integers fall into 'int' range
14118 when the callers expect that.
14119 (image_ascent): Redo ascent calculation to avoid int overflow.
14120 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
14121 (lookup_image): Remove unnecessary tests.
14122 (xbm_image_p): Locals are now of int, not EMACS_INT,
14123 since parse_image_check makes sure they fit into int.
14124 (png_load, gif_load, svg_load_image):
14125 Prefer int to unsigned where either will do.
14126 (tiff_handler): New function, combining the cores of the
14127 old tiff_error_handler and tiff_warning_handler.
14128 This function is rewritten to use vsnprintf and thereby avoid
14129 stack buffer overflows. It uses only the features of vsnprintf
14130 that are common to both POSIX and native Microsoft.
14131 (tiff_error_handler, tiff_warning_handler): Use it.
14132 (tiff_load, gif_load, imagemagick_load_image):
14133 Don't assume :index value fits in 'int'.
14134 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
14135 (imagemagick_load_image): Check that crop parameters fit into
14136 the integer types that MagickCropImage accepts. Don't assume
14137 Vimagemagick_render_type has a nonnegative value. Don't assume
14138 size_t fits in 'long'.
14139 (gs_load): Use printmax_t to print the widest integers possible.
14140 Check for integer overflow when computing image height and width.
14141
14142 2011-08-26 Eli Zaretskii <eliz@gnu.org>
14143
14144 * xdisp.c (redisplay_window): Don't force window start if point
14145 will be invisible in the resulting window. (Bug#9324)
14146
14147 2011-08-25 Eli Zaretskii <eliz@gnu.org>
14148
14149 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
14150 the display spec is of the form `(space ...)'.
14151 (handle_display_spec): Return the value returned by
14152 handle_single_display_spec, not just 1 or zero.
14153 (handle_single_display_spec): If the display spec is of the form
14154 `(space ...)', and specifies display in the text area, return 2
14155 rather than 1.
14156 (try_cursor_movement): Check for the need to scroll more
14157 accurately, and prefer exact match for point under bidi.
14158 Don't advance `row' beyond the last row of the window.
14159
14160 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
14161 into disp_prop; all users changed.
14162
14163 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
14164 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
14165 for the text covered by the display property.
14166
14167 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
14168
14169 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
14170 Change return value to nil.
14171 (Frecord_buffer): Delete unused function.
14172
14173 2011-08-24 Eli Zaretskii <eliz@gnu.org>
14174
14175 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
14176 buffers, return left-to-right.
14177 (set_cursor_from_row): Consider candidate row a win if its glyph
14178 represents a newline and point is on that newline. Fixes cursor
14179 positioning on the newline at EOL of R2L text within L2R
14180 paragraph, and vice versa.
14181 (try_cursor_movement): Check continued rows, in addition to
14182 continuation rows. Fixes unwarranted scroll when point enters a
14183 continued line of R2L text within an L2R paragraph, or vice versa.
14184 (cursor_row_p): Consider the case of point being equal to
14185 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
14186 from the end of a short line to the beginning of a continued line
14187 of R2L text within L2R paragraph.
14188 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
14189 composed characters.
14190
14191 * bidi.c (bidi_check_type): Use xassert.
14192 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
14193 members.
14194
14195 2011-08-23 Eli Zaretskii <eliz@gnu.org>
14196
14197 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
14198 a character.
14199
14200 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
14201
14202 * nsfont.m (ns_otf_to_script): Fix typo.
14203
14204 2011-08-22 Kenichi Handa <handa@m17n.org>
14205
14206 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
14207 extra slot even if the purpose is char-code-property-table.
14208
14209 2011-08-23 Eli Zaretskii <eliz@gnu.org>
14210
14211 * xdisp.c (redisplay_window): When computing centering_position,
14212 account for the height of the header line. (Bug#8874)
14213
14214 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
14215 instead of CHAR_TO_BYTE. Fixes a crash when a completion
14216 candidate is selected by the mouse, and that candidate has a
14217 composed character under the mouse.
14218
14219 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
14220 coordinates reported by pos-visible-in-window-p for a composed
14221 character in column zero.
14222
14223 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
14224
14225 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
14226
14227 2011-08-22 Eli Zaretskii <eliz@gnu.org>
14228
14229 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
14230 consider it a hit if to_charpos is anywhere in the range of the
14231 composed buffer positions.
14232
14233 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
14234
14235 * image.c (gif_load): Don't assume that each subimage has the same
14236 dimensions as the base image. Handle disposal method that is
14237 "undefined" by the gif spec (Bug#9335).
14238
14239 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
14240
14241 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
14242 (Fcondition_case): Document `debug' symbol in error handler.
14243
14244 2011-08-19 Eli Zaretskii <eliz@gnu.org>
14245
14246 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14247 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14248 from an Org mode buffer to a Speedbar frame.
14249
14250 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14251 a composition, take its buffer position from IT->cmp_it.charpos.
14252 Fixes cursor positioning at the beginning of a line that begins
14253 with a composed character.
14254
14255 2011-08-18 Eli Zaretskii <eliz@gnu.org>
14256
14257 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14258 character bidirectional type, use STRONG_L instead. Fixes crashes
14259 in a buffer produced by `describe-categories'.
14260
14261 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14262 members before the level stack, so they would be saved and
14263 restored when copying iterator state. Fixes incorrect reordering
14264 around TABs covered by display properties.
14265
14266 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14267
14268 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
14269
14270 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
14271
14272 * eval.c (internal_condition_case, internal_condition_case_1)
14273 (internal_condition_case_2, internal_condition_case_n):
14274 Remove unnecessary aborts (Bug#9081).
14275
14276 2011-08-17 Eli Zaretskii <eliz@gnu.org>
14277
14278 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14279 has no `load' handler, try opening the file locally. (Bug#9311)
14280
14281 2011-08-16 Ken Brown <kbrown@cornell.edu>
14282
14283 * gmalloc.c: Expand comment.
14284
14285 2011-08-16 Eli Zaretskii <eliz@gnu.org>
14286
14287 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14288 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14289
14290 2011-08-16 Ken Brown <kbrown@cornell.edu>
14291
14292 Fix memory allocation problems in Cygwin build (Bug#9273).
14293
14294 * unexcw.c ( __malloc_initialized): Declare external variable.
14295 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14296
14297 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14298 New variables.
14299 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14300 dumped emacs.
14301 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14302 in the static heap.
14303 [CYGWIN] (special_realloc): New function.
14304 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14305 requests to realloc storage in the static heap.
14306
14307 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14308
14309 * bidi.c (bidi_initialize): Remove unused local.
14310
14311 2011-08-15 Eli Zaretskii <eliz@gnu.org>
14312
14313 * bidimirror.h:
14314 * biditype.h: Remove file.
14315 * makefile.w32-in ($(BLD)/bidi.$(O)):
14316 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
14317
14318 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14319
14320 * chartab.c: Improve commentary for the uniprop_table API.
14321
14322 * bidi.c (bidi_paragraph_init): Support zero value of
14323 bidi_ignore_explicit_marks_for_paragraph_level.
14324 (bidi_initialize): Use uniprop_table instead of including
14325 biditype.h and bidimirror.h.
14326
14327 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14328 coordinates of the iterator when restoring from ppos_it.
14329 (Bug#9296)
14330
14331 2011-08-14 Kenichi Handa <handa@m17n.org>
14332
14333 * process.c (create_process): Call setup_process_coding_systems
14334 after the pid of the process is set to -1 (Bug#8162).
14335
14336 2011-08-14 Eli Zaretskii <eliz@gnu.org>
14337
14338 * xdisp.c (move_it_in_display_line_to): Don't invoke
14339 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14340 ppos_it. Fixes vertical cursor motion when line beginning is
14341 covered by an image. (Bug#9296)
14342
14343 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14344
14345 * nsterm.h (ns_run_ascript): Declare.
14346 (NSAPP_DATA2_RUNASSCRIPT): Define.
14347
14348 * nsfns.m (as_script, as_result, as_status): New static variables.
14349 (ns_run_ascript): New function.
14350 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
14351 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14352 the event loop. Get status from as_status (Bug#7276).
14353
14354 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14355 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14356 the event loop (Bug#7276).
14357
14358 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14359
14360 * gnutls.c (QCgnutls_bootprop_priority)
14361 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14362 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14363 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14364 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14365 (QCgnutls_bootprop_verify_hostname_error)
14366 (QCgnutls_bootprop_callbacks_verify): Rename from
14367 Qgnutls_bootprop_..., all uses changed.
14368
14369 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14370 uses changed.
14371
14372 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14373
14374 * xfaces.c (Qframe_set_background_mode): Now static.
14375 * dispextern.h (Qframe_set_background_mode): Remove decl.
14376
14377 * process.c (Fnetwork_interface_info): Declare local only if needed.
14378
14379 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14380
14381 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14382 (Fnetwork_interface_list): Allocate in increments of bytes instead
14383 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14384 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14385 sockaddr.
14386 (struct ifflag_def): notrailers is smart on OSX.
14387 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14388 Get hardware address with getifaddrs if available.
14389
14390 2011-08-12 Eli Zaretskii <eliz@gnu.org>
14391
14392 * xdisp.c (iterate_out_of_display_property): xassert that
14393 IT->position is set to within IT->object's boundaries. Break from
14394 the loop as soon as EOB is reached; avoids infloops in redisplay
14395 when IT->position is set up wrongly due to some bug.
14396 Set IT->current to match the bidi iterator unconditionally.
14397 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14398 entry. Force push_it to save on the stack the current
14399 buffer/string position, to be restored by pop_it. Fix flags in
14400 the iterator structure wrt the object coming from a display
14401 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14402 properties. (Bug#9284)
14403
14404 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
14405
14406 * fontset.c (fontset_get_font_group): Add proper type checks.
14407 (Bug#9172)
14408
14409 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14410
14411 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14412 and LC_VERSION_MIN_MACOSX.
14413 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14414 (dump_it) [LC_FUNCTION_STARTS]: Use it.
14415
14416 2011-08-08 Eli Zaretskii <eliz@gnu.org>
14417
14418 * xdisp.c (forward_to_next_line_start): Allow to use the
14419 no-display-properties-and-no-overlays under bidi display.
14420 Set disp_pos in the bidi iterator to avoid searches for display
14421 properties and overlays.
14422
14423 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
14424
14425 * editfns.c (Fset_time_zone_rule): Document relationship with the
14426 setenv function.
14427
14428 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14429 the font entity extracted from the cache (Bug#8109).
14430
14431 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
14432
14433 * composite.c (autocmp_chars): Don't reset point. That is done by
14434 restore_point_unwind (Bug#5984).
14435
14436 2011-08-07 Juri Linkov <juri@jurta.org>
14437
14438 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14439 to show the arg `TIME' instead of `TIMEVAL'.
14440
14441 2011-08-06 Eli Zaretskii <eliz@gnu.org>
14442
14443 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14444 display property strides EOL and includes a newline, as in
14445 longlines-mode. (Bug#9254)
14446 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14447 word-wrap under bidirectional display. (Bug#9224)
14448
14449 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14450 is non-zero, even if the data buffer is NULL. Fixes a crash in
14451 vertical-motion with longlines-mode. (Bug#9254)
14452
14453 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14454
14455 * bidi.c <bidi_cache_total_alloc>: Now static.
14456 (bidi_initialize): Initialize bidi_cache_total_alloc.
14457
14458 * xdisp.c (display_line): Release buffer allocated for shelved bidi
14459 cache. (Bug#9221)
14460
14461 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14462 amount allocated this far in `bidi_cache_total_alloc'.
14463 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14464 non-zero, only free the data buffer without restoring the cache
14465 contents. All callers changed.
14466
14467 * dispextern.h (bidi_unshelve_cache): Update prototype.
14468
14469 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14470 (move_it_in_display_line, move_it_to)
14471 (move_it_vertically_backward, move_it_by_lines): Replace the call
14472 to xfree to an equivalent call to bidi_unshelve_cache.
14473 (move_it_in_display_line_to): Fix logic of returning
14474 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
14475
14476 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14477
14478 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14479 came from a string character with a `cursor' property. (Bug#9229)
14480
14481 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14482
14483 * Makefile.in (LIB_PTHREAD): New variable.
14484 (LIBES): Add LIB_PTHREAD (Bug#9216).
14485
14486 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14487 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14488
14489 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14490
14491 * regex.c (re_iswctype): Remove some redundant boolean conversions.
14492
14493 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14494
14495 * xterm.c (x_find_topmost_parent): New function.
14496 (x_set_frame_alpha): Find topmost parent window with
14497 x_find_topmost_parent and set the property there also (bug#9181).
14498 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14499
14500 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14501
14502 * callproc.c (Fcall_process): Avoid vfork clobbering
14503 the local vars buffer, coding_systems, current_dir.
14504
14505 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14506
14507 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14508
14509 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14510
14511 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14512 so that it is not optimized away.
14513
14514 * xdisp.c (compute_display_string_pos): Remove unused local.
14515
14516 2011-08-02 Eli Zaretskii <eliz@gnu.org>
14517
14518 Fix slow cursor motion and scrolling in large buffers with
14519 selective display, like Org Mode buffers. (Bug#9218)
14520
14521 * dispextern.h (struct bidi_it): New member disp_prop_p.
14522
14523 * xdisp.c: Remove one-slot cache of display string positions.
14524 (compute_display_string_pos): Accept an additional argument
14525 DISP_PROP_P; callers changed. Scan at most 5K characters forward
14526 for a display string or property. If found, set DISP_PROP_P
14527 non-zero.
14528
14529 * bidi.c (bidi_fetch_char): Accept an additional argument
14530 DISP_PROP_P, and pass it to compute_display_string_pos.
14531 Only handle text covered by a display string if DISP_PROP_P is returned
14532 non-zero. All callers of bidi_fetch_char changed.
14533
14534 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14535
14536 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14537
14538 2010-12-03 Don March <don@ohspite.net>
14539
14540 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14541 last character M-[char] is translated to ESC [char] (bug#7541).
14542
14543 2011-08-02 Kenichi Handa <handa@m17n.org>
14544
14545 * lisp.h (uniprop_table): Extern it.
14546
14547 * chartab.c (uniprop_table): Make it non-static.
14548
14549 2011-08-01 Eli Zaretskii <eliz@gnu.org>
14550
14551 * xdisp.c (forward_to_next_line_start): Accept additional argument
14552 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14553 on the newline.
14554 (reseat_at_next_visible_line_start): Use the bidi iterator state
14555 returned by forward_to_next_line_start to restore the state of
14556 it->bidi_it after backing up to previous newline. (Bug#9212)
14557
14558 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14559
14560 * regex.c (re_comp): Protoize.
14561 (re_exec): Fix return type.
14562 (regexec): Fix type of `ret'. (Bug#9203)
14563
14564 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14565
14566 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14567 This is needed if max-image-size is a floating-point number.
14568
14569 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14570
14571 * print.c (print_object): Print empty symbol as ##.
14572
14573 * lread.c (read1): Read ## as empty symbol.
14574
14575 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14576
14577 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14578 setting frame foreground color (Bug#9175).
14579 (x_set_background_color): Likewise.
14580
14581 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14582 contents (Bug#9176).
14583 (EmacsTooltip -init): Remove bezels and add shadows to
14584 tooltip windows.
14585
14586 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14587 or scroll bar (Bug#8470).
14588
14589 * nsfont.m (nsfont_open): Remove assignment to voffset and
14590 unnecessary vars hshink, expand, hd, full_height, min_height.
14591 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14592
14593 * nsterm.h (nsfont_info): Remove voffset field.
14594
14595 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14596
14597 Implement strike-through and overline on NextStep (Bug#8863).
14598
14599 * nsfont.m (nsfont_open): Use underline position provided by font,
14600 instead of hard-coded value of 2.
14601 (nsfont_draw): Call ns_draw_text_decoration instead.
14602
14603 * nsterm.h: Add declaration for ns_draw_text_decoration.
14604
14605 * nsterm.m (ns_draw_text_decoration): New function for drawing
14606 underline, overline, and strike-through.
14607 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14608 ns_draw_text_decoration. Change treatment of cursor drawing to
14609 accommodate underlining, etc.
14610
14611 2011-07-28 Eli Zaretskii <eliz@gnu.org>
14612
14613 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14614 default.
14615
14616 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14617
14618 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14619 Without this fix, if a signal arrives just after memory fills up,
14620 'malloc' might be invoked reentrantly.
14621
14622 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14623 In other words, assume that every image size is allowed, on non-X
14624 hosts. This assumption is probably wrong, but it lets Emacs compile.
14625
14626 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14627
14628 * regex.c (re_iswctype): Convert return values to boolean.
14629
14630 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14631
14632 * xdisp.c (compute_display_string_pos): Don't use cached display
14633 string position if the buffer had its restriction changed.
14634 (Bug#9184)
14635
14636 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14637
14638 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14639
14640 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14641
14642 Integer signedness and overflow and related fixes. (Bug#9079)
14643
14644 * bidi.c: Integer size and overflow fixes.
14645 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14646 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14647 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14648 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14649 (bidi_find_other_level_edge):
14650 Use ptrdiff_t instead of EMACS_INT where either will do.
14651 This works better on 32-bit hosts configured --with-wide-int.
14652 (bidi_cache_ensure_space): Check for size-calculation overflow.
14653 Use % rather than repeated addition, for better worst-case speed.
14654 Don't set bidi_cache_size until after xrealloc returns, because it
14655 might not return.
14656 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14657 (bidi_cache_ensure_space): Also check that the bidi cache size
14658 does not exceed that of the largest Lisp string or buffer. See Eli
14659 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14660
14661 * alloc.c (__malloc_size_t): Remove.
14662 All uses replaced by size_t. See Andreas Schwab's note
14663 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14664
14665 * image.c: Improve checking for integer overflow.
14666 (check_image_size): Assume that f is nonnull, since
14667 it is always nonnull in practice. This is one less thing to
14668 worry about when checking for integer overflow later.
14669 (x_check_image_size): New function, which checks for integer
14670 overflow issues inside X.
14671 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14672 This removes the need for a memory_full check.
14673 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14674 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14675 (xbm_read_bitmap_data): Change locals back to 'int', since
14676 their values must fit in 'int'.
14677 (xpm_load_image, png_load, tiff_load):
14678 Invoke x_create_x_image_and_pixmap earlier,
14679 to avoid much needless work if the image is too large.
14680 (tiff_load): Treat overly large images as if
14681 x_create_x_image_and_pixmap failed, not as malloc failures.
14682 (gs_load): Use x_check_image_size.
14683
14684 * gtkutil.c: Omit integer casts.
14685 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14686 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14687
14688 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14689
14690 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14691 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14692 would wrongly return t on a 64-bit host.
14693
14694 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14695 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14696 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14697 and therefore cause GCC to emit a bogus diagnostic in some cases.
14698
14699 * image.c: Integer signedness and overflow and related fixes.
14700 This is not an exhaustive set of fixes, but it's time to
14701 record what I've got.
14702 (lookup_pixel_color, check_image_size): Remove redundant decls.
14703 (check_image_size): Don't assume that arbitrary EMACS_INT values
14704 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14705 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14706 (tiff_load, imagemagick_load_image):
14707 Check for overflow in size calculations.
14708 (x_create_x_image_and_pixmap): Remove unnecessary test for
14709 xmalloc returning NULL; that can't happen.
14710 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14711 (xpm_color_bucket): Use better integer hashing function.
14712 (xpm_cache_color): Don't possibly over-allocate memory.
14713 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14714 (gif_memory_source):
14715 Use ptrdiff_t, not int or size_t, to record sizes.
14716 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14717 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14718 either works, as we prefer signed integers.
14719 (tiff_read_from_memory, tiff_write_from_memory):
14720 Return tsize_t, not size_t, since that's what the TIFF API wants.
14721 (tiff_read_from_memory): Don't fail simply because the read would
14722 go past EOF; instead, return a short read.
14723 (tiff_load): Omit no-longer-needed casts.
14724 (Fimagemagick_types): Don't assume size fits into 'int'.
14725
14726 Improve hashing quality when configured --with-wide-int.
14727 * fns.c (hash_string): New function, taken from sxhash_string.
14728 Do not discard information about ASCII character case; this
14729 discarding is no longer needed.
14730 (sxhash-string): Use it. Change sig to match it. Caller changed.
14731 * lisp.h: Declare it.
14732 * lread.c (hash_string): Remove, since we now use fns.c's version.
14733 The fns.c version returns a wider integer if --with-wide-int is
14734 specified, so this should help the quality of the hashing a bit.
14735
14736 * emacs.c: Integer overflow minor fix.
14737 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14738 Define only if GNU_LINUX.
14739 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14740
14741 * dispnew.c: Integer signedness and overflow fixes.
14742 Remove unnecessary forward decls, that were a maintenance hassle.
14743 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14744 All uses changed.
14745 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14746 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14747 (prepare_desired_row, line_draw_cost):
14748 Use int, not unsigned, where either works.
14749 (save_current_matrix, restore_current_matrix):
14750 Use ptrdiff_t, not size_t, where either works.
14751 (init_display): Check for overflow more accurately, and without
14752 relying on undefined behavior.
14753
14754 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14755 Remove, replacing with the new symbols in lisp.h. All uses changed.
14756 * fileio.c (make_temp_name):
14757 * filelock.c (lock_file_1, lock_file):
14758 * xdisp.c (message_dolog):
14759 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14760 Use pMd etc. instead.
14761 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14762 replacing the pWIDE etc. symbols removed from editfns.c.
14763
14764 * keyboard.h (num_input_events): Now uintmax_t.
14765 This is (very slightly) less likely to mess up due to wraparound.
14766 All uses changed.
14767
14768 * buffer.c: Integer signedness fixes.
14769 (alloc_buffer_text, enlarge_buffer_text):
14770 Use ptrdiff_t rather than size_t when either will do, as we prefer
14771 signed integers.
14772
14773 * alloc.c: Integer signedness and overflow fixes.
14774 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14775 (__malloc_size_t): Default to size_t, not to int.
14776 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14777 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14778 Prefer ptrdiff_t to size_t when either would do, as we prefer
14779 signed integers.
14780 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14781 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14782 Now const. Initialize with values that are in range even if char
14783 is signed.
14784 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14785 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14786 These functions do the right thing with sizes > 2**32.
14787 (check_depth): Now ptrdiff_t, not int.
14788 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14789 Adjust to new way of storing sizes. Check for size overflow bugs
14790 in rest of code.
14791 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14792 slightly wrong anyway, as it missed one instance of
14793 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14794 (refill_memory_reserve): Omit needless cast to size_t.
14795 (mark_object_loop_halt): Mark as externally visible.
14796
14797 * xselect.c: Integer signedness and overflow fixes.
14798 (Fx_register_dnd_atom, x_handle_dnd_message):
14799 Use ptrdiff_t, not size_t, since we prefer signed.
14800 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14801 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14802 x_dnd_atoms_size and x_dnd_atoms_length.
14803
14804 * doprnt.c: Prefer signed to unsigned when either works.
14805 * eval.c (verror):
14806 * doprnt.c (doprnt):
14807 * lisp.h (doprnt):
14808 * xdisp.c (vmessage):
14809 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14810 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14811 prefer signed arithmetic to avoid comparison confusion.
14812 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14813 but is a bit tricky.
14814
14815 Assume freestanding C89 headers, string.h, stdlib.h.
14816 * data.c, doprnt.c, floatfns.c, print.c:
14817 Include float.h unconditionally.
14818 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14819 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14820 * regex.c: Likewise for stddef.h, string.h.
14821 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14822 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14823 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14824 (STDC_HEADERS): Remove obsolete defines.
14825 * sysdep.c: Include limits.h unconditionally.
14826
14827 Assume support for memcmp, memcpy, memmove, memset.
14828 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14829 * regex.c (memcmp, memcpy):
14830 Remove; we assume C89 now.
14831
14832 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14833 (__malloc_safe_bcopy): Remove; no longer needed.
14834
14835 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14836 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14837 well either way, and we prefer signed to unsigned.
14838
14839 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14840
14841 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14842 closes the connection while we're reading (bug#9182).
14843
14844 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14845
14846 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14847 are specified (Bug#9168).
14848
14849 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14850
14851 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14852 Found by GCC static checking and --with-wide-int on a 32-bit host.
14853
14854 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14855
14856 * xdisp.c (compute_display_string_pos): Fix logic of caching
14857 previous display string position. Initialize cached_prev_pos to
14858 -1. Fixes slow-down at the beginning of a buffer.
14859
14860 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14861
14862 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14863 for attrs[LFACE_FONTSET_INDEX].
14864
14865 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14866
14867 * xml.c (parse_region): Remove unused local
14868 that was recently introduced.
14869
14870 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14871
14872 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14873 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14874
14875 * xdisp.c (move_it_in_display_line_to): Record the best matching
14876 position for TO_CHARPOS while scanning the line, and restore it on
14877 exit if none of the characters scanned was an exact match.
14878 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14879 when exact match is impossible due to invisible text, and the
14880 lines are truncated.
14881
14882 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14883
14884 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14885 for OSX >= 10.7.
14886
14887 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14888
14889 Fix a significant slow-down of cursor motion with C-n, C-p,
14890 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14891 auto-repeat under bidi redisplay in fontified buffers.
14892 * xdisp.c (compute_stop_pos_backwards): New function.
14893 (next_element_from_buffer): Call compute_stop_pos_backwards to
14894 find a suitable prev_stop when we find ourselves before
14895 base_level_stop.
14896 (reseat): Don't look for prev_stop, as that could mean a very long
14897 run.
14898 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14899 <cached_disp_overlay_modiff>: Cache for last found display string
14900 position.
14901 (compute_display_string_pos): Return the cached position if asked
14902 about the same buffer in the same area of character positions, and
14903 the buffer wasn't changed since the time the display string
14904 position was cached.
14905
14906 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14907
14908 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14909 is an integer, which is important for empty lines. (Bug#9149)
14910
14911 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14912
14913 * frame.c (Fmodify_frame_parameters): In tty case, update the
14914 default face if necessary (Bug#4238).
14915
14916 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
14917
14918 * editfns.c (Fstring_to_char): No need to explain what a character
14919 is in the docstring (Bug#6576).
14920
14921 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14922
14923 * xml.c (parse_region): Make sure we always return a tree.
14924
14925 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14926
14927 * xml.c (parse_region): If a document contains only comments,
14928 return that, too.
14929
14930 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14931
14932 * xml.c (make_dom): Return comments, too.
14933
14934 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14935
14936 Port to OpenBSD.
14937 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14938 and the surrounding thread.
14939 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14940 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14941 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14942 timer goes off.
14943 * s/openbsd.h (BROKEN_SIGIO): Define.
14944 * unexelf.c (unexec) [__OpenBSD__]:
14945 Don't update the .mdebug section of the Alpha COFF symbol table.
14946
14947 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14948
14949 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14950 (bug#8460).
14951
14952 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14953
14954 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14955 This fixes some race conditions on the permissions of any newly
14956 created file.
14957
14958 * alloc.c (valid_pointer_p): Use pipe, not open.
14959 This fixes some permissions issues when debugging.
14960
14961 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14962 If fchown fails to set both uid and gid, try to set just gid,
14963 as that is sometimes allowed. Adjust the file's mode to eliminate
14964 setuid or setgid bits that are inappropriate if fchown fails.
14965
14966 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14967
14968 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14969 to compare Lisp_Objects.
14970 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14971 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14972 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14973
14974 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14975
14976 * lread.c (read_integer): Unread even EOF character.
14977 (read1): Likewise. Properly record start position of symbol.
14978
14979 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14980 symbol character follows.
14981
14982 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14983
14984 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14985 This works around a problem with the previous change to Fcopy_file.
14986 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14987 and without this change, GCC might complain about discarding
14988 fchown's return value.
14989
14990 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
14991
14992 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14993
14994 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14995
14996 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14997
14998 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14999
15000 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
15001 it's used from the C level.
15002
15003 * process.c: Use the same condition for POLL_FOR_INPUT in both
15004 keyboard.c and process.c (bug#1858).
15005
15006 2011-07-09 Lawrence Mitchell <wence@gmx.li>
15007
15008 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
15009 (Fgnutls_boot): Use it.
15010
15011 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
15012
15013 * doc.c (Fsubstitute_command_keys): Revert last change.
15014
15015 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
15016
15017 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
15018 quotes the next character, and doesn't affect other longer
15019 sequences (bug#8935).
15020
15021 * lread.c (syms_of_lread): Clarify that is isn't only
15022 `eval-buffer' and `eval-defun' that's affected by
15023 `lexical-binding' (bug#8460).
15024
15025 2011-07-15 Eli Zaretskii <eliz@gnu.org>
15026
15027 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
15028 bidi redisplay when a line includes both an image and is truncated.
15029
15030 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
15031
15032 Fix minor problems found by static checking.
15033 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
15034 (elsz): Now a signed constant, not a size_t var. We prefer signed
15035 types to unsigned, to avoid integer comparison confusion. Without
15036 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
15037 "cannot optimize loop, the loop counter may overflow", a symptom
15038 of the confusion.
15039 * indent.c (Fvertical_motion): Mark locals as initialized.
15040 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
15041
15042 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15043
15044 * search.c (Fre_search_backward): Mention `case-fold-search' in
15045 all the re_search_* functions (bug#8138).
15046
15047 * keyboard.c (Fopen_dribble_file): Document when the file is
15048 closed (bug#8056).
15049
15050 2011-07-14 Eli Zaretskii <eliz@gnu.org>
15051
15052 * bidi.c (bidi_dump_cached_states): Fix format of displaying
15053 bidi_cache_idx.
15054
15055 Support bidi reordering of display and overlay strings.
15056 * xdisp.c (compute_display_string_pos)
15057 (compute_display_string_end): Accept additional argument STRING.
15058 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
15059 (reseat_to_string): Initialize bidi_it->string.s and
15060 bidi_it->string.schars.
15061 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
15062 NULL (avoids a crash in bidi_paragraph_init).
15063 Initialize itb.string.lstring.
15064 (init_iterator): Call bidi_init_it only of a valid
15065 buffer position was specified. Initialize paragraph_embedding to
15066 L2R.
15067 (reseat_to_string): Initialize the bidi iterator.
15068 (display_string): If we need to ignore text properties of
15069 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
15070 original value of -1 will not work with bidi.)
15071 (compute_display_string_pos): First arg is now struct
15072 `text_pos *'; all callers changed. Support display properties on
15073 Lisp strings.
15074 (compute_display_string_end): Support display properties on Lisp
15075 strings.
15076 (init_iterator, reseat_1, reseat_to_string): Initialize the
15077 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
15078 when iterating on a string not from display properties).
15079 (compute_display_string_pos, compute_display_string_end):
15080 Fix calculation of the object to scan. Fixes an error when using
15081 arrow keys.
15082 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
15083 base_level_stop; instead, set base_level_stop to BEGV.
15084 Fixes crashes in vertical-motion.
15085 (next_element_from_buffer): Improve commentary for when
15086 the iterator is before prev_stop.
15087 (init_iterator): Initialize bidi_p from the default value of
15088 bidi-display-reordering, not from buffer-local value. Use the
15089 buffer-local value only if initializing for buffer iteration.
15090 (handle_invisible_prop): Support invisible properties on strings
15091 that are being bidi-reordered.
15092 (set_iterator_to_next): Support bidi reordering of C strings and
15093 Lisp strings.
15094 (next_element_from_string): Support bidi reordering of Lisp
15095 strings.
15096 (handle_stop_backwards): Support Lisp strings as well.
15097 (display_string): Support display of R2L glyph rows.
15098 Use IT_STRING_CHARPOS when displaying from a Lisp string.
15099 (init_iterator): Don't initialize it->bidi_p for strings
15100 here.
15101 (reseat_to_string): Initialize it->bidi_p for strings here.
15102 (next_element_from_string, next_element_from_c_string)
15103 (next_element_from_buffer): Add xassert's for correspondence
15104 between IT's object being iterated and it->bidi_it.string
15105 structure.
15106 (face_before_or_after_it_pos): Support bidi iteration.
15107 (next_element_from_c_string): Handle the case of the first string
15108 character that is not the first one in the visual order.
15109 (get_visually_first_element): New function, refactored from common
15110 parts of next_element_from_buffer, next_element_from_string, and
15111 next_element_from_c_string.
15112 (tool_bar_lines_needed, redisplay_tool_bar)
15113 (display_menu_bar): Force left-to-right direction. Add a FIXME
15114 comment for making that be controlled by a user option.
15115 (push_it, pop_it): Save and restore the state of the
15116 bidi iterator. Save and restore the bidi_p flag.
15117 (pop_it): Iterate out of display property for string iteration as
15118 well.
15119 (iterate_out_of_display_property): Support iteration over strings.
15120 (handle_single_display_spec): Set up it->bidi_it for iteration
15121 over a display string, and call bidi_init_it.
15122 (handle_single_display_spec, next_overlay_string)
15123 (get_overlay_strings_1, push_display_prop): Set up the bidi
15124 iterator for displaying display or overlay strings.
15125 (forward_to_next_line_start): Don't use the shortcut if
15126 bidi-iterating.
15127 (back_to_previous_visible_line_start): If handle_display_prop
15128 pushed the iterator stack, restore the internal state of the bidi
15129 iterator by calling bidi_pop_it same number of times.
15130 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
15131 and we are bidi-iterating, don't decrement the iterator position;
15132 instead, set the first_elt flag in the bidi iterator, to produce
15133 the same effect.
15134 (reseat_1): Remove redundant setting of string_from_display_prop_p.
15135 (push_display_prop): xassert that we are iterating a buffer.
15136 (push_it, pop_it): Save and restore paragraph_embedding member.
15137 (handle_single_display_spec, next_overlay_string)
15138 (get_overlay_strings_1, reseat_1, reseat_to_string)
15139 (push_display_prop): Set up the `unibyte' member of bidi_it.string
15140 correctly. Don't assume unibyte strings are not bidi-reordered.
15141 (compute_display_string_pos)
15142 (compute_display_string_end): Fix handling the case of C string.
15143 (push_it, pop_it): Save and restore from_disp_prop_p.
15144 (handle_single_display_spec, push_display_prop): Set the
15145 from_disp_prop_p flag.
15146 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
15147 (pop_it): Call iterate_out_of_display_property only if we are
15148 popping after iteration over a string that came from a display
15149 property. Fix a typo in popping stretch info. Add an assertion
15150 for verifying that the iterator position is in sync with the bidi
15151 iterator.
15152 (handle_single_display_spec, get_overlay_strings_1)
15153 (push_display_prop): Fix initialization of paragraph direction for
15154 string when that of the parent object is not yet determined.
15155 (reseat_1): Call bidi_init_it to resync the bidi
15156 iterator with IT's position. (Bug#7616)
15157 (find_row_edges): If ROW->start.pos gives position
15158 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
15159 (handle_stop, back_to_previous_visible_line_start, reseat_1):
15160 Reset the from_disp_prop_p flag.
15161 (SAVE_IT, RESTORE_IT): New macros.
15162 (pos_visible_p, face_before_or_after_it_pos)
15163 (back_to_previous_visible_line_start)
15164 (move_it_in_display_line_to, move_it_in_display_line)
15165 (move_it_to, move_it_vertically_backward, move_it_by_lines)
15166 (try_scrolling, redisplay_window, display_line): Use them when
15167 saving a temporary copy of the iterator and restoring it back.
15168 (back_to_previous_visible_line_start, reseat_1)
15169 (init_iterator): Empty the bidi cache "stack".
15170 (move_it_in_display_line_to): If iterator ended up at
15171 EOL, but we never saw any buffer positions smaller than
15172 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
15173 motion in bidi-reordered lines.
15174 (move_it_in_display_line_to): Record prev_method and prev_pos
15175 immediately before the call to set_iterator_to_next. Fixes cursor
15176 motion in bidi-reordered lines with stretch glyphs and strings
15177 displayed in margins. (Bug#8133) (Bug#8867)
15178 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
15179 TO_CHARPOS.
15180 (pos_visible_p): Support positions in bidi-reordered lines.
15181 Save and restore bidi cache.
15182
15183 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
15184 (bidi_paragraph_info): Delete unused struct.
15185 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
15186 (bidi_cache_start): New variable.
15187 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
15188 to zero.
15189 (bidi_cache_fetch_state, bidi_cache_search)
15190 (bidi_cache_find_level_change, bidi_cache_iterator_state)
15191 (bidi_cache_find, bidi_peek_at_next_level)
15192 (bidi_level_of_next_char, bidi_find_other_level_edge)
15193 (bidi_move_to_visually_next): Compare cache index with
15194 bidi_cache_start rather than with zero.
15195 (bidi_fetch_char): Accept new argument STRING; all callers
15196 changed. Support iteration over a string. Support strings with
15197 display properties. Support unibyte strings. Fix the type of
15198 `len' according to what STRING_CHAR_AND_LENGTH expects.
15199 (bidi_paragraph_init, bidi_resolve_explicit_1)
15200 (bidi_resolve_explicit, bidi_resolve_weak)
15201 (bidi_level_of_next_char, bidi_move_to_visually_next):
15202 Support iteration over a string.
15203 (bidi_set_sor_type, bidi_resolve_explicit_1)
15204 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
15205 can now be zero (for strings); special values 0 and -1 were
15206 changed to -1 and -2, respectively.
15207 (bidi_char_at_pos): New function.
15208 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
15209 Call it instead of FETCH_MULTIBYTE_CHAR.
15210 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
15211 initialized to valid values.
15212 (bidi_init_it): Don't initialize charpos and bytepos with invalid
15213 values.
15214 (bidi_level_of_next_char): Allow the sentinel "position" to pass
15215 the test for valid cached positions. Fix the logic for looking up
15216 the sentinel state in the cache. GCPRO the Lisp string we are
15217 iterating.
15218 (bidi_push_it, bidi_pop_it): New functions.
15219 (bidi_initialize): Initialize the bidi cache start stack pointer.
15220 (bidi_cache_ensure_space): New function, refactored from part of
15221 bidi_cache_iterator_state. Don't assume the required size is just
15222 one BIDI_CACHE_CHUNK away.
15223 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
15224 (bidi_count_bytes, bidi_char_at_pos): New functions.
15225 (bidi_cache_search): Don't assume bidi_cache_last_idx is
15226 always valid if bidi_cache_idx is valid.
15227 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
15228 is valid if it's going to be used.
15229 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
15230 (bidi_cache_fetch_state, bidi_cache_search)
15231 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15232 (bidi_cache_iterator_state, bidi_cache_find)
15233 (bidi_find_other_level_edge, bidi_cache_start_stack):
15234 All variables related to cache indices are now EMACS_INT.
15235
15236 * dispextern.h (struct bidi_string_data): New structure.
15237 (struct bidi_it): New member `string'. Make flag members be 1-bit
15238 fields, and put them last in the struct.
15239 (compute_display_string_pos, compute_display_string_end):
15240 Update prototypes.
15241 (bidi_push_it, bidi_pop_it): Add prototypes.
15242 (struct iterator_stack_entry): New members bidi_p,
15243 paragraph_embedding, and from_disp_prop_p.
15244 (struct it): Member bidi_p is now a bit field 1 bit wide.
15245 (bidi_shelve_cache, bidi_unshelve_cache):
15246 Declare prototypes.
15247
15248 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15249 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15250 and vector-like objects.
15251
15252 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15253 cache around display iteration.
15254
15255 * window.c (Fwindow_end, window_scroll_pixel_based)
15256 (displayed_window_lines, Frecenter): Save and restore the bidi
15257 cache around display iteration.
15258
15259 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15260
15261 * editfns.c (Fdelete_region): Clarify the use of the named
15262 parameters (bug#6788).
15263
15264 2011-07-14 Martin Rudalics <rudalics@gmx.at>
15265
15266 * indent.c (Fvertical_motion): Set and restore w->pointm when
15267 saving and restoring the window's buffer (Bug#9006).
15268
15269 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15270
15271 * editfns.c (Fstring_to_char): Clarify just what is returned
15272 (bug#6576). Text by Eli Zaretskii.
15273
15274 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
15275
15276 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15277
15278 2011-07-13 Eli Zaretskii <eliz@gnu.org>
15279
15280 * buffer.c (mmap_find): Fix a typo.
15281
15282 2011-07-13 Johan Bockgård <bojohan@gnu.org>
15283
15284 Fix execution of x selection hooks.
15285 * xselect.c (Qx_lost_selection_functions)
15286 (Qx_sent_selection_functions): New vars.
15287 (syms_of_xselect): DEFSYM them.
15288 (x_handle_selection_request): Pass Qx_sent_selection_functions
15289 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15290 (x_handle_selection_clear,x_clear_frame_selections):
15291 Pass Qx_lost_selection_functions rather than
15292 Vx_lost_selection_functions to Frun_hook_with_args.
15293
15294 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15295
15296 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
15297 The old code sometimes used this field without initializing it.
15298
15299 * alloc.c (gc_sweep): Don't read past end of array.
15300 In theory, the old code could also have corrupted Emacs internals,
15301 though it'd be very unlikely.
15302
15303 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15304
15305 * character.c (Fcharacterp): Don't advertise optional ignored
15306 argument. (Bug#4026)
15307
15308 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15309
15310 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15311 key" (bug#4257).
15312
15313 * window.c (Fset_window_start): Doc fix (bug#4199).
15314 (Fset_window_hscroll): Ditto.
15315
15316 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15317
15318 Fix minor new problems caught by GCC 4.6.1.
15319 * term.c (init_tty): Remove unused local.
15320 * xsettings.c (store_monospaced_changed): Define this function only
15321 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
15322 not used otherwise.
15323
15324 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
15325
15326 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15327
15328 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15329
15330 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15331 are the mini-buffer and the echo area (bug#3320).
15332
15333 * term.c (init_tty): Remove support for supdup, c10 and perq
15334 terminals, which are no longer supported (bug#1482).
15335
15336 2011-07-10 Johan Bockgård <bojohan@gnu.org>
15337
15338 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15339
15340 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15341
15342 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15343 for non-popups (Bug#3642).
15344
15345 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15346
15347 * alloc.c (reset_malloc_hooks): Protoize.
15348 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
15349 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15350 * cm.c (losecursor): Likewise.
15351 * data.c (fmod): Likewise.
15352 * dispnew.c (swap_glyphs_in_rows): Likewise.
15353 * emacs.c (memory_warning_signal): Likewise.
15354 * floatfns.c (float_error): Likewise.
15355 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15356 (otf_open, font_otf_capability, generate_otf_features)
15357 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15358 Likewise.
15359 * image.c (pbm_read_file): Likewise.
15360 * indent.c (string_display_width): Likewise.
15361 * intervals.c (check_for_interval, search_for_interval)
15362 (inc_interval_count, count_intervals, root_interval)
15363 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15364 * lread.c (defalias): Likewise.
15365 * ralloc.c (r_alloc_check): Likewise.
15366 * regex.c (set_image_of_range_1, set_image_of_range)
15367 (regex_grow_registers): Likewise.
15368 * sysdep.c (strerror): Likewise.
15369 * termcap.c (valid_filename_p, tprint, main): Likewise.
15370 * tparam.c (main): Likewise.
15371 * unexhp9k800.c (run_time_remap, save_data_space)
15372 (update_file_ptrs, read_header, write_header, calculate_checksum)
15373 (copy_file, copy_rest, display_header): Likewise.
15374 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15375 Likewise.
15376 * xdisp.c (check_it): Likewise.
15377 * xfaces.c (register_color, unregister_color, unregister_colors):
15378 Likewise.
15379 * xfns.c (print_fontset_result): Likewise.
15380 * xrdb.c (member, fatal, main): Likewise.
15381
15382 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15383
15384 Fix minor problems found by static checking (Bug#9031).
15385 * chartab.c (char_table_set_range, map_sub_char_table):
15386 Remove unused locals.
15387 (uniprop_table): Now static.
15388 * composite.c (_work_char): Remove unused static var.
15389
15390 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
15391
15392 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15393
15394 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15395
15396 * gtkutil.c (qttip_cb): Remove code without function.
15397
15398 2011-07-09 Eli Zaretskii <eliz@gnu.org>
15399
15400 * w32.c (pthread_sigmask): New stub.
15401
15402 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
15403
15404 Use pthread_sigmask, not sigprocmask (Bug#9010).
15405 sigprocmask is portable only for single-threaded applications, and
15406 Emacs can be multi-threaded when it uses GTK.
15407 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15408 (LIBES): Use it.
15409 * callproc.c (Fcall_process):
15410 * process.c (create_process):
15411 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15412 Use pthread_sigmask, not sigprocmask.
15413
15414 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15415
15416 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15417 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15418 wrong (Bug#8591).
15419
15420 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15421
15422 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15423 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15424 (xg_hide_tooltip): Fix comment.
15425
15426 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15427 in registerServicesMenuSendTypes.
15428 (validRequestorForSendType): Don't check ns_return_types.
15429
15430 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15431 ns_return_type.
15432
15433 2011-07-08 Jason Rumney <jasonr@gnu.org>
15434
15435 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15436 SH_SHOW for hidden windows (Bug#5482).
15437
15438 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15439 frame struct members of non-existent frames (Bug#6284).
15440
15441 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15442
15443 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15444 variable firstTime not needed on OSX >= 10.6.
15445 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15446 >= 10.5. Use setKnobProportion, setDoubleValue.
15447
15448 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15449 (MAC_OS_X_VERSION_10_5): Define if not defined.
15450 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15451 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15452 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15453
15454 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
15455 cString and lossyCString on OSX >= 10.4.
15456
15457 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
15458 sizeToFit on OSX >= 10.2.
15459
15460 * nsimage.m (allocInitFromFile): Don't use deprecated method
15461 bestRepresentationForDevice on OSX >= 10.6.
15462
15463 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15464 to avoid warning.
15465
15466 * emacs.c: Declare unexec_init_emacs_zone.
15467
15468 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15469
15470 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15471
15472 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15473 on svcsMenu (Bug#8842).
15474
15475 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15476 ns_return_types.
15477 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15478
15479 * nsterm.m (QUTF8_STRING): Declare.
15480 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15481 (validRequestorForSendType): Return type is (id).
15482 Change indexOfObjectIdenticalTo to indexOfObject.
15483 Check if we have local selection before returning self (Bug#8842).
15484 (writeSelectionToPasteboard): Put local selection into paste board
15485 if we have a local selection (Bug#8842).
15486 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15487
15488 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15489 (ns_get_local_selection): Declare.
15490
15491 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15492
15493 * keymap.c (describe_map_tree): Don't insert a double newline at
15494 the end of the buffer (bug#1169) and return whether we inserted
15495 something.
15496
15497 * callint.c (Fcall_interactively): Change "reading args" to
15498 "providing args" to try to clarify what it does (bug#1010).
15499
15500 2011-07-07 Kenichi Handa <handa@m17n.org>
15501
15502 * composite.c (composition_compute_stop_pos): Ignore a static
15503 composition starting before CHARPOS (Bug#8915).
15504
15505 * xdisp.c (handle_composition_prop): Likewise.
15506
15507 2011-07-07 Eli Zaretskii <eliz@gnu.org>
15508
15509 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15510 (Bug#9015)
15511
15512 2011-07-07 Kenichi Handa <handa@m17n.org>
15513
15514 * character.h (unicode_category_t): New enum type.
15515
15516 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15517 (Qchar_code_property_table): New variable.
15518 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15519 (UNIPROP_COMPRESSED_FORM_P): New macros.
15520 (char_table_ascii): Uncompress the compressed values.
15521 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15522 Uncompress the compressed values.
15523 (sub_char_table_ref_and_range): Likewise.
15524 (char_table_ref_and_range): Uncompress the compressed values.
15525 (sub_char_table_set): New arg is_uniprop. Callers changed.
15526 Uncompress the compressed values.
15527 (sub_char_table_set_range): Args changed. Callers changed.
15528 (char_table_set_range): Adjuted for the above change.
15529 (map_sub_char_table): Delete args default_val and parent. Add arg
15530 top. Give decoded values to a Lisp function.
15531 (map_char_table): Adjust for the above change. Give decoded
15532 values to a Lisp function. Gcpro more variables.
15533 (uniprop_table_uncompress)
15534 (uniprop_decode_value_run_length): New functions.
15535 (uniprop_decoder, uniprop_decoder_count): New variables.
15536 (uniprop_get_decoder, uniprop_encode_value_character)
15537 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15538 New functions.
15539 (uniprop_encoder, uniprop_encoder_count): New variables.
15540 (uniprop_get_encoder, uniprop_table)
15541 (Funicode_property_table_internal, Fget_unicode_property_internal)
15542 (Fput_unicode_property_internal): New functions.
15543 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15544 Sunicode_property_table_internal, Sget_unicode_property_internal,
15545 and Sput_unicode_property_internal. Defvar_lisp
15546 char-code-property-alist.
15547
15548 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15549 Vunicode_category_table.
15550
15551 * font.c (font_range): Adjust for the change of
15552 Vunicode_category_table.
15553
15554 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15555
15556 * m/iris4d.h: Remove file, move contents ...
15557 * s/irix6-5.h: ... here.
15558
15559 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15560
15561 Remove unportable assumption about struct layout (Bug#8884).
15562 * alloc.c (mark_buffer):
15563 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15564 (clone_per_buffer_values): Don't assume that
15565 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15566 This isn't true in general, and it's particularly not true
15567 if Emacs is configured with --with-wide-int.
15568 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15569 New macros, used in the buffer.c change.
15570
15571 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15572
15573 * xsettings.c: Use both GConf and GSettings if both are available.
15574 (store_config_changed_event): Add comment.
15575 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15576 (store_tool_bar_style_changed): New functions.
15577 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
15578 (struct xsettings): Move font inside HAVE_XFT.
15579 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15580 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15581 Move inside HAVE_XFT.
15582 (something_changed_gsettingsCB): Rename from something_changedCB.
15583 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15584 also.
15585 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15586 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
15587 (something_changed_gconfCB): Rename from something_changedCB.
15588 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15589 (parse_settings): Move check for font inside HAVE_XFT.
15590 (read_settings, apply_xft_settings): Add comment.
15591 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15592 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15593 call store_font_name_changed.
15594 (xft_settings_event): Add comment.
15595 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15596 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15597 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15598 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15599 (xsettings_initialize): Call init_gsettings last.
15600 (xsettings_get_system_font, xsettings_get_system_normal_font):
15601 Add comment.
15602
15603 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15604
15605 Random fixes. E.g., (random) never returned negative values.
15606 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15607 subseconds part to the entropy, as that's a bit more random.
15608 Prefer signed to unsigned, since the signedness doesn't matter and
15609 in general we prefer signed. When given a limit, use a
15610 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15611 latter isn't right if USE_2_TAGS_FOR_INTS.
15612 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15613 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15614
15615 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15616
15617 * textprop.c (text_property_stickiness):
15618 Obey Vtext_property_default_nonsticky.
15619 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15620 * w32fns.c (syms_of_w32fns):
15621 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15622
15623 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15624
15625 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15626 This is more efficient than Ffile_directory_p and avoids a minor race.
15627
15628 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15629
15630 * buffer.c (Foverlay_put): Say what the return value is
15631 (bug#7835).
15632
15633 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15634 is a directory before asking whether to use the file name
15635 (bug#7564).
15636 (barf_or_query_if_file_exists): Make the "File is a directory"
15637 error be more correct.
15638
15639 * fns.c (Frequire): Remove the mention of the .gz files, since
15640 that's installation-specific, but keep the mention of
15641 `get-load-suffixes'.
15642
15643 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15644
15645 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15646 Report string overflow if the output is too long.
15647
15648 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15649
15650 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15651 (syms_of_gnutls): Remove duplicate DEFSYM for
15652 Qgnutls_bootprop_verify_hostname_error, an error for
15653 Qgnutls_bootprop_verify_error (which is no longer used).
15654
15655 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15656 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15657 Also (re)move comments that are misplaced or no longer relevant.
15658
15659 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15660
15661 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15662
15663 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15664
15665 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15666 and background color parameters if they have been changed.
15667
15668 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15669
15670 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15671
15672 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15673
15674 * xsettings.c (SYSTEM_FONT): Define only when used.
15675 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15676
15677 * keymap.c (access_keymap_1): Now static.
15678
15679 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15680
15681 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15682 leave any prefix arg for the up event (Bug#1586).
15683
15684 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15685
15686 * lread.c (syms_of_lread): Mention single symbols defined by
15687 `defvar' or `defconst' (bug#7154).
15688
15689 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15690 (Frequire): Mention get-load-suffixes.
15691
15692 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15693
15694 * window.h (window): Remove clone_number slot.
15695 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15696 Remove.
15697 (make_parent_window, make_window, saved_window)
15698 (Fset_window_configuration, save_window_save): Don't deal with
15699 clone numbers.
15700 * buffer.c (Qclone_number): Remove declaration.
15701 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15702
15703 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15704
15705 Add multiple inheritance to keymaps.
15706 * keymap.c (Fmake_composed_keymap): New function.
15707 (Fset_keymap_parent): Simplify.
15708 (fix_submap_inheritance): Remove.
15709 (access_keymap_1): New function extracted from access_keymap to handle
15710 embedded parents and handle lists of maps.
15711 (access_keymap): Use it.
15712 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15713 (Fcopy_keymap): Handle embedded parents.
15714 (Fcommand_remapping, define_as_prefix): Simplify.
15715 (Fkey_binding): Simplify.
15716 (syms_of_keymap): Move minibuffer-local-completion-map,
15717 minibuffer-local-filename-completion-map,
15718 minibuffer-local-must-match-map, and
15719 minibuffer-local-filename-must-match-map to Elisp.
15720 (syms_of_keymap): Defsubr make-composed-keymap.
15721 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15722 (parse_menu_item): Trivial simplification.
15723
15724 2011-07-01 Glenn Morris <rgm@gnu.org>
15725
15726 * Makefile.in (SETTINGS_LIBS): Fix typo.
15727
15728 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15729
15730 * coding.c (Fencode_coding_string): Record the last coding system
15731 used, as the function doc string says (bug#8738).
15732
15733 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15734
15735 * xsettings.c (store_monospaced_changed): Take new font as arg and
15736 check for change against current_mono_font.
15737 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15738 (emacs_settings_constructor, emacs_settings_get_property)
15739 (emacs_settings_set_property, emacs_settings_class_init)
15740 (emacs_settings_init, gsettings_obj): Remove.
15741 (something_changedCB): New function for HAVE_GSETTINGS.
15742 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15743 with value as argument.
15744 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15745 g_settings_new (Bug#8967). Do not create gsettings_obj.
15746 Remove calls to g_settings_bind. Connect something_changedCB to
15747 "changed".
15748
15749 * xgselect.c: Add defined (HAVE_GSETTINGS).
15750 (xgselect_initialize): Ditto.
15751
15752 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15753 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15754 xg_select.
15755
15756 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15757
15758 * eval.c (struct backtrace): Simplify and port the data structure.
15759 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15760 signed bit field, as this assumption is not portable and it makes
15761 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15762 "char debug_on_exit : 1" as this is not portable either; instead,
15763 use the portable "unsigned int debug_on_exit : 1". Remove unused
15764 member evalargs. Remove obsolete comments about cc bombing out.
15765
15766 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15767
15768 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15769 Let HAVE_GSETTINGS override HAVE_GCONF.
15770 (store_monospaced_changed): New function.
15771 (EMACS_SETTINGS): A new type derived from GObject to handle
15772 GSettings notifications.
15773 (emacs_settings_constructor, emacs_settings_get_property)
15774 (emacs_settings_set_property, emacs_settings_class_init):
15775 New functions.
15776 (gsettings_client, gsettings_obj): New variables.
15777 (GSETTINGS_SCHEMA): New define.
15778 (something_changedCB): Call store_monospaced_changed.
15779 (init_gsettings): New function.
15780 (xsettings_initialize): Call init_gsettings.
15781 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15782 to NULL.
15783
15784 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15785 GCONF_CFLAGS/LIBS.
15786
15787 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15788
15789 * window.c (resize_root_window, grow_mini_window)
15790 (shrink_mini_window): Rename Qresize_root_window to
15791 Qwindow_resize_root_window and Qresize_root_window_vertically to
15792 Qwindow_resize_root_window_vertically.
15793
15794 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15795
15796 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15797
15798 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15799
15800 * makefile.w32-in: Redesign dependencies so they reflect more
15801 clearly which files are directly included by each source file,
15802 and not through other includes.
15803
15804 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15805
15806 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15807 (sort_overlays, overlay_strings): When an overlay's clone number
15808 matches the window's clone number process the overlay even if
15809 the overlay's window property doesn't match the current window.
15810
15811 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15812 (Fwindow_hchild): Rename to Fwindow_left_child.
15813 (Fwindow_next): Rename to Fwindow_next_sibling.
15814 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15815 (resize_window_check): Rename to window_resize_check.
15816 (resize_window_apply): Rename to window_resize_apply.
15817 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15818 (Fdelete_other_windows_internal, resize_frame_windows)
15819 (Fsplit_window_internal, Fdelete_window_internal)
15820 (grow_mini_window, shrink_mini_window)
15821 (Fresize_mini_window_internal): Fix callers accordingly.
15822
15823 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15824
15825 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15826 (emacs_fixed_set_min_size): Remove.
15827 (emacs_fixed_new): Take frame as argument.
15828
15829 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15830 (_EmacsFixedPrivate): Remove minwidth/height.
15831 Add struct frame *f.
15832 (emacs_fixed_init): Initialize priv->f.
15833 (get_parent_class, emacs_fixed_set_min_size): Remove.
15834 (emacs_fixed_new): Set priv->f to argument.
15835 (emacs_fixed_get_preferred_width)
15836 (emacs_fixed_get_preferred_height): Use min_width/height from
15837 frames size_hint to set minimum and natural (Bug#8919).
15838 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15839 and use min_width/height from frames size_hint to set
15840 min_width/height (Bug#8919).
15841
15842 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15843 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15844 Fix indentation.
15845
15846 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15847
15848 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15849 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15850 called at ZV.
15851
15852 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15853
15854 * process.c (wait_reading_process_output): Bypass select if
15855 waiting for a cell while ignoring keyboard input, and input is
15856 pending. Suggested by Jan Djärv (Bug#8869).
15857
15858 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15859
15860 Use gnulib's dup2 module instead of rolling our own.
15861 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15862
15863 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15864
15865 * dispnew.c (scrolling_window): Before scrolling, turn off a
15866 mouse-highlight in the window being scrolled.
15867
15868 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15869
15870 Move DEFSYM to lisp.h and use everywhere.
15871
15872 * character.h (DEFSYM): Move declaration...
15873 * lisp.h (DEFSYM): ...here.
15874
15875 * gnutls.c:
15876 * minibuf.c:
15877 * w32menu.c:
15878 * w32proc.c:
15879 * w32select.c: Don't include character.h.
15880
15881 * alloc.c (syms_of_alloc):
15882 * buffer.c (syms_of_buffer):
15883 * bytecode.c (syms_of_bytecode):
15884 * callint.c (syms_of_callint):
15885 * casefiddle.c (syms_of_casefiddle):
15886 * casetab.c (init_casetab_once):
15887 * category.c (init_category_once, syms_of_category):
15888 * ccl.c (syms_of_ccl):
15889 * cmds.c (syms_of_cmds):
15890 * composite.c (syms_of_composite):
15891 * dbusbind.c (syms_of_dbusbind):
15892 * dired.c (syms_of_dired):
15893 * dispnew.c (syms_of_display):
15894 * doc.c (syms_of_doc):
15895 * editfns.c (syms_of_editfns):
15896 * emacs.c (syms_of_emacs):
15897 * eval.c (syms_of_eval):
15898 * fileio.c (syms_of_fileio):
15899 * fns.c (syms_of_fns):
15900 * frame.c (syms_of_frame):
15901 * fringe.c (syms_of_fringe):
15902 * insdel.c (syms_of_insdel):
15903 * keymap.c (syms_of_keymap):
15904 * lread.c (init_obarray, syms_of_lread):
15905 * macros.c (syms_of_macros):
15906 * msdos.c (syms_of_msdos):
15907 * print.c (syms_of_print):
15908 * process.c (syms_of_process):
15909 * search.c (syms_of_search):
15910 * sound.c (syms_of_sound):
15911 * syntax.c (init_syntax_once, syms_of_syntax):
15912 * terminal.c (syms_of_terminal):
15913 * textprop.c (syms_of_textprop):
15914 * undo.c (syms_of_undo):
15915 * w32.c (globals_of_w32):
15916 * window.c (syms_of_window):
15917 * xdisp.c (syms_of_xdisp):
15918 * xfaces.c (syms_of_xfaces):
15919 * xfns.c (syms_of_xfns):
15920 * xmenu.c (syms_of_xmenu):
15921 * xsettings.c (syms_of_xsettings):
15922 * xterm.c (syms_of_xterm): Use DEFSYM.
15923
15924 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15925
15926 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15927
15928 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15929
15930 Integer and buffer overflow fixes (Bug#8873).
15931
15932 * print.c (printchar, strout): Check for string overflow.
15933 (PRINTPREPARE, printchar, strout):
15934 Don't set size unless allocation succeeds.
15935
15936 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15937 for sizes. Check for string overflow more accurately.
15938 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15939
15940 * macros.c: Integer and buffer overflow fixes.
15941 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15942 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15943 Use ptrdiff_t, not int, for sizes.
15944 Don't increment bufsize until after realloc succeeds.
15945 Check for size-calculation overflow.
15946 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15947
15948 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15949
15950 * lread.c: Integer overflow fixes.
15951 (read_integer): Radix is now EMACS_INT, not int,
15952 to improve quality of diagnostics for out-of-range radices.
15953 Calculate buffer size correctly for out-of-range radices.
15954 (read1): Check for integer overflow in radices, and in
15955 read-circle numbers.
15956 (read_escape): Avoid int overflow.
15957 (Fload, openp, read_buffer_size, read1)
15958 (substitute_object_recurse, read_vector, read_list, map_obarray):
15959 Use ptrdiff_t, not int, for sizes.
15960 (read1): Use EMACS_INT, not int, for sizes.
15961 Check for size overflow.
15962
15963 * image.c (cache_image): Check for size arithmetic overflow.
15964
15965 * lread.c: Integer overflow issues.
15966 (saved_doc_string_size, saved_doc_string_length)
15967 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15968 Now ptrdiff_t, not int.
15969 (read1): Don't assume doc string length fits in int. Check for
15970 out-of-range doc string lengths.
15971 (read_list): Don't assume file position fits in int.
15972 (read_escape): Check for hex character overflow.
15973
15974 2011-06-22 Leo Liu <sdl.web@gmail.com>
15975
15976 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15977 Move to minibuffer.el.
15978
15979 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15980
15981 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15982 The following patches are for when GLYPH_DEBUG && !XASSERT.
15983 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15984 * dispnew.c (flush_stdout):
15985 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15986 Mark as externally visible.
15987 * dispnew.c (check_window_matrix_pointers): Now static.
15988 * dispnew.c (window_to_frame_vpos):
15989 * xfns.c (unwind_create_frame):
15990 * xterm.c (x_check_font): Remove unused local.
15991 * scroll.c (CHECK_BOUNDS):
15992 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15993 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15994 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15995 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15996 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15997 Now static.
15998 (debug_method_add): Use va_list and vsprintf rather than relying
15999 on undefined behavior with wrong number of arguments.
16000 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
16001 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
16002 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
16003 since we're not interested in debugging glyphs with old libraries.
16004 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
16005 GCC 4.6.0's static checking.
16006
16007 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16008
16009 Integer overflow and signedness fixes (Bug#8873).
16010 A few related buffer overrun fixes, too.
16011
16012 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
16013
16014 * dispextern.h (struct face.stipple):
16015 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
16016 (x_bitmap_mask, x_allocate_bitmap_record)
16017 (x_create_bitmap_from_data, x_create_bitmap_from_file)
16018 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
16019 (x_create_bitmap_from_xpm_data):
16020 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
16021 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
16022 (.bitmaps_last):
16023 * xfaces.c (load_pixmap):
16024 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
16025 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
16026 (.bitmaps_last, struct x_output.icon_bitmap):
16027 Use ptrdiff_t, not int, for bitmap indexes.
16028 (x_allocate_bitmap_record): Check for size overflow.
16029 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
16030
16031 Use ptrdiff_t, not int, for overlay counts.
16032 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
16033 * editfns.c (overlays_around, get_pos_property):
16034 * textprop.c (get_char_property_and_overlay):
16035 * xdisp.c (next_overlay_change, note_mouse_highlight):
16036 * xfaces.c (face_at_buffer_position):
16037 * buffer.c (OVERLAY_COUNT_MAX): New macro.
16038 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
16039 (Fnext_overlay_change, Fprevious_overlay_change)
16040 (mouse_face_overlay_overlaps, Foverlays_in):
16041 Use ptrdiff_t, not int, for sizes.
16042 (overlays_at, overlays_in): Check for size-calculation overflow.
16043
16044 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
16045
16046 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
16047 (x_session_initialize): Do not assume string length fits in int.
16048
16049 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
16050 This is unlikely, but can occur if DPI is outlandish.
16051
16052 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
16053 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
16054
16055 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
16056 * xrdb.c (magic_file_p, search_magic_path):
16057 Omit last arg SUFFIX; it was always 0. All callers changed.
16058 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
16059
16060 * xfont.c (xfont_match): Avoid need for strlen.
16061
16062 * xfns.c: Don't assume strlen fits in int.
16063 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
16064
16065 * xdisp.c (message_log_check_duplicate): Return intmax_t,
16066 not unsigned long, as we prefer signed integers. All callers changed.
16067 Detect integer overflow in repeat count.
16068 (message_dolog): Don't assume print length fits in 39 bytes.
16069 (display_mode_element): Don't assume strlen fits in int.
16070
16071 * termcap.c: Don't assume sizes fit in int and never overflow.
16072 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
16073 (gobble_line): Check for size-calculation overflow.
16074
16075 * minibuf.c (Fread_buffer):
16076 * lread.c (intern, intern_c_string):
16077 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
16078 Don't assume string length fits in int.
16079
16080 * keyboard.c (parse_tool_bar_item):
16081 * gtkutil.c (style_changed_cb): Avoid need for strlen.
16082
16083 * font.c: Don't assume string length fits in int.
16084 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
16085 Use ptrdiff_t, not int.
16086 (font_intern_prop): Don't assume string length fits in int.
16087 Don't assume integer property fits in fixnum.
16088 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
16089
16090 * filelock.c: Fix some buffer overrun and integer overflow issues.
16091 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
16092 Reformulate so as not to need the command string.
16093 Invoke gzip -cd rather than gunzip, as it's more portable.
16094 (lock_info_type, lock_file_1, lock_file):
16095 Don't assume pid_t and time_t fit in unsigned long.
16096 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
16097 (current_lock_owner): Prefer signed type for sizes.
16098 Use memcpy, not strncpy, where memcpy is what is really wanted.
16099 Don't assume (via atoi) that time_t and pid_t fit in int.
16100 Check for time_t and/or pid_t out of range, e.g., via a network share.
16101 Don't alloca where an auto var works fine.
16102
16103 * fileio.c: Fix some integer overflow issues.
16104 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
16105 Don't assume string length fits in int.
16106 (directory_file_name): Don't assume string length fits in long.
16107 (make_temp_name): Don't assume pid fits in int, or that its print
16108 length is less than 20.
16109
16110 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
16111
16112 * coding.c (make_subsidiaries): Don't assume string length fits in int.
16113
16114 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
16115
16116 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
16117 We prefer signed integers, even for size calculations.
16118
16119 * emacs.c: Don't assume string length fits in 'int'.
16120 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
16121 (main): Don't invoke strlen when not needed.
16122
16123 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
16124 (XD_DEBUG_MESSAGE): Don't waste a byte.
16125
16126 * callproc.c (getenv_internal_1, getenv_internal)
16127 (Fgetenv_internal):
16128 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
16129
16130 * lread.c (invalid_syntax): Omit length argument.
16131 All uses changed. This doesn't fix a bug, but it simplifies the
16132 code away from its former Hollerith-constant appearance, and it's
16133 one less 'int' to worry about when looking at integer-overflow issues.
16134 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
16135
16136 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
16137 This didn't break anything, but it didn't help either.
16138 It's confusing to put a bogus integer in a place where the actual
16139 value does not matter.
16140 (LIST_END_P): Remove unused macro and its bogus comment.
16141 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
16142
16143 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
16144 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
16145 implementation.
16146 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
16147 We prefer signed types, and the value cannot exceed the EMACS_INT
16148 range anyway (because otherwise the length would not be representable).
16149 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
16150 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
16151 This avoids a GCC warning when WIDE_EMACS_INT.
16152
16153 * indent.c (sane_tab_width): New function.
16154 (current_column, scan_for_column, Findent_to, position_indentation)
16155 (compute_motion): Use it. This is just for clarity.
16156 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
16157
16158 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
16159
16160 * lisp.h (lint_assume): New macro.
16161 * composite.c (composition_gstring_put_cache):
16162 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
16163
16164 * editfns.c, insdel.c:
16165 Omit unnecessary forward decls, to simplify future changes.
16166
16167 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
16168
16169 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
16170
16171 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
16172 Use much-faster test for byte-length change.
16173 Don't assume string byte-length fits in 'int'.
16174 Check that character arg fits in 'int'.
16175 (mapcar1): Declare byte as byte, for clarity.
16176
16177 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
16178
16179 * fns.c (concat): Catch string overflow earlier.
16180 Do not rely on integer wraparound.
16181
16182 * dispextern.h (struct it.overlay_strings_charpos)
16183 (struct it.selective): Now EMACS_INT, not int.
16184 * xdisp.c (forward_to_next_line_start)
16185 (back_to_previous_visible_line_start)
16186 (reseat_at_next_visible_line_start, next_element_from_buffer):
16187 Don't arbitrarily truncate the value of 'selective' to int.
16188
16189 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
16190
16191 * composite.c: Don't truncate sizes to 'int'.
16192 (composition_gstring_p, composition_reseat_it)
16193 (composition_adjust_point): Use EMACS_INT, not int.
16194 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
16195 not EMACS_UINT, for indexes.
16196
16197 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
16198
16199 * buffer.c: Include <verify.h>.
16200 (struct sortvec.priority, struct sortstr.priority):
16201 Now EMACS_INT, not int.
16202 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
16203 (struct sortstr.size, record_overlay_string)
16204 (struct sortstrlist.size, struct sortlist.used):
16205 Don't truncate size to int.
16206 (record_overlay_string): Check for size-calculation overflow.
16207 (init_buffer_once): Check at compile-time, not run-time.
16208
16209 2011-06-22 Jim Meyering <meyering@redhat.com>
16210
16211 Don't leak an XBM-image-sized buffer
16212 * image.c (xbm_load): Free the image buffer after using it.
16213
16214 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
16215
16216 Port to Sun C.
16217 * composite.c (find_automatic_composition): Omit needless 'return 0;'
16218 that Sun C diagnosed.
16219 * fns.c (secure_hash): Fix pointer signedness issue.
16220 * intervals.c (static_offset_intervals): New function.
16221 (offset_intervals): Use it.
16222
16223 2011-06-21 Leo Liu <sdl.web@gmail.com>
16224
16225 * deps.mk (fns.o):
16226 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
16227 sha512.h.
16228
16229 * fns.c (secure_hash): Rename from crypto_hash_function and change
16230 the first arg to accept symbols.
16231 (Fsecure_hash): New primitive.
16232 (syms_of_fns): New symbols.
16233
16234 2011-06-20 Deniz Dogan <deniz@dogan.se>
16235
16236 * process.c (Fset_process_buffer): Clarify return value in
16237 docstring.
16238
16239 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
16240
16241 * dispnew.c (add_window_display_history): Use BVAR.
16242
16243 * xdisp.c (debug_method_add): Use BVAR.
16244 (check_window_end, dump_glyph_matrix, dump_glyph)
16245 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16246
16247 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16248 Likewise.
16249
16250 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16251 check till after the cache is created in init_frame_faces.
16252
16253 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16254
16255 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16256
16257 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16258
16259 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16260 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16261 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16262
16263 Improve buffer-overflow checking (Bug#8873).
16264 * fileio.c (Finsert_file_contents):
16265 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16266 Remove the old (too-loose) buffer overflow checks.
16267 They weren't needed, since make_gap checks for buffer overflow.
16268 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16269 The old code merely checked for Emacs fixnum overflow, and relied
16270 on undefined (wraparound) behavior. The new code avoids undefined
16271 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16272
16273 * editfns.c (Finsert_char): Don't dump core with very negative counts.
16274 Tune. Don't use wider integers than needed. Don't use alloca.
16275 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
16276
16277 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16278
16279 * insdel.c, lisp.h (buffer_overflow): New function.
16280 (insert_from_buffer_1, replace_range, replace_range_2):
16281 * insdel.c (make_gap_larger):
16282 * editfns.c (Finsert_char):
16283 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16284
16285 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16286
16287 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16288
16289 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
16290
16291 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16292 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16293
16294 * fileio.c: Don't assume EMACS_INT fits in off_t.
16295 (emacs_lseek): New static function.
16296 (Finsert_file_contents, Fwrite_region): Use it.
16297 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16298
16299 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16300
16301 * fns.c: Don't overflow int when computing a list length.
16302 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16303 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16304 truncation on 64-bit hosts. Check for QUIT every
16305 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16306 faster and is responsive enough.
16307 (Flength): Report an error instead of overflowing an integer.
16308 (Fsafe_length): Return a float if the value is not representable
16309 as a fixnum. This shouldn't happen except in contrived situations.
16310 (Fnthcdr, Fsort): Don't assume list length fits in int.
16311 (Fcopy_sequence): Don't assume vector length fits in int.
16312
16313 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16314 (header_size, word_size): New constants.
16315 (allocate_vectorlike): Don't check size overflow here.
16316 (allocate_vector): Check it here instead, since this is the only
16317 caller of allocate_vectorlike that could cause overflow.
16318 Check that the new vector's length is representable as a fixnum.
16319
16320 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16321 The previous code was bogus. For example, next_almost_prime (32)
16322 returned 39, which is undesirable as it is a multiple of 3; and
16323 next_almost_prime (24) returned 25, which is a multiple of 5 so
16324 why was the code bothering to check for multiples of 7?
16325
16326 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16327
16328 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16329
16330 Variadic C functions now count arguments with ptrdiff_t.
16331 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16332 Back then I didn't know that the Emacs coding style prefers signed int.
16333 Also, in the meantime I found a few more instances where arguments
16334 were being counted with int, which may truncate counts on 64-bit
16335 machines, or EMACS_INT, which may be unnecessarily wide.
16336 * lisp.h (struct Lisp_Subr.function.aMANY)
16337 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16338 Arg counts are now ptrdiff_t, not size_t.
16339 All variadic functions and their callers changed accordingly.
16340 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16341 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16342 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16343 * callint.c (Fcall_interactively): Check arg count for overflow,
16344 to avoid potential buffer overrun. Use signed char, not 'int',
16345 for 'varies' array, so that we needn't bother to check its size
16346 calculation for overflow.
16347 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16348 * eval.c (apply_lambda):
16349 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16350 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16351 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16352
16353 * callint.c (Fcall_interactively): Don't use index var as event count.
16354
16355 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16356 * mem-limits.h (SIZE): Remove; no longer used.
16357
16358 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
16359
16360 Remove unnecessary casts.
16361 * xterm.c (x_term_init):
16362 * xfns.c (x_set_border_pixel):
16363 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16364 These aren't needed now that we assume ANSI C.
16365
16366 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16367 It's more likely to cause problems (due to unsigned overflow)
16368 than to cure them.
16369
16370 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16371
16372 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16373
16374 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16375
16376 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16377
16378 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16379
16380 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16381
16382 GLYPH_CODE_FACE returns EMACS_INT, not int.
16383 * dispextern.h (merge_faces):
16384 * xfaces.c (merge_faces):
16385 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16386 Don't assume EMACS_INT fits in int.
16387
16388 * character.h (CHAR_VALID_P): Remove unused parameter.
16389 * fontset.c, lisp.h, xdisp.c: All uses changed.
16390
16391 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16392
16393 * fns.c (concat): Minor tuning based on overflow analysis.
16394 This doesn't fix any bugs. Use int to hold character, instead
16395 of constantly refetching from Emacs object. Use XFASTINT, not
16396 XINT, for value known to be a character. Don't bother comparing
16397 a single byte to 0400, as it's always less.
16398
16399 * floatfns.c (Fexpt):
16400 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16401
16402 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16403 for characters.
16404
16405 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16406
16407 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16408 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16409 incorrectly succeed when S was a string, because 4294967386 was
16410 truncated before it was used.
16411
16412 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16413 Otherwise, an out-of-range integer could cause undefined behavior
16414 on a 64-bit host.
16415
16416 * composite.c: Use int, not EMACS_INT, for characters.
16417 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16418 EMACS_INT, for values that are known to be in character range.
16419 This doesn't fix any bugs but is the usual style inside Emacs and
16420 may generate better code on 32-bit machines.
16421
16422 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16423 This is for reasons similar to the recent CHAR_STRING fix.
16424 * charset.c (Fencode_char): Check that character arg is actually
16425 a character. Pass an int to ENCODE_CHAR.
16426 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16427 wider than 'int', as a compile-time check to prevent future regressions
16428 in this area.
16429
16430 * character.c (char_string): Remove unnecessary casts.
16431
16432 Make sure a 64-bit char is never passed to CHAR_STRING.
16433 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16434 by silently ignoring the top 32 bits, allowing some values
16435 that were far too large to be valid characters.
16436 * character.h: Include <verify.h>.
16437 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16438 arguments are no wider than unsigned, as a compile-time check
16439 to prevent future regressions in this area.
16440 * data.c (Faset):
16441 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
16442 (Fsubst_char_in_region):
16443 * fns.c (concat):
16444 * xdisp.c (decode_mode_spec_coding):
16445 Adjust to CHAR_STRING's new requirement.
16446 * editfns.c (Finsert_char, Fsubst_char_in_region):
16447 * fns.c (concat): Check that character args are actually
16448 characters. Without this test, these functions did the wrong
16449 thing with wildly out-of-range values on 64-bit hosts.
16450
16451 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16452 These casts should not be needed on 32-bit hosts, either.
16453 * keyboard.c (read_char):
16454 * lread.c (Fload): Remove casts to unsigned.
16455
16456 * lisp.h (UNSIGNED_CMP): New macro.
16457 This fixes comparison bugs on 64-bit hosts.
16458 (ASCII_CHAR_P): Use it.
16459 * casefiddle.c (casify_object):
16460 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
16461 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16462 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16463 * dispextern.h (FACE_FROM_ID):
16464 * keyboard.c (read_char): Use UNSIGNED_CMP.
16465
16466 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16467 not to EMACS_INT, to avoid GCC warning.
16468
16469 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16470
16471 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16472 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16473 isn't needed on 32-bit machines.
16474
16475 * buffer.c (Fgenerate_new_buffer_name):
16476 Use EMACS_INT for count, not int.
16477 (advance_to_char_boundary): Return EMACS_INT, not int.
16478
16479 * data.c (Qcompiled_function): Now static.
16480
16481 * window.c (window_body_lines): Now static.
16482
16483 * image.c (gif_load): Rename local to avoid shadowing.
16484
16485 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16486 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16487 * alloc.c (make_save_value): Integer argument is now of type
16488 ptrdiff_t, not int.
16489 (mark_object): Use ptrdiff_t, not int.
16490 * lisp.h (pD): New macro.
16491 * print.c (print_object): Use it.
16492
16493 * alloc.c: Use EMACS_INT, not int, to count objects.
16494 (total_conses, total_markers, total_symbols, total_vector_size)
16495 (total_free_conses, total_free_markers, total_free_symbols)
16496 (total_free_floats, total_floats, total_free_intervals)
16497 (total_intervals, total_strings, total_free_strings):
16498 Now EMACS_INT, not int. All uses changed.
16499 (Fgarbage_collect): Compute overall total using a double, so that
16500 integer overflow is less likely to be a problem. Check for overflow
16501 when converting back to an integer.
16502 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16503 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16504 These were 'int' variables that could overflow on 64-bit hosts;
16505 they were never used, so remove them instead of repairing them.
16506 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16507 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16508 Previously, this ceilinged at INT_MAX, but that doesn't work on
16509 64-bit machines.
16510 (allocate_pseudovector): Don't use EMACS_INT when int would do.
16511
16512 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16513 (allocate_vectorlike): Check for ptrdiff_t overflow.
16514 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16515 when a (possibly-narrower) signed value would do just as well.
16516 We prefer using signed arithmetic, to avoid comparison confusion.
16517
16518 * alloc.c: Catch some string size overflows that we were missing.
16519 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16520 for convenience in STRING_BYTES_MAX.
16521 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16522 The definition here is exact; the one in lisp.h was approximate.
16523 (allocate_string_data): Check for string overflow. This catches
16524 some instances we weren't catching before. Also, it catches
16525 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16526 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16527 and ptrdiff_t and EMACS_INT are both 64 bits.
16528
16529 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16530 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16531 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16532
16533 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16534
16535 * alloc.c (Fmake_string): Check for out-of-range init.
16536
16537 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16538
16539 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16540
16541 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16542
16543 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16544 xg_get_default_scrollbar_width.
16545
16546 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16547 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16548 (style_changed_cb): Call update_theme_scrollbar_width and call
16549 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16550 all frames (Bug#8505).
16551 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16552 Call gtk_window_set_resizable if HAVE_GTK3.
16553 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16554 and height if HAVE_GTK3 (Bug#8505).
16555 (scroll_bar_width_for_theme): New variable.
16556 (update_theme_scrollbar_width): New function.
16557 (xg_get_default_scrollbar_width): Move code to
16558 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16559 (xg_initialize): Call update_theme_scrollbar_width.
16560
16561 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16562
16563 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16564
16565 2011-06-12 Martin Rudalics <rudalics@gmx.at>
16566
16567 * frame.c (make_frame): Call other_buffer_safely instead of
16568 other_buffer.
16569
16570 * window.c (temp_output_buffer_show): Call display_buffer with
16571 second argument Vtemp_buffer_show_specifiers and reset latter
16572 immediately after the call.
16573 (Vtemp_buffer_show_specifiers): New variable.
16574 (auto_window_vscroll_p, next_screen_context_lines)
16575 (Vscroll_preserve_screen_position): Remove leading asterisks from
16576 doc-strings.
16577
16578 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
16579
16580 Fix minor problems found by GCC 4.6.0 static checking.
16581 * buffer.c (Qclone_number): Remove for now, as it's unused.
16582 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16583 (record_buffer): Remove unused local.
16584 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16585 (set_frame_buffer_list): Remove; unused.
16586 * frame.h (other_visible_frames): Remove decl.
16587 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16588 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16589 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16590 if HAVE_GPM.
16591 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16592 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16593 Define only if HAVE_GPM.
16594 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16595 (update_hints_inhibit): Remove; never set. All uses removed.
16596 * widgetprv.h (emacsFrameClassRec): Remove decl.
16597 * window.c (delete_deletable_window): Now returns void, since it
16598 wasn't returning anything.
16599 (compare_window_configurations): Remove unused locals.
16600 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16601 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16602 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16603 the same widths as pointers. This follows up on the 2011-05-06 patch.
16604 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16605 * xterm.h: Likewise.
16606 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16607
16608 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
16609
16610 * makefile.w32-in: Update dependencies.
16611 (LISP_H): Add lib/intprops.h.
16612
16613 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16614
16615 * image.c (gif_load): Add animation frame delay to the metadata.
16616 (syms_of_image): Use DEFSYM. New symbol `delay'.
16617
16618 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16619
16620 * window.c (delete_deletable_window): Re-add.
16621 (Fset_window_configuration): Rewrite to handle dead buffers and
16622 consequently deletable windows.
16623 (window_tree, Fwindow_tree): Remove. Supply functionality in
16624 window.el.
16625 (compare_window_configurations): Simplify code.
16626
16627 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16628
16629 * image.c (imagemagick_load_image): Fix type mismatch.
16630 (Fimagemagick_types): Likewise.
16631
16632 * window.h (replace_buffer_in_windows): Declare.
16633
16634 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16635
16636 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16637 Qclone_number. Remove external declaration of Qdelete_window.
16638 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16639 code.
16640 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16641 Run Qbuffer_list_update_hook if allowed.
16642 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16643 buffer list implementation.
16644 (other_buffer_safely): New function.
16645 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16646 calls to replace_buffer_in_windows and
16647 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16648 if allowed.
16649 (record_buffer): Inhibit quitting and rewrite using quittable
16650 functions. Run Qbuffer_list_update_hook if allowed.
16651 (Frecord_buffer, Funrecord_buffer): New functions.
16652 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16653 Move switch-to-buffer to window.el.
16654 (bury-buffer): Move to window.el.
16655 (Vbuffer_list_update_hook): New variable.
16656
16657 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16658 section.
16659
16660 * window.h (resize_frame_windows): Move up in code.
16661 (Fwindow_frame): Remove EXFUN.
16662 (replace_buffer_in_all_windows): Remove prototype.
16663 (replace_buffer_in_windows_safely): Add prototype.
16664
16665 * window.c: Declare Qdelete_window static again. Move down
16666 declaration of select_count.
16667 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16668 (Fother_window): Move to window.el.
16669 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16670 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16671 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16672 window.el.
16673 (replace_buffer_in_windows): Implement by calling
16674 Qreplace_buffer_in_windows.
16675 (replace_buffer_in_all_windows): Remove with some functionality
16676 moved into replace_buffer_in_windows_safely.
16677 (replace_buffer_in_windows_safely): New function.
16678 (select_window_norecord, select_frame_norecord): Move in front
16679 of run_window_configuration_change_hook. Remove now obsolete
16680 declarations.
16681 (Fset_window_buffer): Rewrite doc-string.
16682 Call Qrecord_window_buffer.
16683 (keys_of_window): Move binding for other-window to window.el.
16684
16685 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16686
16687 * dispextern.h (struct image): Replace data member, whose int_val
16688 and ptr_val fields were not used by anything, with a single
16689 lisp_val object.
16690
16691 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16692 (gif_clear_image, gif_load, imagemagick_load_image)
16693 (gs_clear_image, gs_load): Callers changed.
16694
16695 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16696
16697 * buffer.h: Include <time.h>, for time_t.
16698 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16699
16700 Fix minor problems found by static checking.
16701
16702 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16703
16704 Make identifiers static if they are not used in other modules.
16705 * data.c (Qcompiled_function, Qframe, Qvector):
16706 * image.c (QimageMagick, Qsvg):
16707 * minibuf.c (Qmetadata):
16708 * window.c (resize_window_check, resize_root_window): Now static.
16709 * window.h (resize_window_check, resize_root_window): Remove decls.
16710
16711 * window.c (window_deletion_count, delete_deletable_window):
16712 Remove; unused.
16713 (window_body_lines): Now static.
16714 (Fdelete_other_windows_internal): Mark vars as initialized.
16715 Make sure 'resize_failed' is initialized.
16716 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16717 (resize_window_apply): Remove unused local.
16718 * window.h (delete_deletable_window): Remove decl.
16719
16720 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16721 (imagemagick_load_image): Fix pointer signedness problem by changing
16722 last arg from unsigned char * to char *. All uses changed.
16723 Also, fix a local for similar reasons.
16724 Remove unused locals. Remove locals to avoid shadowing.
16725 (fn_rsvg_handle_free): Remove; unused.
16726 (svg_load, svg_load_image): Fix pointer signedness problem.
16727 (imagemagick_load_image): Don't use garbage pointer image_wand.
16728
16729 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16730
16731 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16732
16733 * image.c (gif_load): Fix omitted cast error introduced by
16734 2011-06-06 change.
16735
16736 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16737
16738 * window.h (resize_proportionally, orig_total_lines)
16739 (orig_top_line): Remove from window structure.
16740 (set_window_height, set_window_width, change_window_heights)
16741 (Fdelete_window): Remove prototypes.
16742 (resize_frame_windows): Remove duplicate declaration.
16743
16744 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16745
16746 * window.h (resize_frame_windows, resize_window_check)
16747 (delete_deletable_window, resize_root_window)
16748 (resize_frame_windows): Declare prototypes.
16749
16750 * window.c (resize_window_apply): Make definition be "static" to
16751 match the prototype.
16752
16753 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16754
16755 * window.c: Remove declarations of Qwindow_size_fixed,
16756 window_min_size_1, window_min_size_2, window_min_size,
16757 size_window, window_fixed_size_p, enlarge_window, delete_window.
16758 Remove static from declaration of Qdelete_window, it's
16759 temporarily needed by Fbury_buffer.
16760 (replace_window): Don't assign orig_top_line and
16761 orig_total_lines.
16762 (Fdelete_window, delete_window): Remove. Window deletion is
16763 handled by window.el.
16764 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16765 Replace Fdelete_window calls with calls to Qdelete_window.
16766 (Fdelete_other_windows): Remove. Deleting other windows is
16767 handled by window.el.
16768 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16769 handled in window.el.
16770 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16771 Window minimum sizes are handled in window.el.
16772 (shrink_windows, size_window, set_window_height)
16773 (set_window_width, change_window_heights, window_height)
16774 (window_width, CURBEG, CURSIZE, enlarge_window)
16775 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16776 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16777 handled in window.el.
16778 (make_dummy_parent): Rename to make_parent_window and give it a
16779 second argument horflag.
16780 (make_window): Don't set resize_proportionally any more.
16781 (Fsplit_window): Remove. Windows are split in window.el.
16782 (save_restore_action, save_restore_orig_size)
16783 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16784 Resize mini windows in window.el.
16785 (grow_mini_window, shrink_mini_window): Implement by calling
16786 Qresize_root_window_vertically, resize_window_check and
16787 resize_window_apply.
16788 (saved_window, Fset_window_configuration, save_window_save):
16789 Do not handle orig_top_line, orig_total_lines, and
16790 resize_proportionally.
16791 (window_min_height, window_min_width): Move to window.el.
16792 (keys_of_window): Move bindings for delete-other-windows,
16793 split-window, delete-window and enlarge-window to window.el.
16794
16795 * buffer.c: Temporarily extern Qdelete_window.
16796 (Fbury_buffer): Temporarily call Qdelete_window instead of
16797 Fdelete_window (Fbury_buffer will move to window.el soon).
16798
16799 * frame.c (set_menu_bar_lines_1): Remove code handling
16800 orig_top_line and orig_total_lines.
16801
16802 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16803 set_window_height but set heights directly.
16804 (change_frame_size_1): Use resize_frame_windows.
16805
16806 * xdisp.c (init_xdisp): Don't use set_window_height but set
16807 heights directly.
16808
16809 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16810 Use resize_frame_windows instead of change_window_heights and run
16811 run_window_configuration_change_hook.
16812
16813 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16814 instead of change_window_heights and run
16815 run_window_configuration_change_hook.
16816
16817 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16818
16819 * window.c (replace_window): Rename second argument REPLACEMENT to
16820 NEW. New third argument SETFLAG. Rewrite.
16821 (delete_window, make_dummy_parent): Call replace_window with
16822 third argument 1.
16823 (window_list_1): Move down in code.
16824 (run_window_configuration_change_hook): Move set_buffer part
16825 before select_frame_norecord part in order to unwind correctly.
16826 Rename count1 to count.
16827 (recombine_windows, delete_deletable_window, resize_root_window)
16828 (Fdelete_other_windows_internal)
16829 (Frun_window_configuration_change_hook, make_parent_window)
16830 (resize_window_check, resize_window_apply, Fresize_window_apply)
16831 (resize_frame_windows, Fsplit_window_internal)
16832 (Fdelete_window_internal, Fresize_mini_window_internal):
16833 New functions.
16834 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16835
16836 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16837
16838 * window.h (window): Add some new members to window structure -
16839 normal_lines, normal_cols, new_total, new_normal, clone_number,
16840 splits, nest, prev_buffers, next_buffers.
16841 (WINDOW_TOTAL_SIZE): Move here from window.c.
16842 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16843
16844 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16845 Remove.
16846 (make_dummy_parent): Set new members of windows structure.
16847 (make_window): Move down in code. Handle new members of window
16848 structure.
16849 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16850 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16851 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16852 (Fset_window_prev_buffers, Fwindow_next_buffers)
16853 (Fset_window_next_buffers, Fset_window_clone_number):
16854 New functions.
16855 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16856 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16857 Doc-string fixes.
16858 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16859 Argument WINDOW can be now internal window too.
16860 (Fwindow_use_time): Move up in code.
16861 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16862 Rewrite doc-string.
16863 (Fset_window_configuration, saved_window)
16864 (Fcurrent_window_configuration, save_window_save): Handle new
16865 members of window structure.
16866 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16867 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16868 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16869 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16870 Qget_mru_window, Qresize_root_window,
16871 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16872 Qauto_buffer_name; staticpro them.
16873
16874 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16875
16876 * window.c (Fwindow_total_size, Fwindow_left_column)
16877 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16878 (Fwindow_list_1): New functions.
16879 (window_box_text_cols): Replace with window_body_cols.
16880 (Fwindow_width, Fscroll_left, Fscroll_right):
16881 Use window_body_cols instead of window_box_text_cols.
16882 (delete_window, Fset_window_configuration):
16883 Call delete_all_subwindows with window as argument.
16884 (delete_all_subwindows): Take a window as argument and not a
16885 structure. Rewrite.
16886 (window_loop): Remove handling of GET_LRU_WINDOW and
16887 GET_LARGEST_WINDOW.
16888 (Fget_lru_window, Fget_largest_window): Move to window.el.
16889
16890 * window.h: Extern window_body_cols instead of
16891 window_box_text_cols. delete_all_subwindows now takes a
16892 Lisp_Object as argument.
16893
16894 * indent.c (compute_motion, Fcompute_motion):
16895 Use window_body_cols instead of window_box_text_cols.
16896
16897 * frame.c (delete_frame): Call delete_all_subwindows with root
16898 window as argument.
16899
16900 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16901
16902 * fns.c (Fputhash): Document return value.
16903
16904 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16905
16906 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16907
16908 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16909
16910 Cons<->int and similar integer overflow fixes (Bug#8794).
16911
16912 Check for overflow when converting integer to cons and back.
16913 * charset.c (Fdefine_charset_internal, Fdecode_char):
16914 Use cons_to_unsigned to catch overflow.
16915 (Fencode_char): Use INTEGER_TO_CONS.
16916 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16917 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16918 * data.c (long_to_cons, cons_to_long): Remove.
16919 (cons_to_unsigned, cons_to_signed): New functions.
16920 These signal an error for invalid or out-of-range values.
16921 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16922 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16923 * font.c (Ffont_variation_glyphs):
16924 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16925 * lisp.h: Include <intprops.h>.
16926 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16927 (cons_to_signed, cons_to_unsigned): New decls.
16928 (long_to_cons, cons_to_long): Remove decls.
16929 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16930 (Fprimitive_undo): Use CONS_TO_INTEGER.
16931 * xfns.c (Fx_window_property): Likewise.
16932 * xselect.c: Include <limits.h>.
16933 (x_own_selection, selection_data_to_lisp_data):
16934 Use INTEGER_TO_CONS.
16935 (x_handle_selection_request, x_handle_selection_clear)
16936 (x_get_foreign_selection, Fx_disown_selection_internal)
16937 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16938 (lisp_data_to_selection_data): Use cons_to_unsigned.
16939 (x_fill_property_data): Use cons_to_signed.
16940 Report values out of range.
16941
16942 Check for buffer and string overflow more precisely.
16943 * buffer.h (BUF_BYTES_MAX): New macro.
16944 * lisp.h (STRING_BYTES_MAX): New macro.
16945 * alloc.c (Fmake_string):
16946 * character.c (string_escape_byte8):
16947 * coding.c (coding_alloc_by_realloc):
16948 * doprnt.c (doprnt):
16949 * editfns.c (Fformat):
16950 * eval.c (verror):
16951 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16952 since they may not be the same number.
16953 * editfns.c (Finsert_char):
16954 * fileio.c (Finsert_file_contents):
16955 Likewise for BUF_BYTES_MAX.
16956
16957 * image.c: Use ptrdiff_t, not int, for sizes.
16958 (slurp_file): Switch from int to ptrdiff_t.
16959 All uses changed.
16960 (slurp_file): Check that file size fits in both size_t (for
16961 malloc) and ptrdiff_t (for sanity and safety).
16962
16963 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16964 if b->modtime has its maximal value.
16965
16966 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16967
16968 Don't assume time_t can fit into int.
16969 * buffer.h (struct buffer.modtime): Now time_t, not int.
16970 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16971 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16972
16973 Minor fixes for signed vs unsigned integers.
16974 * character.h (MAYBE_UNIFY_CHAR):
16975 * charset.c (maybe_unify_char):
16976 * keyboard.c (read_char, reorder_modifiers):
16977 XINT -> XFASTINT, since the integer must be nonnegative.
16978 * ftfont.c (ftfont_spec_pattern):
16979 * keymap.c (access_keymap, silly_event_symbol_error):
16980 XUINT -> XFASTINT, since the integer must be nonnegative.
16981 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16982 since it makes no difference and we prefer signed.
16983 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16984 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16985 nonnegative.
16986
16987 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16988
16989 * window.h (Fwindow_frame): Declare.
16990
16991 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16992
16993 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16994 (SPARE_MEMORY): Always define.
16995 (LARGE_REQUEST): Remove.
16996 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16997
16998 2011-06-06 Martin Rudalics <rudalics@gmx.at>
16999
17000 * lisp.h: Move EXFUNS for Fframe_root_window,
17001 Fframe_first_window and Fset_frame_selected_window to window.h.
17002
17003 * window.h: Move EXFUNS for Fframe_root_window,
17004 Fframe_first_window and Fset_frame_selected_window here from
17005 lisp.h.
17006
17007 * frame.c (Fwindow_frame, Fframe_first_window)
17008 (Fframe_root_window, Fframe_selected_window)
17009 (Fset_frame_selected_window): Move to window.c.
17010 (Factive_minibuffer_window): Move to minibuf.c.
17011 (Fother_visible_frames_p): New function.
17012
17013 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
17014
17015 * window.c (decode_window, decode_any_window): Move up in code.
17016 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
17017 (inhibit_frame_unsplittable): Remove unused variable.
17018 (Fwindow_buffer): Move up and rewrite doc-string.
17019 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
17020 (Fwindow_prev): New functions.
17021 (Fwindow_frame): Move here from frame.c. Accept any window as
17022 argument.
17023 (Fframe_root_window, Fframe_first_window)
17024 (Fframe_selected_window): Move here from frame.c. Accept frame
17025 or arbitrary window as argument. Update doc-strings.
17026 (Fminibuffer_window): Move up in code.
17027 (Fwindow_minibuffer_p): Move up in code and simplify.
17028 (Fset_frame_selected_window): Move here from frame.c.
17029 Marginal rewrite.
17030 (Fselected_window, select_window, Fselect_window): Move up in
17031 code. Minor doc-string fixes.
17032
17033 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17034
17035 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
17036 Do not assume that spare memory exists; that assumption is valid
17037 only if SYSTEM_MALLOC.
17038 (LARGE_REQUEST): New macro, so that the issue of large requests
17039 is separated from the issue of spare memory.
17040
17041 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
17042
17043 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
17044 format. (Bug#8806)
17045
17046 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
17047
17048 * xfns.c (x_set_scroll_bar_default_width): Move declarations
17049 before statements.
17050
17051 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
17052
17053 * gtkutil.c (xg_get_default_scrollbar_width): New function.
17054
17055 * gtkutil.h: Declare xg_get_default_scrollbar_width.
17056
17057 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
17058 min width by calling x_set_scroll_bar_default_width (Bug#8505).
17059
17060 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
17061
17062 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
17063
17064 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
17065
17066 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
17067 (x_clipboard_manager_save): Add return value.
17068 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
17069 New error handlers.
17070 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
17071 Obey Vx_select_enable_clipboard_manager. Catch errors in
17072 x_clipboard_manager_save (Bug#8779).
17073 (Vx_select_enable_clipboard_manager): New variable.
17074 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
17075
17076 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
17077
17078 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
17079
17080 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17081
17082 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
17083 in the current matrix if keep_current_p is non-zero.
17084
17085 2011-06-04 Eli Zaretskii <eliz@gnu.org>
17086
17087 * bidi.c (bidi_level_of_next_char): Fix last change.
17088
17089 2011-06-03 Eli Zaretskii <eliz@gnu.org>
17090
17091 Support bidi reordering of text covered by display properties.
17092
17093 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
17094 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
17095 (bidi_cache_search, bidi_cache_iterator_state)
17096 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
17097 (bidi_level_of_next_char, bidi_move_to_visually_next):
17098 Support character positions inside a run of characters covered by a
17099 display string.
17100 (bidi_paragraph_init, bidi_resolve_explicit_1)
17101 (bidi_level_of_next_char): Call bidi_fetch_char and
17102 bidi_fetch_char_advance instead of FETCH_CHAR and
17103 FETCH_CHAR_ADVANCE.
17104 (bidi_init_it): Initialize new members.
17105 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
17106 definitions.
17107 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
17108 instead of using explicit *_CHAR codes.
17109 (bidi_resolve_explicit, bidi_resolve_weak):
17110 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
17111 bidirectional text is supported only in multibyte buffers.
17112 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
17113 it to initialize the frame_window_p member of struct bidi_it.
17114 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
17115 (bidi_resolve_explicit, bidi_resolve_weak)
17116 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
17117 bidi_it->nchars is non-positive.
17118 (bidi_level_of_next_char): Don't try to lookup the cache for the
17119 next/previous character if nothing is cached there yet, or if we
17120 were just reseat()'ed to a new position.
17121
17122 * xdisp.c (set_cursor_from_row): Set start and stop points
17123 according to the row's direction when priming the loop that looks
17124 for the glyph on which to display cursor.
17125 (single_display_spec_intangible_p): Function deleted.
17126 (display_prop_intangible_p): Reimplement to call
17127 handle_display_spec instead of single_display_spec_intangible_p.
17128 Accept 3 additional arguments needed by handle_display_spec.
17129 This fixes incorrect cursor motion across display property with complex
17130 values: lists, `(when COND...)' forms, etc.
17131 (single_display_spec_string_p): Support property values that are
17132 lists with the argument STRING its top-level element.
17133 (display_prop_string_p): Fix the condition for processing a
17134 property that is a list to be consistent with handle_display_spec.
17135 (handle_display_spec): New function, refactored from the
17136 last portion of handle_display_prop.
17137 (compute_display_string_pos): Accept additional argument
17138 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
17139 value of a `display' property is a "replacing spec".
17140 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
17141 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
17142 the display property, but just return a value indicating whether
17143 the display property will replace the characters it covers.
17144 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
17145 frame_window_p members of struct bidi_it.
17146 (compute_display_string_pos, compute_display_string_end):
17147 New functions.
17148 (push_it): Accept second argument POSITION, where pop_it should
17149 jump to continue iteration.
17150 (reseat_1): Initialize bidi_it.disp_pos.
17151
17152 * keyboard.c (adjust_point_for_property): Adjust the call to
17153 display_prop_intangible_p to its new signature.
17154
17155 * dispextern.h (struct bidi_it): New member frame_window_p.
17156 (bidi_init_it): Update prototypes.
17157 (display_prop_intangible_p): Update prototype.
17158 (compute_display_string_pos, compute_display_string_end):
17159 Declare prototypes.
17160 (struct bidi_it): New members nchars and disp_pos. ch_len is now
17161 EMACS_INT.
17162
17163 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
17164
17165 Malloc failure behavior now depends on size of allocation.
17166 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
17167 * lisp.h: Change signatures accordingly.
17168 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
17169 All callers changed. (Bug#8762)
17170
17171 * gnutls.c: Use Emacs's memory allocators.
17172 Without this change, the gnutls library would invoke malloc etc.
17173 directly, which causes problems on non-SYNC_INPUT hosts, and which
17174 runs afoul of improving memory_full behavior. (Bug#8761)
17175 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
17176 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
17177 xfree instead of the default malloc, realloc, free.
17178 (Fgnutls_boot): No need to check for memory allocation failure,
17179 since xmalloc does that for us.
17180
17181 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
17182 * category.c (hash_get_category_set):
17183 * ccl.c (ccl_driver):
17184 * charset.c (Fdefine_charset_internal):
17185 * charset.h (struct charset.hash_index):
17186 * composite.c (get_composition_id, gstring_lookup_cache)
17187 (composition_gstring_put_cache):
17188 * composite.h (struct composition.hash_index):
17189 * dispextern.h (struct image.hash):
17190 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
17191 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
17192 (hashfn_equal, hashfn_user_defined, make_hash_table)
17193 (maybe_resize_hash_table, hash_lookup, hash_put)
17194 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
17195 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
17196 (Fsxhash, Fgethash, Fputhash, Fmaphash):
17197 * image.c (make_image, search_image_cache, lookup_image)
17198 (xpm_put_color_table_h):
17199 * lisp.h (struct Lisp_Hash_Table):
17200 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
17201 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
17202 for hashes and hash indexes, instead of 'unsigned' and 'int'.
17203 * alloc.c (allocate_vectorlike):
17204 Check for overflow in vector size calculations.
17205 * ccl.c (ccl_driver):
17206 Check for overflow when converting EMACS_INT to int.
17207 * fns.c, image.c: Remove unnecessary static decls that would otherwise
17208 need to be updated by these changes.
17209 * fns.c (make_hash_table, maybe_resize_hash_table):
17210 Check for integer overflow with large hash tables.
17211 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
17212 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
17213 (SXHASH_REDUCE): New macro.
17214 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
17215 Use it instead of discarding useful hash info with large hash values.
17216 (sxhash_float): New function.
17217 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
17218 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
17219 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
17220 Rewrite to use FIXNUM_BITS, as this simplifies things.
17221 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
17222 Adjust signatures to match updated version of code.
17223 (consing_since_gc): Now EMACS_INT, since a single hash table can
17224 use more than INT_MAX bytes.
17225
17226 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
17227
17228 Make it possible to build with GCC-4.6+ -O2 -flto.
17229
17230 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
17231
17232 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
17233
17234 * minibuf.c (get_minibuffer, read_minibuf_unwind):
17235 Call minibuffer-inactive-mode.
17236
17237 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
17238
17239 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
17240 Update dependencies.
17241
17242 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17243
17244 * data.c (init_data): Remove code for UTS, this system is not
17245 supported anymore.
17246
17247 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17248
17249 Don't force ./temacs to start in terminal mode.
17250
17251 * frame.c (make_initial_frame): Initialize faces in all cases, not
17252 only when CANNOT_DUMP is defined.
17253 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17254
17255 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17256
17257 * dispnew.c (add_window_display_history): Use const for the string
17258 pointer. Remove declaration, not needed.
17259
17260 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17261
17262 Use 'inline', not 'INLINE'.
17263 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
17264 * alloc.c, fontset.c (INLINE): Remove.
17265 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17266 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17267 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17268 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17269 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17270
17271 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17272
17273 Make it possible to run ./temacs.
17274
17275 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17276 syms_of_callproc does the same thing. Remove test for
17277 "initialized", do it in the caller.
17278 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17279
17280 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17281
17282 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
17283 (read_minibuf): Use get_minibuffer.
17284 (syms_of_minibuf): Use DEFSYM.
17285 (Qmetadata): New var.
17286 * data.c (Qbuffer): Don't make it static.
17287 (syms_of_data): Use DEFSYM.
17288
17289 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17290
17291 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17292 (CCL_CODE_MIN): New macro.
17293
17294 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17295
17296 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17297
17298 * eval.c (Qdebug): Now static.
17299 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17300 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17301 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17302
17303 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17304
17305 * image.c: Various fixes to ImageMagick code comments.
17306 (Fimagemagick_types): Doc fix.
17307
17308 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17309
17310 Minor fixes prompted by GCC 4.6.0 warnings.
17311
17312 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17313
17314 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17315 (x_clipboard_manager_save_all): Move extern decl to ...
17316 * xterm.h: ... here, so that it can be checked for consistency.
17317
17318 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17319
17320 * xselect.c (x_clipboard_manager_save_frame)
17321 (x_clipboard_manager_save_all): New functions.
17322 (Fx_clipboard_manager_save): Lisp function deleted.
17323
17324 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17325 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17326
17327 * xterm.h: Update prototype.
17328
17329 2011-05-28 William Xu <william.xwl@gmail.com>
17330
17331 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17332 exiting (Bug#8239).
17333
17334 2011-05-28 Jim Meyering <meyering@redhat.com>
17335
17336 Avoid a sign-extension bug in crypto_hash_function.
17337 * fns.c (to_uchar): Define.
17338 (crypto_hash_function): Use it to convert some newly-signed
17339 variables to unsigned, to avoid sign-extension bugs. For example,
17340 without this change, (md5 "truc") would evaluate to
17341 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17342 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
17343 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
17344
17345 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17346
17347 Integer overflow fixes.
17348
17349 * dbusbind.c: Serial number integer overflow fixes.
17350 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
17351 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17352 to hold a serial number that is too large for a fixnum.
17353 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17354 Check for serial numbers out of range. Decode any serial number
17355 that was so large that it became a float. (Bug#8722)
17356
17357 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17358 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17359 Use XFASTINT rather than XUINT when numbers are nonnegative.
17360 (xd_append_arg, Fdbus_method_return_internal):
17361 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17362 arguments, check that Lisp number is nonnegative, rather than
17363 silently wrapping negative numbers around. (Bug#8722)
17364 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
17365 (Bug#8722)
17366
17367 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17368
17369 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17370
17371 ccl: Add integer overflow checks.
17372 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17373 (IN_INT_RANGE): New macros.
17374 (ccl_driver): Use them to check for integer overflow when
17375 decoding a CCL program. Many of the new checks are whether XINT (x)
17376 fits in int; it doesn't always, on 64-bit hosts. The new version
17377 doesn't catch all possible integer overflows, but it's an
17378 improvement. (Bug#8719)
17379
17380 * alloc.c (make_event_array): Use XINT, not XUINT.
17381 There's no need for unsigned here.
17382
17383 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17384 This follows up to the 2011-05-06 change that substituted uintptr_t
17385 for EMACS_INT. This case wasn't caught back then.
17386
17387 Rework Fformat to avoid integer overflow issues.
17388 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17389 now (part of C89). Include <verify.h>.
17390 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17391 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17392 (Fformat): Avoid the prepass trying to compute sizes; it was only
17393 approximate and thus did not catch overflow reliably. Instead, walk
17394 through the format just once, formatting and computing sizes as we go,
17395 checking for integer overflow at every step, and allocating a larger
17396 buffer as needed. Keep track separately whether the format is
17397 multibyte. Keep only the most-recently calculated precision, rather
17398 than them all. Record whether each argument has been converted to
17399 string. Use EMACS_INT, not int, for byte and char and arg counts.
17400 Support field widths and precisions larger than INT_MAX. Avoid
17401 sprintf's undefined behavior with conversion specifications such as %#d
17402 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17403 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17404 formatting out-of-range floating point numbers with int
17405 formats. (Bug#8668)
17406
17407 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17408
17409 * data.c: Avoid integer truncation in expressions involving floats.
17410 * data.c: Include <intprops.h>.
17411 (arith_driver): When there's an integer overflow in an expression
17412 involving floating point, convert the integers to floating point
17413 so that the resulting value does not suffer from catastrophic
17414 integer truncation. For example, on a 64-bit host (* 4
17415 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17416 Do not rely on undefined behavior after integer overflow.
17417
17418 merge count_size_as_multibyte, parse_str_to_multibyte
17419 * character.c, character.h (count_size_as_multibyte):
17420 Rename from parse_str_to_multibyte; all uses changed.
17421 Check for integer overflow.
17422 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17423 since it's now a duplicate of the other. This is more of
17424 a character than a buffer op, so better that it's in character.c.
17425 * fns.c, print.c: Adjust to above changes.
17426
17427 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17428
17429 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17430
17431 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17432
17433 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17434 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17435 (x_clipboard_manager_save): Now static.
17436 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17437
17438 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17439 (crypto_hash_function): Now static.
17440 Fix pointer signedness problems. Avoid unnecessary initializations.
17441
17442 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
17443
17444 * termhooks.h (Vselection_alist): Make it terminal-local.
17445
17446 * terminal.c (create_terminal): Initialize it.
17447
17448 * xselect.c: Support for clipboard managers.
17449 (Vselection_alist): Move to termhooks.h as terminal-local var.
17450 (LOCAL_SELECTION): New macro.
17451 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17452 (symbol_to_x_atom): Remove gratuitous arg.
17453 (x_handle_selection_request, lisp_data_to_selection_data)
17454 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
17455 (x_own_selection, x_get_local_selection, x_convert_selection):
17456 New arg, specifying work frame. Use terminal-local Vselection_alist.
17457 (some_frame_on_display): Delete unused function.
17458 (Fx_own_selection_internal, Fx_get_selection_internal)
17459 (Fx_disown_selection_internal, Fx_selection_owner_p)
17460 (Fx_selection_exists_p): New optional frame arg.
17461 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17462 (x_handle_selection_clear): Don't treat other terminals with the
17463 same keyboard specially. Use the terminal-local Vselection_alist.
17464 (x_clear_frame_selections): Use Frun_hook_with_args.
17465
17466 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17467
17468 * xterm.h: Add support for those atoms.
17469
17470 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
17471
17472 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17473 (converted_selections, conversion_fail_tag): New global variables.
17474 (x_selection_request_lisp_error): Free the above.
17475 (x_get_local_selection): Remove unnecessary code.
17476 (x_reply_selection_request): Args changed; handle arbitrary array
17477 of converted selections stored in converted_selections.
17478 Separate the XChangeProperty and SelectionNotify steps.
17479 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17480 (x_convert_selection): New function.
17481 (x_handle_selection_event): Simplify.
17482 (x_get_foreign_selection): Don't ignore incoming requests while
17483 waiting for an answer; this will fail when we implement
17484 SAVE_TARGETS, and seems unnecessary anyway.
17485 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17486 (Vx_sent_selection_functions): Doc fix.
17487
17488 2011-05-26 Leo Liu <sdl.web@gmail.com>
17489
17490 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17491
17492 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17493
17494 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17495
17496 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17497 for fringe update if it has periodic bitmap.
17498 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
17499 and fringe_bitmap_periodic_p.
17500
17501 * fringe.c (get_fringe_bitmap_data): New function.
17502 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17503 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17504 row. Mark glyph row for fringe update if periodicity changed.
17505
17506 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17507 for fringe update unless it has periodic bitmap.
17508
17509 2011-05-25 Kenichi Handa <handa@m17n.org>
17510
17511 * xdisp.c (get_next_display_element): Set correct it->face_id for
17512 a static composition.
17513
17514 2011-05-24 Leo Liu <sdl.web@gmail.com>
17515
17516 * deps.mk (fns.o):
17517 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17518
17519 * fns.c (crypto_hash_function, Fsha1): New function.
17520 (Fmd5): Use crypto_hash_function.
17521 (syms_of_fns): Add Ssha1.
17522
17523 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17524
17525 * gnutls.c: Remove unused macros.
17526 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17527 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17528 Remove macros that are defined and never used.
17529 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17530
17531 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17532
17533 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17534 (Fx_get_selection_internal): Minor cleanup.
17535 (Fx_own_selection_internal): Rename arguments for consistency with
17536 select.el.
17537
17538 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17539
17540 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17541
17542 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17543
17544 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17545
17546 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17547
17548 * dispnew.c (scrolling_window): Don't exclude the case that the
17549 last enabled row in the desired matrix touches the bottom boundary.
17550
17551 2011-05-21 Glenn Morris <rgm@gnu.org>
17552
17553 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17554 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17555 and add some more files.
17556
17557 2011-05-20 Eli Zaretskii <eliz@gnu.org>
17558
17559 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17560 report_file_error introduced by the change from 2011-05-07.
17561
17562 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17563
17564 * systime.h (Time): Define only if emacs is defined.
17565 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17566 where the include path doesn't have X11/X.h by default. See
17567 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17568
17569 2011-05-20 Kenichi Handa <handa@m17n.org>
17570
17571 * composite.c (find_automatic_composition): Fix previous change.
17572
17573 2011-05-20 Glenn Morris <rgm@gnu.org>
17574
17575 * lisp.mk: New file, split from Makefile.in.
17576 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17577 (shortlisp): Remove.
17578 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17579
17580 2011-05-19 Glenn Morris <rgm@gnu.org>
17581
17582 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17583 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17584 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17585 (lisp): Set the order to that of loadup.el.
17586 (shortlisp): Make it a copy of $lisp.
17587 (SOME_MACHINE_LISP): Remove.
17588 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17589 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17590
17591 2011-05-18 Kenichi Handa <handa@m17n.org>
17592
17593 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17594 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17595 (find_automatic_composition): Mostly rewrite for efficiency.
17596
17597 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
17598
17599 * makefile.w32-in: Update dependencies.
17600
17601 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17602
17603 * menu.c: Include limits.h (fixes the MS-Windows build broken by
17604 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17605
17606 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
17607
17608 Fix some integer overflow issues, such as string length overflow.
17609
17610 * insdel.c (count_size_as_multibyte): Check for string overflow.
17611
17612 * character.c (lisp_string_width): Check for string overflow.
17613 Use EMACS_INT, not int, for string indexes and lengths; in
17614 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17615 the resulting string length overflows an EMACS_INT; instead,
17616 report a string overflow if no precision given. When checking for
17617 precision exhaustion, use a check that cannot possibly have
17618 integer overflow. (Bug#8675)
17619 * character.h (lisp_string_width): Adjust to new signature.
17620
17621 * alloc.c (string_overflow): New function.
17622 (Fmake_string): Use it. This doesn't change behavior, but saves
17623 a few bytes and will simplify future changes.
17624 * character.c (string_escape_byte8): Likewise.
17625 * lisp.h (string_overflow): New decl.
17626
17627 Fixups, following up to the user-interface timestamp change.
17628 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17629 for UI timestamps, instead of unsigned long.
17630 * msdos.c (mouse_get_pos): Likewise.
17631 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17632 * w32gui.h (Time): Define by including "systime.h" rather than by
17633 declaring it ourselves. (Bug#8664)
17634
17635 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17636 * image.c (clear_image_cache): Likewise.
17637
17638 * term.c (term_mouse_position): Don't assume time_t wraparound.
17639
17640 Be more systematic about user-interface timestamps.
17641 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17642 and sometimes 'EMACS_UINT', to represent these timestamps.
17643 This change causes it to use 'Time' uniformly, as that's what X uses.
17644 This makes the code easier to follow, and makes it easier to catch
17645 integer overflow bugs such as Bug#8664.
17646 * frame.c (Fmouse_position, Fmouse_pixel_position):
17647 Use Time, not unsigned long, for user-interface timestamps.
17648 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17649 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17650 * keyboard.h (last_event_timestamp): Likewise.
17651 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17652 * menu.h (xmenu_show): Likewise.
17653 * term.c (term_mouse_position): Likewise.
17654 * termhooks.h (struct input_event.timestamp): Likewise.
17655 (struct terminal.mouse_position_hook): Likewise.
17656 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17657 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17658 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17659 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17660 what it was before.
17661 * menu.h, termhooks.h: Include "systime.h", for Time.
17662
17663 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17664 Don't assume that the difference between two unsigned long values
17665 can fit into an integer. At this point, we know button_down_time
17666 <= event->timestamp, so the difference must be nonnegative, so
17667 there's no need to cast the result if double-click-time is
17668 nonnegative, as it should be; check that it's nonnegative, just in
17669 case. This bug is triggered when events are more than 2**31 ms
17670 apart (about 25 days). (Bug#8664)
17671
17672 * xselect.c (last_event_timestamp): Remove duplicate decl.
17673 (x_own_selection): Remove needless cast to unsigned long.
17674
17675 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17676 that always fit in int. Use a sentinel instead of a counter, to
17677 avoid a temp and to allay GCC's concerns about possible int overflow.
17678 * frame.h (struct frame): Use int for menu_bar_items_used
17679 instead of EMACS_INT, since it always fits in int.
17680
17681 * menu.c (grow_menu_items): Check for int overflow.
17682
17683 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17684
17685 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17686 Before, the code was not consistent. These values cannot exceed
17687 2**31 - 1 so there's no need to make them unsigned.
17688 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17689 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17690 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17691 as modifiers.
17692 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17693
17694 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17695 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17696 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17697 presumably because the widths might not match.
17698
17699 * window.c (size_window): Avoid needless test at loop start.
17700
17701 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17702
17703 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17704
17705 2011-05-12 Drew Adams <drew.adams@oracle.com>
17706
17707 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17708
17709 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17710
17711 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17712 `width' to `bar_area_x' and `bar_area_width', respectively.
17713 (x_scroll_run): Take account of fringe background extension.
17714
17715 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17716 Rename local vars `left' and `width' to `bar_area_x' and
17717 `bar_area_width', respectively.
17718 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17719 background extension.
17720
17721 2011-05-10 Jim Meyering <meyering@redhat.com>
17722
17723 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17724
17725 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17726
17727 * image.c (Finit_image_library): Return t for built-in image types,
17728 like pbm and xbm. (Bug#8640)
17729
17730 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17731
17732 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17733
17734 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17735
17736 * w32console.c (Fset_screen_color): Doc fix.
17737 (Fget_screen_color): New function.
17738 (syms_of_ntterm): Defsubr it.
17739
17740 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17741 unlink the temporary file if Fcall_process didn't create it in the
17742 first place.
17743 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17744 child process will be redirected to a file specified with `:file'.
17745 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17746 cue to call_process_cleanup not to close that handle.
17747
17748 2011-05-07 Ben Key <bkey76@gmail.com>
17749
17750 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17751 one of two shell specific rules, either bootstrap-temacs-CMD or
17752 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17753 to the previous implementation of the bootstrap-temacs rule.
17754 The bootstrap-temacs-CMD rule is similar to the previous
17755 implementation of the bootstrap-temacs rule except that it
17756 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17757 variable.
17758
17759 These changes, along with some changes to nt/configure.bat,
17760 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17761 earlier fix to add support for --cflags and --ldflags options
17762 that include quotes so that it works whether make uses cmd or
17763 sh as the shell.
17764
17765 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17766
17767 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17768 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17769 is a constant.
17770 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17771 a string. Handle both cases.
17772 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17773 (Fdbus_register_method): Use Qinvalid_function.
17774
17775 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17776
17777 * makefile.w32-in: Update dependencies.
17778 (LISP_H): Add inttypes.h and stdin.h.
17779 (PROCESS_H): Add unistd.h.
17780
17781 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17782
17783 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17784 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17785
17786 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17787
17788 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17789
17790 * term.c (vfatal): Remove stray call to va_end.
17791 It's not needed and the C Standard doesn't allow it here anyway.
17792
17793 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17794 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17795
17796 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17797 bytes.
17798
17799 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17800
17801 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17802
17803 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17804
17805 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17806
17807 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17808
17809 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17810 * charset.c (Fdefine_charset_internal): Don't initialize
17811 charset.code_space[15]. The value was garbage, on hosts with
17812 32-bit int (Bug#8600).
17813
17814 * lread.c (read_integer): Be more consistent with string-to-number.
17815 Use string_to_number to do the actual conversion; this avoids
17816 rounding errors and fixes some other screwups. Without this fix,
17817 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17818 (digit_to_number): Move earlier, for benefit of read_integer.
17819 Return -1 if the digit is out of range for the base, -2 if it is
17820 not a digit in any supported base. (Bug#8602)
17821
17822 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17823
17824 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17825 to match comment at start of function. This also removes a
17826 GCC warning about overflow in a 32+64-bit port.
17827
17828 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17829
17830 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17831 Reported by Stefan Monnier in
17832 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17833 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17834 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17835
17836 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17837 (EMACS_UINTPTR): Likewise, with uintptr_t.
17838
17839 * lisp.h: Prefer 64-bit EMACS_INT if available.
17840 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17841 on 32-bit hosts that have 64-bit int, so that they can access
17842 large files.
17843 However, temporarily disable this change unless the temporary
17844 symbol WIDE_EMACS_INT is defined.
17845
17846 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17847
17848 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17849 This removes an assumption that EMACS_INT and long are the same
17850 width as pointers. The assumption is true for Emacs porting targets
17851 now, but we want to make other targets possible.
17852 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17853 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17854 In the rest of the code, change types of integers that hold casted
17855 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17856 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17857 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17858 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17859 No need to cast type when ORing.
17860 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17861 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17862 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17863 assume EMACS_INT is the same width as char *.
17864 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17865 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17866 Remove no-longer-needed casts.
17867 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17868 (xg_tool_bar_help_callback, xg_make_tool_item):
17869 Use EMACS_INTPTR to hold an integer
17870 that will be cast to void *; this can avoid a GCC warning
17871 if EMACS_INT is not the same width as void *.
17872 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17873 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17874 (current_message_1, set_message_1):
17875 Use a local to convert to proper width without a cast.
17876 * xmenu.c (dialog_selection_callback): Likewise.
17877
17878 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17879 Also, don't assume VALBITS / RAND_BITS is less than 5,
17880 and don't rely on undefined behavior when shifting a 1 left into
17881 the sign bit.
17882 * lisp.h (get_random): Change signature to match.
17883
17884 * lread.c (hash_string): Use size_t, not int, for hash computation.
17885 Normally we prefer signed values; but hashing is special, because
17886 it's better to use unsigned division on hash table sizes so that
17887 the remainder is nonnegative. Also, size_t is the natural width
17888 for hashing into memory. The previous code used 'int', which doesn't
17889 retain enough info to hash well into very large tables.
17890 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17891
17892 * dbusbind.c: Don't possibly lose pointer info when converting.
17893 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17894 Use XPNTR rather than XHASH, so that the high-order bits of
17895 the pointer aren't lost when converting through void *.
17896
17897 * eval.c (Fautoload): Don't double-shift a pointer.
17898
17899 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17900
17901 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17902
17903 * gnutls.c (DEF_GNUTLS_FN):
17904 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17905
17906 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17907
17908 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17909 marker. (Bug#8610)
17910
17911 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17912
17913 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17914 New version that can reserve upto 2GB of heap space.
17915
17916 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
17917
17918 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17919
17920 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17921
17922 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17923 `gnutls_certificate_set_x509_key_file'.
17924
17925 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
17926
17927 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17928 Update dependencies.
17929
17930 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17931
17932 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17933 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17934 Remove unused parameter `fildes'.
17935 * process.c (read_process_output, send_process): Don't pass it.
17936
17937 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17938
17939 Fix previous change: the library cache is defined in w32.c.
17940 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17941 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17942
17943 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17944
17945 Implement dynamic loading of GnuTLS on Windows.
17946
17947 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17948 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17949 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17950 Declare.
17951
17952 * gnutls.c (Qgnutls_dll): Define.
17953 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17954 (gnutls_*): Declare function pointers.
17955 (init_gnutls_functions): New function to initialize function pointers.
17956 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17957 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17958 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17959 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17960 (emacs_gnutls_write, emacs_gnutls_read)
17961 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17962 (Fgnutls_available_p): New function.
17963 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17964 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17965 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17966
17967 * image.c: Include w32.h.
17968 (Vimage_type_cache): Delete.
17969 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17970 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17971 (w32_delayed_load): Move to w32.c.
17972
17973 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17974
17975 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17976 (w32_delayed_load): Move from image.c. When loading a library, record
17977 its filename in the :loaded-from property of the library id.
17978 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17979 Initialize and staticpro them.
17980 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17981
17982 * process.c: Include lisp.h before w32.h, not after.
17983 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17984 instead of gnutls_record_check_pending.
17985
17986 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17987
17988 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17989
17990 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17991 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17992 as passed in.
17993
17994 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17995
17996 * xterm.c (x_set_frame_alpha): Do not set property on anything
17997 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17998
17999 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
18000
18001 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
18002
18003 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
18004
18005 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
18006 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
18007 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
18008 (gnutls_global_initialized, Qgnutls_bootprop_priority)
18009 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
18010 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
18011 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
18012 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
18013 (Qgnutls_bootprop_callbacks_verify): Make static.
18014
18015 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
18016
18017 * callproc.c: Indentation fixup.
18018
18019 * sysdep.c (wait_for_termination_1): Make static.
18020 (wait_for_termination, interruptible_wait_for_termination):
18021 Move after wait_for_termination_1.
18022
18023 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
18024
18025 * sysdep.c (interruptible_wait_for_termination): New function
18026 which is like wait_for_termination, but allows keyboard
18027 interruptions.
18028
18029 * callproc.c (Fcall_process): Add (:file "file") as an option for
18030 the STDOUT buffer.
18031 (Fcall_process_region): Ditto.
18032
18033 2011-04-30 Eli Zaretskii <eliz@gnu.org>
18034
18035 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
18036 rather than `XVECTOR (FOO)->size'.
18037
18038 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
18039 inttypes.h, as a gnulib replacement is used if it not available in
18040 system headers.
18041
18042 2011-04-21 Eli Zaretskii <eliz@gnu.org>
18043
18044 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
18045 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
18046 of MOST_POSITIVE_FIXNUM. (Bug#8528)
18047
18048 * coding.c (coding_alloc_by_realloc): Error out if destination
18049 will grow beyond MOST_POSITIVE_FIXNUM.
18050 (decode_coding_emacs_mule): Abort if there isn't enough place in
18051 charbuf for the composition carryover bytes. Reserve an extra
18052 space for up to 2 characters produced in a loop.
18053 (decode_coding_iso_2022): Abort if there isn't enough place in
18054 charbuf for the composition carryover bytes.
18055
18056 2011-04-21 Eli Zaretskii <eliz@gnu.org>
18057
18058 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
18059 aborting when %lld or %lll format is passed.
18060 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
18061 %llo or %llx format is passed. (Bug#8545)
18062
18063 * window.c (window_scroll_line_based): Use a marker instead of
18064 simple variables to record original value of point. (Bug#7952)
18065
18066 * doprnt.c (doprnt): Fix the case where a multibyte sequence
18067 produced by %s or %c overflows available buffer space. (Bug#8545)
18068
18069 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
18070
18071 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
18072 (SIZE_MAX): Move defn after all includes, as they might #define it.
18073
18074 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18075
18076 * w32.c (init_environment): Warn about defaulting HOME to C:\.
18077
18078 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18079
18080 * keyboard.c (Qdelayed_warnings_hook): Define.
18081 (command_loop_1): Run `delayed-warnings-hook'
18082 if Vdelayed_warnings_list is non-nil.
18083 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
18084 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
18085
18086 2011-04-28 Eli Zaretskii <eliz@gnu.org>
18087
18088 * doprnt.c (doprnt): Don't return value smaller than the buffer
18089 size if the message was truncated. (Bug#8545).
18090
18091 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18092
18093 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
18094 (Fx_window_property): #if-0 the whole functions, not just the bodies.
18095
18096 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18097
18098 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
18099
18100 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
18101
18102 * makefile.w32-in: Update dependencies.
18103
18104 2011-04-27 Eli Zaretskii <eliz@gnu.org>
18105
18106 Improve `doprnt' and its usage. (Bug#8545)
18107 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
18108 `format_end'. Remove support for %l as a conversion specifier.
18109 Don't use xrealloc. Improve diagnostics when the %l size modifier
18110 is used. Update the commentary.
18111
18112 * eval.c (verror): Simplify calculation of size_t.
18113
18114 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
18115 messages.
18116
18117 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
18118
18119 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
18120 change.
18121
18122 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18123
18124 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
18125 This makes this file independent of the recent pseudovector change.
18126
18127 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
18128
18129 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
18130
18131 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
18132 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
18133 Remove unused local.
18134 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
18135
18136 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
18137 GCC 4.6.0 optimizes based on type-based alias analysis.
18138 For example, if b is of type struct buffer * and v of type struct
18139 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
18140 != &v->size, and therefore "v->size = 1; b->size = 2; return
18141 v->size;" must therefore return 1. This assumption is incorrect
18142 for Emacs, since it type-puns struct Lisp_Vector * with many other
18143 types. To fix this problem, this patch adds a new type struct
18144 vectorlike_header that documents the constraints on layout of vectors
18145 and pseudovectors, and helps optimizing compilers not get fooled
18146 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
18147 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
18148 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
18149 the size member.
18150 (XSETPVECTYPE): Rewrite in terms of new macro.
18151 (XSETPVECTYPESIZE): New macro, specifying both type and size.
18152 This is a bit clearer, and further avoids the possibility of
18153 undesirable aliasing.
18154 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
18155 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
18156 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
18157 since Lisp_Subr is a special case (no "next" field).
18158 (ASIZE): Now uses header.size rather than size.
18159 All previous uses of XVECTOR (foo)->size replaced to use this macro,
18160 to avoid the hassle of writing XVECTOR (foo)->header.size.
18161 (struct vectorlike_header): New type.
18162 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
18163 object, to help avoid aliasing.
18164 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
18165 (SUBRP): Likewise, since Lisp_Subr is a special case.
18166 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
18167 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
18168 (struct Lisp_Hash_Table): Combine first two members into a single
18169 struct vectorlike_header member. All uses of "size" and "next" members
18170 changed to be "header.size" and "header.next".
18171 * buffer.h (struct buffer): Likewise.
18172 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
18173 * frame.h (struct frame): Likewise.
18174 * process.h (struct Lisp_Process): Likewise.
18175 * termhooks.h (struct terminal): Likewise.
18176 * window.c (struct save_window_data, struct saved_window): Likewise.
18177 * window.h (struct window): Likewise.
18178 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
18179 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
18180 * buffer.c (init_buffer_once): Likewise.
18181 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
18182 special case.
18183 * process.c (Fformat_network_address): Use local var for size,
18184 for brevity.
18185
18186 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
18187
18188 Make the Lisp reader and string-to-float more consistent (Bug#8525)
18189 * data.c (atof): Remove decl; no longer used or needed.
18190 (digit_to_number): Move to lread.c.
18191 (Fstring_to_number): Use new string_to_number function, to be
18192 consistent with how the Lisp reader treats infinities and NaNs.
18193 Do not assume that floating-point numbers represent EMACS_INT
18194 without losing information; this is not true on most 64-bit hosts.
18195 Avoid double-rounding errors, by insisting on integers when
18196 parsing non-base-10 numbers, as the documentation specifies.
18197 * lisp.h (string_to_number): New decl, replacing ...
18198 (isfloat_string): Remove.
18199 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
18200 (read1): Do not accept +. and -. as integers; this
18201 appears to have been a coding error. Similarly, do not accept
18202 strings like +-1e0 as floating point numbers. Do not report
18203 overflow for integer overflows unless the base is not 10 which
18204 means we have no simple and reliable way to continue.
18205 Break out the floating-point parsing into a new
18206 function string_to_number, so that Fstring_to_number parses
18207 floating point numbers consistently with the Lisp reader.
18208 (digit_to_number): Move here from data.c. Make it static inline.
18209 (E_CHAR, EXP_INT): Remove, replacing with ...
18210 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
18211 (string_to_number): New function, replacing isfloat_string.
18212 This function checks for valid syntax and produces the resulting
18213 Lisp float number too. Rework it so that string-to-number
18214 no longer mishandles examples like "1.0e+". Use strtoumax,
18215 so that overflow for non-base-10 numbers is reported only when
18216 there's no portable and simple way to convert to floating point.
18217
18218 * textprop.c (set_text_properties_1): Rewrite for clarity,
18219 and to avoid GCC warning about integer overflow.
18220
18221 * intervals.h (struct interval): Use EMACS_INT for members
18222 where EMACS_UINT might cause problems. See
18223 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
18224 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
18225 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
18226 All uses changed.
18227 (offset_intervals): Tell GCC not to worry about length overflow
18228 when negating a negative length.
18229
18230 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
18231 (overrun_check_free): Likewise.
18232
18233 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
18234 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
18235 word size.
18236
18237 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18238 (gnutls_make_error): Rename local to avoid shadowing.
18239 (gnutls_emacs_global_deinit): ifdef out; not used.
18240 (Fgnutls_boot): Use const for pointer to readonly storage.
18241 Comment out unused local. Fix pointer signedness problems.
18242
18243 * lread.c (openp): Don't stuff size_t into an 'int'.
18244 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
18245 about possible signed overflow.
18246
18247 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18248 (GDK_KEY_g): Don't define if already defined.
18249 (xg_prepare_tooltip): Avoid pointer signedness problem.
18250 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18251
18252 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18253 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18254
18255 * xfns.c (Fx_window_property): Simplify a bit,
18256 to make a bit faster and to avoid GCC 4.6.0 warning.
18257 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18258
18259 * fns.c (internal_equal): Don't assume size_t fits in int.
18260
18261 * alloc.c (compact_small_strings): Tighten assertion a little.
18262
18263 Replace pEd with more-general pI, and fix some printf arg casts.
18264 * lisp.h (pI): New macro, generalizing old pEd macro to other
18265 conversion specifiers. For example, use "...%"pI"d..." rather
18266 than "...%"pEd"...".
18267 (pEd): Remove. All uses replaced with similar uses of pI.
18268 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
18269 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18270 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18271 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18272 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18273 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18274 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18275 64-bit hosts.
18276 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18277 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18278 * print.c (safe_debug_print, print_object): Likewise.
18279 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18280 to int.
18281 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18282 avoiding the 0 flag, which is not portable.
18283 * process.c (Fmake_network_process): Use pI to avoid cast.
18284 * region-cache.c (pp_cache): Likewise.
18285 * xdisp.c (decode_mode_spec): Likewise.
18286 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18287 behavior on 64-bit hosts with printf arg.
18288 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
18289 (x_stop_queuing_selection_requests): Likewise.
18290 (x_get_window_property): Don't truncate byte count to an 'int'
18291 when tracing.
18292
18293 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18294 here, since it parses constructs like leading '-' and spaces,
18295 which are not wanted; and it overflows with large numbers.
18296 Instead, simply match F[0-9]+, which is what is wanted anyway.
18297
18298 * alloc.c: Remove unportable assumptions about struct layout.
18299 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18300 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18301 (allocate_vectorlike, make_pure_vector): Use the new macros,
18302 plus offsetof, to remove unportable assumptions about struct layout.
18303 These assumptions hold on all porting targets that I know of, but
18304 they are not guaranteed, they're easy to remove, and removing them
18305 makes further changes easier.
18306
18307 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18308 This doesn't fix a bug but makes the code clearer.
18309 (string_overrun_cookie): Now const. Use initializers that
18310 don't formally overflow signed char, to avoid warnings.
18311 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18312 can cause Emacs to crash when string overrun checking is enabled.
18313 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18314 multiple of sizeof (EMACS_INT); it need not be, if
18315 alignof(EMACS_INT) < sizeof (EMACS_INT).
18316 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
18317
18318 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
18319
18320 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18321
18322 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18323
18324 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
18325 supposed to be handshaking. (Bug#8556)
18326 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18327
18328 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
18329
18330 * lisp.h (Qdebug): List symbol.
18331 * eval.c (Qdebug): Restore global linkage.
18332 * keyboard.c (debug-on-event): New variable.
18333 (handle_user_signal): Break into debugger when debug-on-event
18334 matches the current signal symbol.
18335
18336 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18337
18338 * alloc.c (check_sblock, check_string_bytes)
18339 (check_string_free_list): Convert to standard C.
18340
18341 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18342
18343 * w32.c (emacs_gnutls_push): Fix typo.
18344
18345 2011-04-25 Eli Zaretskii <eliz@gnu.org>
18346
18347 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18348 "cast to pointer from integer of different size".
18349
18350 Improve doprnt and its use in verror. (Bug#8545)
18351 * doprnt.c (doprnt): Document the set of format control sequences
18352 supported by the function. Use SAFE_ALLOCA instead of always
18353 using `alloca'.
18354
18355 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18356 is one byte too soon. Don't use xrealloc; instead xfree and
18357 xmalloc anew.
18358
18359 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18360
18361 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18362 callbacks stage.
18363
18364 * gnutls.c: Renamed global_initialized to
18365 gnutls_global_initialized. Added internals for the
18366 :verify-hostname-error, :verify-error, and :verify-flags
18367 parameters of `gnutls-boot' and documented those parameters in the
18368 docstring. Start callback support.
18369 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18370 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18371 on error. Return error code.
18372 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18373 (emacs_gnutls_read): Likewise.
18374 (Fgnutls_boot): Return handshake error code.
18375 (emacs_gnutls_handle_error): New function.
18376 (wsaerror_to_errno): Likewise.
18377
18378 * w32.h (emacs_gnutls_pull): Add prototype.
18379 (emacs_gnutls_push): Likewise.
18380
18381 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18382 (emacs_gnutls_push): Likewise.
18383
18384 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18385
18386 * process.c (wait_reading_process_output): Check if GnuTLS
18387 buffered some data internally if no FDs are set for TLS
18388 connections.
18389
18390 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18391 (LIBS): Link to USER_LIBS.
18392 ($(BLD)/gnutls.$(0)): New target.
18393
18394 2011-04-24 Eli Zaretskii <eliz@gnu.org>
18395
18396 * xdisp.c (handle_single_display_spec): Rename the
18397 display_replaced_before_p argument into display_replaced_p, to
18398 make it consistent with the commentary. Fix typos in the
18399 commentary.
18400
18401 * textprop.c (syms_of_textprop): Remove dead code.
18402 (copy_text_properties): Delete obsolete commentary about an
18403 interface that was deleted long ago. Fix typos in the description
18404 of arguments.
18405
18406 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18407 to changes in oldXMenu/XMenu.h from 2011-04-16.
18408 <menu_help_message, prev_menu_help_message>: Constify.
18409 (IT_menu_make_room): menu->help_text is now `const char **';
18410 adjust.
18411
18412 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18413 to changes in oldXMenu/XMenu.h from 2011-04-16.
18414 (struct XMenu): Declare `help_text' `const char **'.
18415
18416 * xfaces.c <Qunspecified>: Make extern again.
18417
18418 * syntax.c: Include sys/types.h before including regex.h, as
18419 required by POSIX.
18420
18421 * doc.c (get_doc_string): Improve the format passed to `error'.
18422
18423 * doprnt.c (doprnt): Improve commentary.
18424
18425 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18426
18427 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18428 them with etags.
18429
18430 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18431 changes in globals.h immediately force recompilation.
18432 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18433 $(CURDIR)/s/ms-w32.h.
18434 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
18435
18436 * character.c (Fchar_direction): Function deleted.
18437 (syms_of_character): Don't defsubr it.
18438 <char-direction-table>: Deleted.
18439
18440 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18441
18442 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18443 * doprnt.c: Include limits.h.
18444 (SIZE_MAX): New macro.
18445 (doprnt): Return a size_t value. 2nd arg is now size_t.
18446 Many local variables are now size_t instead of int or unsigned.
18447 Improve overflow protection. Support `l' modifier for integer
18448 conversions. Support %l conversion. Don't assume an EMACS_INT
18449 argument for integer conversions and for %c.
18450
18451 * lisp.h (doprnt): Restore prototype.
18452
18453 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18454 $(SRC)/character.h.
18455
18456 * Makefile.in (base_obj): Add back doprnt.o.
18457
18458 * deps.mk (doprnt.o): Add back prerequisites.
18459 (callint.o): Depend on character.h.
18460
18461 * eval.c (internal_lisp_condition_case): Include the handler
18462 representation in the error message.
18463 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18464 when breaking from the loop.
18465
18466 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18467
18468 * callint.c (Fcall_interactively): When displaying error message
18469 about invalid control letter, pass the character's codepoint, not
18470 a pointer to its multibyte form. Improve display of the character
18471 in octal and display also its hex code.
18472
18473 * character.c (char_string): Use %x to display the (unsigned)
18474 codepoint of an invalid character, to avoid displaying a bogus
18475 negative value.
18476
18477 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18478 `error', not SYMBOL_NAME itself.
18479
18480 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18481 character arguments to `error'.
18482
18483 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18484 to `error' in error message about FINAL_CHAR argument. Make sure
18485 FINAL_CHAR is a character, and use %c when it is passed as
18486 argument to `error'.
18487
18488 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18489
18490 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18491
18492 * w32.c: Include <time.h>.
18493 (sys_localtime): New function.
18494
18495 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
18496
18497 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18498
18499 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
18500
18501 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
18502
18503 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18504 zombies (Bug#8467).
18505
18506 2011-04-19 Eli Zaretskii <eliz@gnu.org>
18507
18508 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18509 gl_state.e_property when gl_state.object is Qt.
18510
18511 * insdel.c (make_gap_larger): Remove limitation of buffer size
18512 to <= INT_MAX.
18513
18514 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
18515
18516 * xdisp.c (lookup_glyphless_char_display)
18517 (produce_glyphless_glyph): Handle cons cell entry in
18518 glyphless-char-display.
18519 (Vglyphless_char_display): Document it.
18520
18521 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18522 glyphless-char-display.
18523
18524 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
18525
18526 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18527
18528 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18529
18530 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18531 definition for no-X builds.
18532
18533 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
18534
18535 Static checks with GCC 4.6.0 and non-default toolkits.
18536
18537 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18538
18539 * process.c (keyboard_bit_set): Define only if SIGIO.
18540 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18541 (send_process): Repair possible setjmp clobbering.
18542
18543 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18544
18545 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18546
18547 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18548
18549 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18550 Define only if needed.
18551
18552 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18553 by pacifying GCC about it. Maybe it's time to retire it?
18554 * xfaces.c (USG, __TIMEVAL__): Likewise.
18555
18556 * dispextern.h (struct redisplay_interface): Rename param
18557 to avoid shadowing.
18558 * termhooks.h (struct terminal): Likewise.
18559 * xterm.c (xembed_send_message): Likewise.
18560
18561 * insdel.c (make_gap_smaller): Define only if
18562 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18563
18564 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18565 it.
18566
18567 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18568 so that we aren't warned about unused symbols.
18569
18570 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18571
18572 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18573
18574 * xfns.c (x_real_positions): Mark locals as initialized.
18575
18576 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18577
18578 * xterm.c: Fix problems found by static analysis with other toolkits.
18579 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18580 (x_dispatch_event): Declare static if USE_GTK, and
18581 define if USE_GTK || USE_X_TOOLKIT.
18582 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18583 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18584 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18585 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18586
18587 * xmenu.c (menu_help_callback): Pointer type fixes.
18588 Use const pointers when pointing at readonly data. Avoid pointer
18589 signedness clashes.
18590 (FALSE): Remove unused macro.
18591 (update_frame_menubar): Remove unused decl.
18592
18593 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18594
18595 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18596 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18597 (single_menu_item): Rename local to avoid shadowing.
18598
18599 * keyboard.c (make_lispy_event): Remove unused local var.
18600
18601 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18602 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18603
18604 * bitmaps: Change bitmaps from unsigned char back to the X11
18605 compatible char. Avoid the old compiler warnings about
18606 out-of-range initializers by using, for example, '\xab' rather
18607 than 0xab.
18608
18609 * xgselect.c (xgselect_initialize): Check vs interface
18610 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18611
18612 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18613
18614 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18615 to read-only memory.
18616
18617 * fns.c (vector): Remove; this old hack is no longer needed.
18618
18619 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18620 Remove unused var.
18621 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18622
18623 * xrdb.c (x_load_resources): Omit unused local.
18624
18625 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18626 (x_window): Rename locals to avoid shadowing.
18627 (USG): Use the kludged USG macro, to pacify gcc.
18628
18629 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18630 (x_term_init): Remove local to avoid shadowing.
18631
18632 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18633
18634 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18635 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18636
18637 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18638
18639 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18640
18641 Fix regex.c, syntax.c and friends for buffers > 2GB.
18642 * syntax.h (struct gl_state_s): Declare character position members
18643 EMACS_INT.
18644
18645 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18646
18647 * textprop.c (verify_interval_modification, interval_of):
18648 Declare arguments EMACS_INT.
18649
18650 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18651 EMACS_INT.
18652
18653 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18654
18655 * indent.c (Fvertical_motion): Local variable it_start is now
18656 EMACS_INT.
18657
18658 * regex.c (re_match, re_match_2, re_match_2_internal)
18659 (bcmp_translate, regcomp, regexec, print_double_string)
18660 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18661 (re_compile_pattern, re_exec): Declare arguments and local
18662 variables `size_t' and `ssize_t' and return values `regoff_t', as
18663 appropriate.
18664 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18665 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18666 <compile_stack_type>: `size' and `avail' are now `size_t'.
18667
18668 * regex.h <regoff_t>: Use ssize_t, not int.
18669 (re_search, re_search_2, re_match, re_match_2): Arguments that
18670 specify buffer/string position and length are now ssize_t and
18671 size_t. Return type is regoff_t.
18672
18673 2011-04-16 Ben Key <bkey76@gmail.com>
18674
18675 * nsfont.m: Fixed bugs in ns_get_family and
18676 ns_descriptor_to_entity that were caused by using free to
18677 deallocate memory blocks that were allocated by xmalloc (via
18678 xstrdup). This caused Emacs to crash when compiled with
18679 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18680 --enable-checking=xmallocoverrun). xfree is now used to
18681 deallocate these memory blocks.
18682
18683 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18684
18685 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18686
18687 emacs_write: Accept and return EMACS_INT for sizes.
18688 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18689 et seq.
18690 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18691 Accept and return EMACS_INT.
18692 (emacs_gnutls_write): Return the number of bytes written on
18693 partial writes.
18694 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18695 (emacs_read, emacs_write): Remove check for negative size, as the
18696 Emacs source code has been audited now.
18697 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18698 (emacs_read, emacs_write): Use it.
18699 * process.c (send_process): Adjust to the new signatures of
18700 emacs_write and emacs_gnutls_write. Do not attempt to store
18701 a byte offset into an 'int'; it might overflow.
18702 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18703
18704 * sound.c: Don't assume sizes fit in 'int'.
18705 (struct sound_device.period_size, alsa_period_size):
18706 Return EMACS_INT, not int.
18707 (struct sound_device.write, vox_write, alsa_write):
18708 Accept EMACS_INT, not int.
18709 (wav_play, au_play): Use EMACS_INT to store sizes and to
18710 record read return values.
18711
18712 2011-04-15 Ben Key <bkey76@gmail.com>
18713
18714 * keyboard.c (Qundefined): Don't declare static since it is used
18715 in nsfns.m.
18716 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18717 static since they are used in nsfont.m.
18718
18719 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18720
18721 * process.c (Qprocessp): Don't declare static.
18722 * lisp.h (Qprocessp): Declare again.
18723
18724 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18725
18726 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18727
18728 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18729
18730 Improve C-level modularity by making more things 'static'.
18731
18732 Don't publish debugger-only interfaces to other modules.
18733 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18734 (verify_bytepos, count_markers): Move decls to the only modules
18735 that need them.
18736 * region-cache.h (pp_cache): Likewise.
18737 * window.h (check_all_windows): Likewise.
18738 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18739
18740 * sysdep.c (croak): Now static, if
18741 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18742 * syssignal.h (croak): Declare only if not static.
18743
18744 * alloc.c (refill_memory_reserve): Now static if
18745 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18746 * lisp.h (refill_memory_reserve): Declare only if not static.
18747
18748 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18749 Define only if USE_LUCID.
18750
18751 * xrdb.c (x_customization_string, x_rm_string): Now static.
18752
18753 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18754 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18755
18756 * xdisp.c (draw_row_with_mouse_face): Now static.
18757 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18758
18759 * window.h (check_all_windows): Mark externally visible.
18760
18761 * window.c (window_deletion_count): Now static.
18762
18763 * undo.c: Make symbols static if they're not exported.
18764 (last_undo_buffer, last_boundary_position, pending_boundary):
18765 Now static.
18766
18767 * textprop.c (interval_insert_behind_hooks): Now static.
18768 (interval_insert_in_front_hooks): Likewise.
18769
18770 * term.c: Make symbols static if they're not exported.
18771 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18772 (max_frame_lines, tty_set_terminal_modes):
18773 (tty_reset_terminal_modes, tty_turn_off_highlight):
18774 (get_tty_terminal): Now static.
18775 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18776 * termhooks.h (term_mouse_moveto): Do not declare if
18777 HAVE_WINDOW_SYSTEM.
18778 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18779 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18780
18781 * sysdep.c: Make symbols static if they're not exported.
18782 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18783 Now static.
18784 (sigprocmask_set, full_mask): Remove; unused.
18785 (wait_debugging): Mark as visible.
18786 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18787 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18788
18789 * syntax.c (syntax_temp): Define only if !__GNUC__.
18790
18791 * sound.c (current_sound_device, current_sound): Now static.
18792
18793 * search.c (searchbufs, searchbuf_head): Now static.
18794
18795 * scroll.c (scroll_cost): Remove; unused.
18796 * dispextern.h (scroll_cost): Remove decl.
18797
18798 * region-cache.h (pp_cache): Mark as externally visible.
18799
18800 * process.c: Make symbols static if they're not exported.
18801 (process_tick, update_tick, create_process, chan_process):
18802 (Vprocess_alist, proc_buffered_char, datagram_access):
18803 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18804 (deactivate_process): Mark defn as static, as well as decl.
18805 * lisp.h (create_process): Remove decl.
18806 * process.h (chan_process, Vprocess_alist): Remove decls.
18807
18808 * print.c: Make symbols static if they're not exported.
18809 (print_depth, new_backquote_output, being_printed, print_buffer):
18810 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18811 (print_interval, print_number_index, initial_stderr_stream):
18812 Now static.
18813 * lisp.h (Fprinc): Remove decl.
18814 (debug_output_compilation_hack): Mark as externally visible.
18815
18816 * sysdep.c (croak): Move decl from here to syssignal.h.
18817 * syssignal.h (croak): Put it here, so the API can be checked when
18818 'croak' is called from dissociate_if_controlling_tty.
18819
18820 * minibuf.c: Make symbols static if they're not exported.
18821 (minibuf_save_list, choose_minibuf_frame): Now static.
18822 * lisp.h (choose_minibuf_frame): Remove decl.
18823
18824 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18825
18826 * lread.c: Make symbols static if they're not exported.
18827 (read_objects, initial_obarray, oblookup_last_bucket_number):
18828 Now static.
18829 (make_symbol): Remove; unused.
18830 * lisp.h (initial_obarray, make_symbol): Remove decls.
18831
18832 * keyboard.c: Make symbols static if they're not exported.
18833 (single_kboard, recent_keys_index, total_keys, recent_keys):
18834 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18835 (this_single_command_key_start, echoing, last_auto_save):
18836 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18837 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18838 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18839 (Vlispy_mouse_stem, double_click_count):
18840 Now static.
18841 (force_auto_save_soon): Define only if SIGDANGER.
18842 (ignore_mouse_drag_p): Now static if
18843 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18844 (print_help): Remove; unused.
18845 (stop_character, last_timer_event): Mark as externally visible.
18846 * keyboard.h (ignore_mouse_drag_p): Declare only if
18847 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18848 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18849 * lisp.h (echoing): Remove decl.
18850 (force_auto_save_soon): Declare only if SIGDANGER.
18851 * xdisp.c (redisplay_window): Simplify code, to make it more
18852 obvious that ignore_mouse_drag_p is not accessed if !defined
18853 USE_GTK && !defined HAVE_NS.
18854
18855 * intervals.c: Make symbols static if they're not exported.
18856 (merge_properties_sticky, merge_interval_right, delete_interval):
18857 Now static.
18858 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18859
18860 * insdel.c: Make symbols static if they're not exported.
18861 However, leave prepare_to_modify_buffer alone. It's never
18862 called from outside this function, but that appears to be a bug.
18863 (combine_after_change_list, combine_after_change_buffer):
18864 (adjust_after_replace, signal_before_change): Now static.
18865 (adjust_after_replace_noundo): Remove; unused.
18866 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18867 (signal_before_change): Remove decls.
18868
18869 * indent.c (val_compute_motion, val_vmotion): Now static.
18870
18871 * image.c: Make symbols static if they're not exported.
18872 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18873 if USE_GTK.
18874 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18875 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18876
18877 * fringe.c (standard_bitmaps): Now static.
18878 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18879
18880 * frame.c: Make symbols static if they're not exported.
18881 (x_report_frame_params, make_terminal_frame): Now static.
18882 (get_frame_param): Now static, unless HAVE_NS.
18883 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18884 (x_get_resource_string): Remove; not used.
18885 * frame.h (make_terminal_frame, x_report_frame_params):
18886 (x_get_resource_string); Remove decls.
18887 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18888 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18889
18890 * font.c, fontset.c: Make symbols static if they're not exported.
18891 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18892 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18893 * font.c (font_close_object): Now static.
18894 * font.h (font_close_object): Remove.
18895 * fontset.c (FONTSET_OBJLIST): Remove.
18896 (free_realized_fontset) #if-0 the body, which does nothing.
18897 (face_suitable_for_char_p): #if-0, as it's never called.
18898 * fontset.h (face_suitable_for_char_p): Remove decl.
18899 * xfaces.c (face_at_string_position):
18900 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18901 since 0 is always ASCII.
18902
18903 * fns.c (weak_hash_tables): Now static.
18904
18905 * fileio.c: Make symbols static if they're not exported.
18906 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18907 (Vwrite_region_annotation_buffers): Now static.
18908
18909 * eval.c: Make symbols static if they're not exported.
18910 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18911 * lisp.h (backtrace_list): Remove decl.
18912
18913 * emacs.c: Make symbols static if they're not exported.
18914 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18915 (fatal_error_code, fatal_error_signal_hook, standard_args):
18916 Now static.
18917 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18918 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18919 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18920 * lisp.h (fatal_error_signal_hook): Remove decl.
18921 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18922
18923 * editfns.c: Move a (normally-unused) function to its only use.
18924 * editfns.c, lisp.h (get_operating_system_release): Remove.
18925 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18926 worth the hassle of breaking this out.
18927
18928 * xterm.c: Make symbols static if they're not exported.
18929 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18930 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18931 (x_destroy_window, x_delete_display):
18932 Now static.
18933 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18934 (x_mouse_leave): Remove; unused.
18935 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18936 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18937 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18938 Remove decls.
18939 (x_mouse_leave): Declare only if WINDOWSNT.
18940 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18941 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18942 USE_X_TOOLKIT.
18943
18944 * ftxfont.c: Make symbols static if they're not exported.
18945 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18946 HAVE_FREETYPE.
18947 * font.h (ftxfont_driver): Likewise.
18948
18949 * xfns.c: Make symbols static if they're not exported.
18950 (x_last_font_name, x_display_info_for_name):
18951 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18952 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18953 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18954 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18955 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18956 (last_show_tip_args): Now static.
18957 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18958 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18959 (x_screen_planes): Remove; unused.
18960 * dispextern.h (x_screen_planes): Remove decl.
18961
18962 * dispnew.c: Make symbols static if they're not exported.
18963 * dispextern.h (redraw_garbaged_frames, scrolling):
18964 (increment_row_positions): Remove.
18965 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18966 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18967 Now static.
18968 (redraw_garbaged_frames): Remove; unused.
18969
18970 * xfaces.c: Make symbols static if they're not exported.
18971 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18972 Remove decls.
18973 * xterm.h (defined_color): Remove decls.
18974 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18975 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18976 (menu_face_changed_default, defined_color, free_realized_face):
18977 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18978 (ascii_face_of_lisp_face): Remove; unused.
18979
18980 * xdisp.c: Make symbols static if they're not exported.
18981 * dispextern.h (scratch_glyph_row, window_box_edges):
18982 (glyph_to_pixel_coords, set_cursor_from_row):
18983 (get_next_display_element, set_iterator_to_next):
18984 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18985 (show_mouse_face): Remove decls
18986 * frame.h (message_buf_print): Likewise.
18987 * lisp.h (pop_message, set_message, check_point_in_composition):
18988 Likewise.
18989 * xterm.h (set_vertical_scroll_bar): Likewise.
18990 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18991 (message_buf_print, scratch_glyph_row, displayed_buffer):
18992 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18993 (get_next_display_element, show_mouse_face, window_box_edges):
18994 (frame_to_window_pixel_xy, check_point_in_composition):
18995 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18996 (glyph_to_pixel_coords): Remove; unused.
18997
18998 * dired.c (file_name_completion): Now static.
18999
19000 * dbusbind.c (xd_in_read_queued_messages): Now static.
19001
19002 * lisp.h (circular_list_error, FOREACH): Remove; unused.
19003 * data.c (circular_list_error): Remove.
19004
19005 * commands.h (last_point_position, last_point_position_buffer):
19006 (last_point_position_window): Remove decls.
19007 * keyboard.c: Make these variables static.
19008
19009 * coding.h (coding, code_convert_region, encode_coding_gap):
19010 Remove decls.
19011 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
19012 (iso_code_class, detect_coding, code_convert_region): Now static.
19013 (encode_coding_gap): Remove; unused.
19014
19015 * chartab.c (chartab_chars, chartab_bits): Now static.
19016
19017 * charset.h (charset_iso_8859_1): Remove decl.
19018 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
19019 Now static.
19020
19021 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
19022 * ccl.c (Vccl_program_table): Now static.
19023 (check_ccl_update): Remove; unused.
19024
19025 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
19026 * category.h: ... from here.
19027 * category.c (check_category_table, set_category_set): Now static.
19028
19029 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
19030 * lisp.h: Remove these decls.
19031
19032 * buffer.c (buffer_count): Remove unused var.
19033
19034 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
19035 so that it's not optimized away.
19036 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
19037 * dispextern.h (bidi_dump_cached_states): Remove, since it's
19038 exported only to the debugger.
19039
19040 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
19041 * atimer.h (run_all_atimers): Remove; not exported.
19042
19043 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
19044 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
19045 was inaccessible from Lisp.
19046 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
19047 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
19048
19049 alloc.c: Import and export fewer symbols, and remove unused items.
19050 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
19051 is defined.
19052 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
19053 it's not optimized away by whole-program optimization.
19054 (message_enable_multibyte, free_misc): Remove.
19055 (catchlist, handlerlist, mark_backtrace):
19056 Declare only if BYTE_MARK_STACK.
19057 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
19058 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
19059 (message_enable_multibyte): Remove decl.
19060 (free_misc, interval_free_list, float_block, float_block_index):
19061 (n_float_blocks, float_free_list, cons_block, cons_block_index):
19062 (cons_free_list, last_marked_index):
19063 Now static.
19064 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
19065 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
19066 (mark_backtrace): Define only if BYTE_MARK_STACK.
19067 * xdisp.c (message_enable_multibyte): Now static.
19068
19069 Declare Lisp_Object Q* variables to be 'static' if not exported.
19070 This makes it easier for human readers (and static analyzers)
19071 to see whether these variables are used from other modules.
19072 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
19073 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
19074 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
19075 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
19076 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
19077 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
19078 * xmenu.c, xselect.c:
19079 Declare Q* vars static if they are not used in other modules.
19080 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
19081 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
19082 Remove decls of unexported vars.
19083 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
19084
19085 * lisp.h (DEFINE_FUNC): Make sname 'static'.
19086
19087 Make Emacs functions such as Fatom 'static' by default.
19088 This makes it easier for human readers (and static analyzers)
19089 to see whether these functions can be called from other modules.
19090 DEFUN now defines a static function. To make the function external
19091 so that it can be used in other C modules, use the new macro DEFUE.
19092 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
19093 (Finit_image_library):
19094 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
19095 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
19096 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
19097 Remove decls, since these functions are now static.
19098 (Funintern, Fget_internal_run_time): New decls, since these functions
19099 were already external.
19100
19101 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
19102 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
19103 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
19104 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
19105 * keyboard.c, keymap.c, lread.c:
19106 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
19107 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
19108 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
19109 Mark functions with DEFUE instead of DEFUN,
19110 if they are used in other modules.
19111 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
19112 decls for now-static functions.
19113 * buffer.h (Fdelete_overlay): Remove decl.
19114 * callproc.c (Fgetenv_internal): Mark as internal.
19115 * composite.c (Fremove_list_of_text_properties): Remove decl.
19116 (Fcomposition_get_gstring): New forward static decl.
19117 * composite.h (Fcomposite_get_gstring): Remove decl.
19118 * dired.c (Ffile_attributes): New forward static decl.
19119 * doc.c (Fdocumntation_property): New forward static decl.
19120 * eval.c (Ffetch_bytecode): New forward static decl.
19121 (Funintern): Remove extern decl; now in .h file where it belongs.
19122 * fileio.c (Fmake_symbolic_link): New forward static decl.
19123 * image.c (Finit_image_library): New forward static decl.
19124 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
19125 * intervals.h (Fprevious_property_change):
19126 (Fremove_list_of_text_properties): Remove decls.
19127 * keyboard.c (Fthis_command_keys): Remove decl.
19128 (Fcommand_execute): New forward static decl.
19129 * keymap.c (Flookup_key): New forward static decl.
19130 (Fcopy_keymap): Now static.
19131 * keymap.h (Flookup_key): Remove decl.
19132 * process.c (Fget_process): New forward static decl.
19133 (Fprocess_datagram_address): Mark as internal.
19134 * syntax.c (Fsyntax_table_p): New forward static decl.
19135 (skip_chars): Remove duplicate decl.
19136 * textprop.c (Fprevious_property_change): New forward static decl.
19137 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
19138 Now internal.
19139 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
19140 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
19141
19142 * editfns.c (Fformat): Remove unreachable code.
19143
19144 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
19145
19146 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
19147 change. (Bug#8496)
19148
19149 2011-04-13 Eli Zaretskii <eliz@gnu.org>
19150
19151 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
19152 when at ZV. (Bug#8487)
19153
19154 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
19155
19156 * charset.c (Fclear_charset_maps): Use xfree instead of free.
19157 (Bug#8437)
19158 * keyboard.c (parse_tool_bar_item): Likewise.
19159 * sound.c (sound_cleanup, alsa_close): Likewise.
19160 * termcap.c (tgetent): Likewise.
19161 * xfns.c (x_default_font_parameter): Likewise.
19162 * xsettings.c (read_and_apply_settings): Likewise.
19163
19164 * alloc.c (overrun_check_malloc, overrun_check_realloc)
19165 (overrun_check_free): Protoize.
19166
19167 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
19168
19169 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
19170 since callers should never pass a negative size.
19171 Change the signature to match that of plain 'read' and 'write'; see
19172 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
19173 * lisp.h: Update prototypes of emacs_write and emacs_read.
19174
19175 2011-04-11 Eli Zaretskii <eliz@gnu.org>
19176
19177 * xdisp.c (redisplay_window): Don't try to determine the character
19178 position of the scroll margin if the window start point w->startp
19179 is outside the buffer's accessible region. (Bug#8468)
19180
19181 2011-04-10 Eli Zaretskii <eliz@gnu.org>
19182
19183 Fix write-region and its subroutines for buffers > 2GB.
19184 * fileio.c (a_write, e_write): Modify declaration of arguments and
19185 local variables to support buffers larger than 2GB.
19186 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
19187
19188 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
19189 argument, local variables, and return value.
19190
19191 * lisp.h: Update prototypes of emacs_write and emacs_read.
19192
19193 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
19194
19195 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
19196
19197 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
19198
19199 Fix more problems found by GCC 4.6.0's static checks.
19200
19201 * xdisp.c (vmessage): Use a better test for character truncation.
19202
19203 * charset.c (load_charset_map): <, not <=, for optimization,
19204 and to avoid potential problems with integer overflow.
19205 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
19206 * casetab.c (set_identity, shuffle): Likewise.
19207 * editfns.c (Fformat): Likewise.
19208 * syntax.c (skip_chars): Likewise.
19209
19210 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
19211 This also lets GCC 4.6.0 generate slightly better loop code.
19212
19213 * callint.c (Fcall_interactively): <, not <=, for optimization.
19214 (Fcall_interactively): Count the number of arguments produced,
19215 not the number of arguments given. This is simpler and lets GCC
19216 4.6.0 generate slightly better code.
19217
19218 * ftfont.c: Distingish more carefully between FcChar8 and char.
19219 The previous code passed unsigned char * to a functions like
19220 strlen and xstrcasecmp that expect char *, which does not
19221 conform to the C standard.
19222 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
19223 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
19224 char * when the C standard requires it.
19225
19226 * keyboard.c (read_char): Remove unused var.
19227
19228 * eval.c: Port to Windows vsnprintf (Bug#8435).
19229 Include <limits.h>.
19230 (SIZE_MAX): Define if the headers do not.
19231 (verror): Do not give up if vsnprintf returns a negative count.
19232 Instead, grow the buffer. This ports to Windows vsnprintf, which
19233 does not conform to C99. Problem reported by Eli Zaretskii.
19234 Also, simplify the allocation scheme, by avoiding the need for
19235 calling realloc, and removing the ALLOCATED variable.
19236
19237 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
19238
19239 Remove invocations of doprnt, as Emacs now uses vsnprintf.
19240 But keep the doprint source code for now, as we might revamp it
19241 and use it again (Bug#8435).
19242 * lisp.h (doprnt): Remove.
19243 * Makefile.in (base_obj): Remove doprnt.o.
19244 * deps.mk (doprnt.o): Remove.
19245
19246 error: Print 32- and 64-bit integers portably (Bug#8435).
19247 Without this change, on typical 64-bit hosts error ("...%d...", N)
19248 was used to print both 32- and 64-bit integers N, which relied on
19249 undefined behavior.
19250 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
19251 * lisp.h (error, verror): Mark as printf-like functions.
19252 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19253 Report overflow in size calculations when allocating printf buffer.
19254 Do not truncate output string at its first null byte.
19255 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19256 Truncate the output at a character boundary, since vsnprintf does not
19257 do that.
19258 * charset.c (check_iso_charset_parameter): Convert internal
19259 character to string before calling 'error', since %c now has the
19260 printf meaning.
19261 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19262 overflow when computing char to be passed to 'error'. Do not
19263 pass Lisp_Object to 'error'; pass the integer instead.
19264 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19265 formatted with plain %d.
19266
19267 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19268
19269 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19270
19271 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19272
19273 * xterm.c (x_catch_errors): Remove duplicate declaration.
19274
19275 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19276
19277 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19278
19279 2011-04-10 Jim Meyering <meyering@redhat.com>
19280
19281 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19282 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
19283 return ssize_t not "int", and use size_t as the buffer length.
19284 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19285 * gnutls.h: Update declarations.
19286 * process.c (read_process_output): Use ssize_t, to match.
19287 (send_process): Likewise.
19288
19289 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19290
19291 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19292
19293 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19294
19295 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19296 Use unsigned char, to match FcChar8 type definition.
19297
19298 * xterm.c (handle_one_xevent):
19299 * xmenu.c (create_and_show_popup_menu):
19300 * xselect.c (x_decline_selection_request)
19301 (x_reply_selection_request): Avoid type-punned deref of X events.
19302
19303 2011-04-09 Eli Zaretskii <eliz@gnu.org>
19304
19305 Fix some uses of `int' instead of EMACS_INT.
19306 * search.c (string_match_1, fast_string_match)
19307 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19308 (scan_buffer, find_next_newline_no_quit)
19309 (find_before_next_newline, search_command, Freplace_match)
19310 (Fmatch_data): Make some `int' variables be EMACS_INT.
19311
19312 * xdisp.c (display_count_lines): 3rd argument and return value now
19313 EMACS_INT. All callers changed.
19314 (pint2hrstr): Last argument is now EMACS_INT.
19315
19316 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19317 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19318 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19319 (decode_coding_utf_16, decode_coding_emacs_mule)
19320 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19321 (decode_coding_ccl, decode_coding_charset)
19322 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19323 (decode_coding_iso_2022, decode_coding_emacs_mule)
19324 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19325 <char_offset, last_offset>: Declare EMACS_INT.
19326 (encode_coding_utf_8, encode_coding_utf_16)
19327 (encode_coding_emacs_mule, encode_invocation_designation)
19328 (encode_designation_at_bol, encode_coding_iso_2022)
19329 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19330 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19331 Declare EMACS_INT.
19332 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19333 (encode_invocation_designation): Last argument P_NCHARS is now
19334 EMACS_INT.
19335 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19336 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19337
19338 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19339 All users changed.
19340
19341 * ccl.c (Fccl_execute_on_string): Declare some variables
19342 EMACS_INT.
19343
19344 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
19345
19346 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19347
19348 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19349
19350 * process.c (Fformat_network_address): Doc fix.
19351
19352 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19353
19354 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
19355
19356 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
19357
19358 * keyboard.c (read_char): Call Lisp function help-form-show,
19359 instead of using internal_with_output_to_temp_buffer.
19360 (Qhelp_form_show): New var.
19361 (syms_of_keyboard): Use DEFSYM macro.
19362
19363 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19364
19365 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19366
19367 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
19368
19369 * process.c (Flist_processes): Remove to Lisp.
19370 (list_processes_1): Delete.
19371
19372 2011-04-06 Eli Zaretskii <eliz@gnu.org>
19373
19374 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19375
19376 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19377
19378 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
19379
19380 Fix more problems found by GCC 4.6.0's static checks.
19381
19382 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19383
19384 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19385
19386 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
19387
19388 * xdisp.c (vmessage): Mark as a printf-like function.
19389
19390 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19391
19392 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19393
19394 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19395 printf-like functions.
19396 (tiff_load): Add casts to remove these marks before passing them
19397 to system-supplied API.
19398
19399 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19400
19401 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19402 This avoids several warnings with gcc -Wstrict-overflow.
19403 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19404 directly, rather than having caller test rule sign. This avoids
19405 some unnecessary tests.
19406 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19407 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19408 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
19409
19410 * xfont.c (xfont_text_extents): Remove var that was set but not used.
19411 (xfont_open): Avoid unnecessary tests.
19412
19413 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19414
19415 * composite.h, composite.c (composition_gstring_put_cache):
19416 Use EMACS_INT, not int, for length.
19417
19418 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19419 breaking out part of COMPOSITION_DECODE_RULE.
19420 (COMPOSITION_DECODE_RULE): Use it.
19421 * composite.c (get_composition_id): Remove unused local vars,
19422 by using the new macro.
19423
19424 * textprop.c (set_text_properties_1): Change while to do-while,
19425 since the condition is always true at first.
19426
19427 * intervals.c (graft_intervals_into_buffer): Mark var as used.
19428 (interval_deletion_adjustment): Return unsigned value.
19429 All uses changed.
19430
19431 * process.c (list_processes_1, create_pty, read_process_output):
19432 (exec_sentinel): Remove vars that were set but not used.
19433 (create_pty): Remove unnecessary "volatile"s.
19434 (Fnetwork_interface_info): Avoid possibility of int overflow.
19435 (read_process_output): Do adaptive read buffering even if carryover.
19436 (read_process_output): Simplify nbytes computation if buffered.
19437
19438 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19439
19440 * syntax.c (scan_words): Remove var that was set but not used.
19441 (update_syntax_table): Use unsigned instead of int.
19442
19443 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
19444 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
19445 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
19446
19447 * print.c (print_error_message): Avoid int overflow.
19448
19449 * font.c (font_list_entities): Redo for clarity,
19450 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19451
19452 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
19453 (font_score): Avoid potential overflow in diff calculation.
19454
19455 * fns.c (substring_both): Remove var that is set but not used.
19456 (sxhash): Redo loop for clarity and to avoid wraparound warning.
19457
19458 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19459
19460 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19461 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19462 can always succeed if overflow has undefined behavior.
19463
19464 * search.c (boyer_moore, wordify): Remove vars set but not used.
19465 (wordify): Omit three unnecessary tests.
19466
19467 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19468 All callers changed. This avoids the need for an unused var.
19469
19470 * casefiddle.c (casify_region): Remove var that is set but not used.
19471
19472 * dired.c (file_name_completion): Remove var that is set but not used.
19473
19474 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19475
19476 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
19477 (Finsert_file_contents): Remove unnecessary code checking fd.
19478
19479 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19480 Check for integer overflow on size calculations.
19481
19482 * buffer.c (Fprevious_overlay_change): Remove var that is set
19483 but not used.
19484
19485 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19486 Remove vars that are set but not used.
19487 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
19488 (timer_check_2): Mark vars as initialized.
19489
19490 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19491
19492 * image.c (lookup_image): Remove var that is set but not used.
19493 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
19494
19495 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19496 that are set but not used.
19497
19498 * xfns.c (make_invisible_cursor): Don't return garbage
19499 if XCreateBitmapFromData fails (Bug#8410).
19500
19501 * xselect.c (x_get_local_selection, x_handle_property_notify):
19502 Remove vars that are set but not used.
19503
19504 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19505 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19506
19507 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19508 Remove var that is set but not used.
19509 (scroll_bar_windows_size): Now size_t, not int.
19510 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19511 Check for overflow.
19512
19513 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19514 (map_tty_color) [!defined MSDOS]: Likewise.
19515
19516 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19517
19518 * coding.c: Remove vars that are set but not used.
19519 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19520 All callers changed.
19521 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19522 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19523 (decode_coding_charset): Remove vars that are set but not used.
19524
19525 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19526 that is set but not used.
19527
19528 * print.c (print_object): Remove var that is set but not used.
19529
19530 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19531 The gnulib version avoids calling malloc in the usual case,
19532 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19533 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19534 * filelock.c (current_lock_owner): Likewise.
19535 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19536 * sysdep.c: Include allocator.h, careadlinkat.h.
19537 (emacs_no_realloc_allocator): New static constant.
19538 (emacs_readlink): New function.
19539 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19540 ../lib/careadlinkat.h.
19541
19542 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19543
19544 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19545 first non-nil return value).
19546
19547 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19548
19549 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19550 if not defined (Bug#8403).
19551
19552 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19553
19554 * xdisp.c (display_count_lines): Remove parameter `start',
19555 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19556 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19557 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19558 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19559 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19560 and thereabouts. All callers changed.
19561 (get_per_char_metric): Remove parameter `f', unused since
19562 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19563
19564 2011-04-02 Jim Meyering <meyering@redhat.com>
19565
19566 do not dereference NULL upon failed strdup
19567 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19568 (ns_get_family): Likewise.
19569
19570 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19571
19572 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19573
19574 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19575
19576 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19577 later (Bug#8403).
19578
19579 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19580
19581 Add lexical binding.
19582
19583 * window.c (Ftemp_output_buffer_show): New fun.
19584 (Fsave_window_excursion):
19585 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19586
19587 * lread.c (lisp_file_lexically_bound_p): New function.
19588 (Fload): Bind Qlexical_binding.
19589 (readevalloop): Remove `evalfun' arg.
19590 Bind Qinternal_interpreter_environment.
19591 (Feval_buffer): Bind Qlexical_binding.
19592 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19593 Mark as dynamic.
19594 (syms_of_lread): Declare `lexical-binding'.
19595
19596 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19597
19598 * keyboard.c (eval_dyn): New fun.
19599 (menu_item_eval_property): Use it.
19600
19601 * image.c (parse_image_spec): Use Ffunctionp.
19602
19603 * fns.c (concat, mapcar1): Accept byte-code-functions.
19604
19605 * eval.c (Fsetq): Handle lexical vars.
19606 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19607 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19608 (FletX, Flet): Obey lexical binding.
19609 (Fcommandp): Handle closures.
19610 (Feval): New `lexical' arg.
19611 (eval_sub): New function extracted from Feval. Use it almost
19612 everywhere where Feval was used. Look up vars in lexical env.
19613 Handle closures.
19614 (Ffunctionp): Move from subr.el.
19615 (Ffuncall): Handle closures.
19616 (apply_lambda): Remove `eval_flags'.
19617 (funcall_lambda): Handle closures and new byte-code-functions.
19618 (Fspecial_variable_p): New function.
19619 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19620 but without exporting it to Lisp.
19621
19622 * doc.c (Fdocumentation, store_function_docstring):
19623 * data.c (Finteractive_form): Handle closures.
19624
19625 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19626 interactive spec.
19627
19628 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19629 New byte-codes.
19630 (exec_byte_code): New function extracted from Fbyte_code to handle new
19631 calling convention for byte-code-functions. Add new byte-codes.
19632
19633 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19634
19635 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19636
19637 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19638
19639 * xdisp.c (redisplay_internal): Fix prototype.
19640
19641 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19642
19643 * xdisp.c (SCROLL_LIMIT): New macro.
19644 (try_scrolling): Use it when setting scroll_limit.
19645 Limit scrolling to 100 screen lines.
19646 (redisplay_window): Even when falling back on "recentering",
19647 position point in the window according to scroll-conservatively,
19648 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19649
19650 (try_scrolling): When point is above the window, allow searching
19651 as far as scroll_max, or one screenful, to compute vertical
19652 distance from PT to the scroll margin position. This prevents
19653 try_scrolling from unnecessarily failing when
19654 scroll-conservatively is set to a value slightly larger than the
19655 window height. Clean up the case of PT below the margin at bottom
19656 of window: scroll_max can no longer be INT_MAX. When aggressive
19657 scrolling is in use, don't let point enter the opposite scroll
19658 margin as result of the scroll.
19659 (syms_of_xdisp) <scroll-conservatively>: Document the
19660 threshold of 100 lines for never-recentering scrolling.
19661
19662 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19663
19664 * dispextern.h (move_it_by_lines):
19665 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19666 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19667 (message_log_check_duplicate): Remove parameters `prev_bol' and
19668 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19669 (redisplay_internal): Remove parameter `preserve_echo_area',
19670 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19671
19672 * indent.c (Fvertical_motion):
19673 * window.c (window_scroll_pixel_based, Frecenter):
19674 Don't pass `need_y_p' to `move_it_by_lines'.
19675
19676 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19677
19678 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19679 steal a few bits to be more compact.
19680 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19681 Remove unneeded casts.
19682
19683 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19684
19685 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19686
19687 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19688 binding" message (bug#7967).
19689
19690 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19691
19692 Fix more problems found by GCC 4.6.0's static checks.
19693
19694 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19695 Remove unused local var.
19696
19697 * editfns.c (Fmessage_box): Remove unused local var.
19698
19699 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19700 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19701 Omit unused local vars.
19702 * window.c (shrink_windows): Omit unused local var.
19703 * menu.c (digest_single_submenu): Omit unused local var.
19704 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19705 Omit unused local var.
19706
19707 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19708 Don't assume string length fits in int.
19709 (keyremap_step, read_key_sequence): Use size_t for sizes.
19710 (read_key_sequence): Don't check last_real_key_start redundantly.
19711
19712 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19713 instead of alloca (Bug#8344).
19714
19715 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19716 (Fbacktrace_frame): Don't assume nframes fits in int.
19717
19718 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19719
19720 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19721 concerns.
19722
19723 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19724
19725 * cm.c (calccost): Turn while-do into do-while, for clarity.
19726
19727 * keyboard.c (syms_of_keyboard): Use the same style as later
19728 in this function when indexing through an array. This also
19729 works around GCC bug 48267.
19730
19731 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19732
19733 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19734
19735 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19736 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19737
19738 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19739 This avoids undefined behavior on integer overflow, and is a bit
19740 more convenient anyway since it is compared to a size_t variable.
19741
19742 Variadic C functions now count arguments with size_t, not int.
19743 This avoids an unnecessary limitation on 64-bit machines, which
19744 caused (substring ...) to crash on large vectors (Bug#8344).
19745 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19746 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19747 All variadic functions and their callers changed accordingly.
19748 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19749 * data.c (arith_driver, float_arith_driver): Likewise.
19750 * editfns.c (general_insert_function): Likewise.
19751 * eval.c (struct backtrace.nargs, interactive_p)
19752 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19753 (funcall_lambda, mark_backtrace): Likewise.
19754 * fns.c (concat): Likewise.
19755 * frame.c (x_set_frame_parameters): Likewise.
19756 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19757 0 if not found, not -1. All callers changed.
19758
19759 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19760 (stack_copy_size): Now size_t, not int.
19761 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19762
19763 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19764
19765 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19766 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19767 All callers changed.
19768
19769 * lisp.h (multibyte_char_to_unibyte):
19770 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19771 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19772 * character.h (CHAR_TO_BYTE8):
19773 * cmds.c (internal_self_insert):
19774 * editfns.c (general_insert_function):
19775 * keymap.c (push_key_description):
19776 * search.c (Freplace_match):
19777 * xdisp.c (message_dolog, set_message_1): All callers changed.
19778
19779 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19780
19781 * keyboard.c (safe_run_hook_funcall): New function.
19782 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19783 don't set the hook to nil, but remove the offending function instead.
19784 (Qcommand_hook_internal): Remove, unused.
19785 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19786 Vcommand_hook_internal.
19787
19788 * eval.c (enum run_hooks_condition): Remove.
19789 (funcall_nil, funcall_not): New functions.
19790 (run_hook_with_args): Call each function through a `funcall' argument.
19791 Remove `cond' argument, now redundant.
19792 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19793 (Frun_hook_with_args_until_failure): Adjust accordingly.
19794 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19795
19796 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19797
19798 * dispextern.h (string_buffer_position): Remove declaration.
19799
19800 * print.c (strout): Remove parameter `multibyte', unused since
19801 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19802
19803 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19804 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19805 All callers changed.
19806
19807 * w32.c (_wsa_errlist): Use braces for struct initializers.
19808
19809 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19810 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19811 All callers changed.
19812 (string_buffer_position): Likewise. Also, make static (it's never
19813 used outside xdisp.c).
19814 (cursor_row_p): Remove parameter `w', unused since
19815 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19816 (decode_mode_spec): Remove parameter `precision', introduced during
19817 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19818 All callers changed.
19819
19820 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19821
19822 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19823
19824 2011-03-27 Anders Lindgren <andlind@gmail.com>
19825
19826 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19827 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19828 (ns_update_auto_hide_menu_bar): New functions.
19829 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19830 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19831 ns_constrain_all_frames.
19832 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19833 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19834
19835 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19836
19837 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19838
19839 2011-03-27 Glenn Morris <rgm@gnu.org>
19840
19841 * syssignal.h: Replace RETSIGTYPE with void.
19842 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19843 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19844 Replace SIGTYPE with void everywhere.
19845 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19846 * s/template.h (SIGTYPE): Remove commented out definition.
19847
19848 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19849
19850 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19851 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19852
19853 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19854
19855 * w32.c (read_unc_volume): Use parameter `henum', instead of
19856 global variable `wget_enum_handle'.
19857
19858 * keymap.c (describe_vector): Remove parameters `indices' and
19859 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19860 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19861
19862 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19863
19864 * keyboard.c (timer_check): Remove parameter `do_it_now',
19865 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19866 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19867 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19868
19869 * keyboard.c (read_char):
19870 * w32menu.c (w32_menu_display_help):
19871 * xmenu.c (show_help_event, menu_help_callback):
19872 Adjust calls to `show_help_echo'.
19873
19874 * gtkutil.c (xg_maybe_add_timer):
19875 * keyboard.c (readable_events):
19876 * process.c (wait_reading_process_output):
19877 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19878
19879 * insdel.c (adjust_markers_gap_motion):
19880 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19881 (gap_left, gap_right): Don't call it.
19882
19883 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19884
19885 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19886 incurred during fontification.
19887
19888 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19889
19890 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19891 (DEFVAR_PER_BUFFER): Don't pass it.
19892
19893 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19894 (scrolling_window): Don't pass it.
19895
19896 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19897
19898 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19899
19900 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19901 and `suffix'.
19902 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19903 of variables specific to SELinux and computation of `encoded_absname'.
19904
19905 * image.c (XPutPixel): Remove unused variable `height'.
19906
19907 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19908
19909 * unexw32.c (get_section_info): Remove unused variable `section'.
19910
19911 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19912 (system_process_attributes): Remove unused variable `sess'.
19913 (sys_read): Remove unused variable `err'.
19914
19915 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19916 (w32_wnd_proc): Remove unused variable `isdead'.
19917 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19918 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19919 (x_create_tip_frame): Remove unused variable `tem'.
19920
19921 * w32inevt.c (w32_console_read_socket):
19922 Remove unused variable `no_events'.
19923
19924 * w32term.c (x_draw_composite_glyph_string_foreground):
19925 Remove unused variable `width'.
19926
19927 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
19928
19929 * w32term.c (x_set_glyph_string_clipping):
19930 Don't pass uninitialized region to CombineRgn.
19931
19932 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
19933
19934 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19935 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19936 (Fx_close_connection): Remove unused variable `i'.
19937
19938 * w32font.c (w32font_draw): Return number of glyphs.
19939 (w32font_open_internal): Remove unused variable `i'.
19940 (w32font_driver): Add missing initializer.
19941
19942 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19943 (fill_in_menu): Remove unused variable `items_added'.
19944
19945 * w32term.c (last_mouse_press_frame): Remove static global variable.
19946 (w32_clip_to_row): Remove unused variable `f'.
19947 (x_delete_terminal): Remove unused variable `i'.
19948
19949 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19950 (NOTHING): Remove unused static global variable.
19951 (uniscribe_check_otf): Remove unused variable `table'.
19952 (uniscribe_font_driver): Add missing initializers.
19953
19954 2011-03-23 Julien Danjou <julien@danjou.info>
19955
19956 * term.c (Fsuspend_tty, Fresume_tty):
19957 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19958 * window.c (temp_output_buffer_show):
19959 * insdel.c (signal_before_change):
19960 * frame.c (Fhandle_switch_frame):
19961 * fileio.c (Fdo_auto_save):
19962 * emacs.c (Fkill_emacs):
19963 * editfns.c (save_excursion_restore):
19964 * cmds.c (internal_self_insert):
19965 * callint.c (Fcall_interactively):
19966 * buffer.c (Fkill_all_local_variables):
19967 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19968 Use Frun_hooks.
19969 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
19970 unconditionally since it does the check itself.
19971
19972 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
19973
19974 Fix more problems found by GCC 4.5.2's static checks.
19975
19976 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19977 the first time through the loop, since we know p0 < p1 then.
19978 This also avoids a gcc -Wstrict-overflow warning.
19979
19980 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19981 leading to a memory leak, possible in functions like
19982 load_charset_map_from_file that can allocate an unbounded number
19983 of objects (Bug#8318).
19984
19985 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19986 that could (at least in theory) be that large.
19987
19988 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19989 This is less likely to overflow, and avoids undefined behavior if
19990 overflow does occur. All callers changed. Use strtoul to scan
19991 for the unsigned long integer.
19992 (pint2hrstr): Simplify and tune code slightly.
19993 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19994
19995 * scroll.c (do_scrolling): Work around GCC bug 48228.
19996 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19997
19998 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19999 This also avoids a warning with gcc -Wstrict-overflow.
20000 (validate_x_resource_name): Simplify count usage.
20001 This also avoids a warning with gcc -Wstrict-overflow.
20002
20003 * fileio.c (Fcopy_file): Report error if fchown or fchmod
20004 fail (Bug#8306).
20005
20006 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
20007
20008 * process.c (Fmake_network_process): Use socklen_t, not int,
20009 where POSIX says socklen_t is required in portable programs.
20010 This fixes a porting bug on hosts like 64-bit HP-UX, where
20011 socklen_t is wider than int (Bug#8277).
20012 (Fmake_network_process, server_accept_connection):
20013 (wait_reading_process_output, read_process_output):
20014 Likewise.
20015
20016 * process.c: Rename or move locals to avoid shadowing.
20017 (list_processes_1, Fmake_network_process):
20018 (read_process_output_error_handler, exec_sentinel_error_handler):
20019 Rename or move locals.
20020 (Fmake_network_process): Define label "retry_connect" only if needed.
20021 (Fnetwork_interface_info): Fix pointer signedness.
20022 (process_send_signal): Add cast to avoid pointer signedness problem.
20023 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
20024 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
20025
20026 Make tparam.h and terminfo.c consistent.
20027 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
20028 Include tparam.h instead, since it declares them.
20029 * cm.h (PC): Remove extern decl; tparam.h now does this.
20030 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
20031 * terminfo.c: Include tparam.h, to check interfaces.
20032 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
20033 (tparam): Adjust signature to match interface in tparam.h;
20034 this removes some undefined behavior. Check that outstring and len
20035 are zero, which they always are with Emacs.
20036 * tparam.h (PC, BC, UP): New extern decls.
20037
20038 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
20039 (xftfont_open): Rename locals to avoid shadowing.
20040
20041 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
20042 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
20043 (OTF_TAG_SYM): Omit macro if not needed.
20044 (ftfont_list): Remove unused local.
20045 (get_adstyle_property, ftfont_pattern_entity):
20046 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
20047 Rename locals to avoid shadowing.
20048
20049 * xfont.c (xfont_list_family): Mark var as initialized.
20050
20051 * xml.c (make_dom): Now static.
20052
20053 * composite.c (composition_compute_stop_pos): Rename local to
20054 avoid shadowing.
20055 (composition_reseat_it): Remove unused locals.
20056 (find_automatic_composition, composition_adjust_point): Likewise.
20057 (composition_update_it): Mark var as initialized.
20058 (find_automatic_composition): Mark vars as initialized,
20059 with a FIXME (Bug#8290).
20060
20061 character.h: Rename locals to avoid shadowing.
20062 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
20063 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
20064 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
20065 (BUF_DEC_POS): Be more systematic about renaming local temporaries
20066 to avoid shadowing.
20067
20068 * textprop.c (property_change_between_p): Remove; unused.
20069
20070 * intervals.c (interval_start_pos): Now static.
20071
20072 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
20073
20074 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
20075 Rename locals to avoid shadowing.
20076
20077 * sound.c (wav_play, au_play, Fplay_sound_internal):
20078 Fix pointer signedness.
20079 (alsa_choose_format): Remove unused local var.
20080 (wav_play): Initialize a variable to 0, to prevent undefined
20081 behavior (Bug#8278).
20082
20083 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
20084
20085 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
20086
20087 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
20088 clobbering (Bug#8298).
20089 * sysdep.c (sys_subshell): Likewise.
20090 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
20091
20092 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
20093 This should get cleaned up, so that child_setup has the
20094 same signature on all platforms.
20095
20096 * callproc.c (call_process_cleanup): Now static.
20097 (relocate_fd): Rename locals to avoid shadowing.
20098
20099 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
20100
20101 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
20102 not to be necessary, and produces flickering.
20103
20104 2011-03-20 Glenn Morris <rgm@gnu.org>
20105
20106 * config.in: Remove file.
20107
20108 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
20109
20110 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
20111 are now in src/globals.h.
20112 (syms_of_minibuf): Remove spurious & from previous change.
20113
20114 2011-03-20 Leo Liu <sdl.web@gmail.com>
20115
20116 * minibuf.c (completing-read-function): New variable.
20117 (completing-read-default): Rename from completing-read.
20118 (completing-read): Call completing-read-function.
20119
20120 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
20121
20122 * xfaces.c (Fx_load_color_file):
20123 Read color file from absolute filename (bug#8250).
20124
20125 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
20126
20127 * makefile.w32-in: Update dependencies.
20128
20129 2011-03-17 Eli Zaretskii <eliz@gnu.org>
20130
20131 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
20132
20133 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
20134
20135 Fix more problems found by GCC 4.5.2's static checks.
20136
20137 * process.c (make_serial_process_unwind, send_process_trap):
20138 (sigchld_handler): Now static.
20139
20140 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
20141 That way, the code declares only the vars that it needs.
20142 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
20143 * s/cygwin.h (PTY_ITERATION): Likewise.
20144 * s/darwin.h (PTY_ITERATION): Likewise.
20145 * s/gnu-linux.h (PTY_ITERATION): Likewise.
20146
20147 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
20148 * process.c (allocate_pty): Don't declare stb unless it's needed.
20149
20150 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
20151 (CONSTANTLIM): Remove; unused.
20152 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
20153 Define only if needed.
20154
20155 * unexelf.c (unexec): Name an expression,
20156 to avoid gcc -Wbad-function-cast warning.
20157 Use a different way to cause a compilation error if anyone uses
20158 n rather than nn, a way that does not involve shadowing.
20159 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
20160
20161 * deps.mk (unexalpha.o): Remove; unused.
20162
20163 New file unexec.h, the (simple) interface for unexec (Bug#8267).
20164 * unexec.h: New file.
20165 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
20166 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
20167 Depend on unexec.h.
20168 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
20169 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
20170 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
20171 Change as necessary to match prototype in unexec.h.
20172
20173 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
20174 shadowing.
20175 (back_comment, skip_chars): Mark vars as initialized.
20176
20177 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
20178 Rename locals to avoid shadowing.
20179
20180 * lread.c (read1): Rewrite so as not to use empty "else".
20181 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
20182
20183 * print.c (Fredirect_debugging_output): Fix pointer signedess.
20184
20185 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
20186 warning when compiling print.c.
20187
20188 * font.c (font_unparse_fcname): Abort in an "impossible" situation
20189 instead of using an uninitialized var.
20190 (font_sort_entities): Mark var as initialized.
20191
20192 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
20193
20194 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
20195 pointers to constants.
20196 (font_parse_fcname): Remove unused vars.
20197 (font_delete_unmatched): Now static.
20198 (font_get_spec): Remove; unused.
20199 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
20200 (font_update_drivers, Ffont_get_glyphs, font_add_log):
20201 Rename or move locals to avoid shadowing.
20202
20203 * fns.c (require_nesting_list, require_unwind): Now static.
20204 (Ffillarray): Rename locals to avoid shadowing.
20205
20206 * floatfns.c (domain_error2): Define only if needed.
20207 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
20208
20209 * alloc.c (mark_backtrace): Move decl from here ...
20210 * lisp.h: ... to here, so that it can be checked.
20211
20212 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
20213 (Fdefvar): Rewrite so as not to use empty "else".
20214 (lisp_indirect_variable): Name an expression,
20215 to avoid gcc -Wbad-function-cast warning.
20216 (Fdefvar): Rename locals to avoid shadowing.
20217
20218 * callint.c (quotify_arg, quotify_args): Now static.
20219 (Fcall_interactively): Rename locals to avoid shadowing.
20220 Use const pointer when appropriate.
20221
20222 * lisp.h (get_system_name, get_operating_system_release):
20223 Move decls here, to check interfaces.
20224 * process.c (get_operating_system_release): Move decl to lisp.h.
20225 * xrdb.c (get_system_name): Likewise.
20226 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
20227 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
20228 some of which prompt warnings from gcc -Wbad-function-cast.
20229 (Fformat_time_string, Fencode_time, Finsert_char):
20230 (Ftranslate_region_internal, Fformat):
20231 Rename or remove local vars to avoid shadowing.
20232 (Ftranslate_region_internal): Mark var as initialized.
20233
20234 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
20235 avoid shadowing.
20236
20237 * lisp.h (eassert): Check that the argument compiles, even if
20238 ENABLE_CHECKING is not defined.
20239
20240 * data.c (Findirect_variable): Name an expression, to avoid
20241 gcc -Wbad-function-cast warning.
20242 (default_value, arithcompare, arith_driver, arith_error): Now static.
20243 (store_symval_forwarding): Rename local to avoid shadowing.
20244 (Fmake_variable_buffer_local, Fmake_local_variable):
20245 Mark variables as initialized.
20246 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
20247
20248 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
20249 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20250 Rename locals to avoid shadowing.
20251 (mark_stack): Move local variables into the #ifdef region where
20252 they're used.
20253 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20254 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20255 needed otherwise.
20256 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20257 (GC_STRING_CHARS): Remove; not used.
20258 (Fmemory_limit): Cast sbrk's returned value to char *.
20259
20260 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20261 avoids undefined behavior in theory.
20262
20263 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20264
20265 Use functions, not macros, for up- and down-casing (Bug#8254).
20266 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20267 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20268 to use the following functions instead of these macros.
20269 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20270 EMACS_INT, since callers assume the returned value fits in int.
20271 (upcase1): Likewise, for UPCASE_TABLE.
20272 (uppercasep, lowercasep, upcase): New static inline functions.
20273 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
20274 the race-condition problem in the old DOWNCASE.
20275
20276 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20277 Rename locals to avoid shadowing.
20278 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
20279 (regex_compile, re_search_2, re_match_2_internal):
20280 Remove unused local vars.
20281 (FREE_VAR): Rewrite so as not to use empty "else",
20282 which gcc can warn about.
20283 (regex_compile, re_match_2_internal): Mark locals as initialized.
20284 (RETALLOC_IF): Define only if needed.
20285 (WORDCHAR_P): Likewise. This one is never needed, but is used
20286 only in a comment talking about a compiler bug, so put inside
20287 the #if 0 of that comment.
20288 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20289 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20290 Remove; unused.
20291
20292 * search.c (boyer_moore): Rename locals to avoid shadowing.
20293 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20294 (PREV_CHAR_BOUNDARY): Likewise.
20295
20296 * search.c (simple_search): Remove unused var.
20297
20298 * dired.c (compile_pattern): Move decl from here ...
20299 * lisp.h: ... to here, so that it can be checked.
20300 (struct re_registers): New forward decl.
20301
20302 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20303
20304 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20305 All uses changed.
20306 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20307 Rename locals to avoid shadowing.
20308 (Fvertical_motion): Mark locals as initialized.
20309
20310 * casefiddle.c (casify_object, casify_region): Now static.
20311 (casify_region): Mark local as initialized.
20312
20313 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20314
20315 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20316 New macros, so that the caller can use some names other than
20317 gcpro1, gcpro2, etc.
20318 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20319 of the new macros.
20320 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20321 argument, for consistency with GCPRO2_VAR, etc: it is now the
20322 prefix of the variable, not the variable itself. All uses
20323 changed.
20324 * dired.c (directory_files_internal, file_name_completion):
20325 Rename locals to avoid shadowing.
20326
20327 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20328 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20329 dired.c's scmp function, had undefined behavior.
20330 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20331 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20332 * buffer.h: ... to here, because these macros use current_buffer,
20333 and the new implementation with inline functions needs to have
20334 current_buffer in scope now, rather than later when the macros
20335 are used.
20336 (downcase, upcase1): New static inline functions.
20337 (DOWNCASE, UPCASE1): Reimplement using these functions.
20338 This avoids undefined behavior in expressions like
20339 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20340 from race conditions in accessing the global variables
20341 case_temp1 and case_temp2.
20342 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20343 * lisp.h (case_temp1, case_temp2): Remove their decls.
20344 * character.h (ASCII_CHAR_P): Move from here ...
20345 * lisp.h: ... to here, so that the inline functions mentioned
20346 above can use them.
20347
20348 * dired.c (directory_files_internal_unwind): Now static.
20349
20350 * fileio.c (file_name_as_directory, directory_file_name):
20351 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20352 Now static.
20353 (file_name_as_directory): Use const pointers when appropriate.
20354 (Fexpand_file_name): Likewise. In particular, newdir might
20355 point at constant storage, so make it a const pointer.
20356 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
20357 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20358 signedness issues.
20359 (Fset_file_times, Finsert_file_contents, auto_save_error):
20360 Rename locals to avoid shadowing.
20361
20362 * minibuf.c (choose_minibuf_frame_1): Now static.
20363 (Ftry_completion, Fall_completions): Rename or remove locals
20364 to avoid shadowing.
20365
20366 * marker.c (bytepos_to_charpos): Remove; unused.
20367
20368 * lisp.h (verify_bytepos, count_markers): New decls,
20369 so that gcc does not warn that these functions aren't declared.
20370
20371 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20372 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
20373 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
20374 (copy_text): Remove unused local var.
20375
20376 * filelock.c (within_one_second): Now static.
20377 (lock_file_1): Rename local to avoid shadowing.
20378
20379 * buffer.c (fix_overlays_before): Mark locals as initialized.
20380 (fix_start_end_in_overlays): Likewise. This function should be
20381 simplified by using pointers-to-pointers, but that's a different
20382 matter.
20383 (switch_to_buffer_1): Now static.
20384 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20385 (report_overlay_modification): Rename locals to avoid shadowing.
20386
20387 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
20388 Fix pointer signedness issue.
20389 (sys_subshell): Mark local as volatile if checking for lint,
20390 to suppress a gcc -Wclobbered warning that does not seem to be right.
20391 (MAXPATHLEN): Define only if needed.
20392
20393 * process.c (serial_open, serial_configure): Move decls from here ...
20394 * systty.h: ... to here, so that they can be checked.
20395
20396 * fns.c (get_random, seed_random): Move extern decls from here ...
20397 * lisp.h: ... to here, so that they can be checked.
20398
20399 * sysdep.c (reset_io): Now static.
20400 (wait_for_termination_signal): Remove; unused.
20401
20402 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20403 (copy_keymap_item, append_key, push_text_char_description):
20404 Now static.
20405 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
20406 (DENSE_TABLE_SIZE): Remove; unused.
20407 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20408 (describe_map_tree):
20409 Rename locals to avoid shadowing.
20410
20411 * keyboard.c: Declare functions static if they are not used elsewhere.
20412 (echo_char, echo_dash, cmd_error, top_level_2):
20413 (poll_for_input, handle_async_input): Now static.
20414 (read_char, kbd_buffer_get_event, make_lispy_position):
20415 (make_lispy_event, make_lispy_movement, apply_modifiers):
20416 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20417 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20418 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
20419 (read_key_sequence, read_char): Mark locals as initialized.
20420 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
20421
20422 * keyboard.h (make_ctrl_char): New decl.
20423 (mark_kboards): Move decl here ...
20424 * alloc.c (mark_kboards): ... from here.
20425
20426 * lisp.h (force_auto_save_soon): New decl.
20427
20428 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
20429 (DEFINE_DUMMY_FUNCTION): New macro.
20430 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20431 Use it.
20432 (main): Add casts to avoid warnings
20433 if GCC considers string literals to be constants.
20434
20435 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20436
20437 * dbusbind.c: Pointer signedness fixes.
20438 (xd_signature, xd_append_arg, xd_initialize):
20439 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20440 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20441 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20442 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20443
20444 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20445 if GCC considers string literals to be constants.
20446 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
20447
20448 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20449
20450 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20451 (print_preprocess, print_object): New macro to fix last change.
20452
20453 * print.c (print_preprocess): Don't forget font objects.
20454
20455 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
20456
20457 * emacs.c (USAGE3): Doc fixes.
20458
20459 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20460
20461 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20462 structure.
20463
20464 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
20465
20466 * lisp.h (VWindow_system, Qfile_name_history):
20467 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20468 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20469 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20470
20471 * w32select.c: Don't #include "keyboard.h".
20472 (run_protected): Add extern declaration for waiting_for_input.
20473
20474 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20475 * w32console.c (detect_input_pending, read_input_pending)
20476 (encode_terminal_code):
20477 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20478 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20479 (w32_system_caret_y, Qfile_name_history):
20480 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20481 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20482 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20483 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20484 * w32proc.c (Qlocal, report_file_error):
20485 * w32term.c (Vwindow_system, updating_frame):
20486 * w32uniscribe.c (initialized, uniscribe_font_driver):
20487 Remove unneeded extern declarations.
20488
20489 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
20490
20491 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
20492
20493 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
20494
20495 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20496 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20497 These macros can no longer be used for assignment.
20498
20499 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20500 Assign struct members directly, instead of using BUF_BEGV etc.
20501 (record_buffer_markers, fetch_buffer_markers): New functions for
20502 recording and fetching special buffer markers.
20503 (set_buffer_internal_1, set_buffer_temp): Use them.
20504
20505 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20506
20507 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20508
20509 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20510 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20511
20512 * xdisp.c (hscroll_window_tree):
20513 (reconsider_clip_changes): Use PT instead of BUF_PT.
20514
20515 2011-03-13 Eli Zaretskii <eliz@gnu.org>
20516
20517 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20518 $(EMACS_ROOT)/lib/intprops.h.
20519
20520 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20521
20522 Fix more problems found by GCC 4.5.2's static checks.
20523
20524 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20525 to unsigned char * to avoid compiler diagnostic.
20526 (xg_free_frame_widgets): Make it clear that a local variable is
20527 needed only if USE_GTK_TOOLTIP.
20528 (gdk_window_get_screen): Make it clear that this macro is needed
20529 only if USE_GTK_TOOLTIP.
20530 (int_gtk_range_get_value): New function, which avoids a diagnostic
20531 from gcc -Wbad-function-cast.
20532 (xg_set_toolkit_scroll_bar_thumb): Use it.
20533 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20534 diagnostic from gcc -Wbad-function-cast.
20535 (get_utf8_string, xg_get_file_with_chooser):
20536 Rename locals to avoid shadowing.
20537 (create_dialog): Move locals to avoid shadowing.
20538
20539 * xgselect.c (xg_select): Remove unused var.
20540
20541 * image.c (four_corners_best): Mark locals as initialized.
20542 (gif_load): Initialize transparent_p to zero (Bug#8238).
20543 Mark another local as initialized.
20544 (my_png_error, my_error_exit): Mark with NO_RETURN.
20545
20546 * image.c (clear_image_cache): Now static.
20547 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20548 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20549 (x_edge_detection): Remove unnecessary cast that
20550 gcc -Wbad-function-cast diagnoses.
20551 (gif_load): Fix pointer signedness.
20552 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20553 (jpeg_load, gif_load): Rename locals to avoid shadowing.
20554
20555 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
20556
20557 Improve quality of tests for time stamp overflow.
20558 For example, without this patch (encode-time 0 0 0 1 1
20559 1152921504606846976) returns the obviously-bogus value (-948597
20560 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20561 reports time overflow. See
20562 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20563 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20564 * editfns.c: Include limits.h and intprops.h.
20565 (TIME_T_MIN, TIME_T_MAX): New macros.
20566 (time_overflow): Move earlier, to before first use.
20567 (hi_time, lo_time): New functions, for an accurate test for
20568 out-of-range times.
20569 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20570 (Fget_internal_run_time): Don't assume time_t fits in int.
20571 (make_time): Use list2 instead of Fcons twice.
20572 (Fdecode_time): More accurate test for out-of-range times.
20573 (check_tm_member): New function.
20574 (Fencode_time): Use it, to test for out-of-range times.
20575 (lisp_time_argument): Don't rely on undefined left-shift and
20576 right-shift behavior when checking for time stamp overflow.
20577
20578 * editfns.c (time_overflow): New function, refactoring common code.
20579 (Fformat_time_string, Fdecode_time, Fencode_time):
20580 (Fcurrent_time_string): Use it.
20581
20582 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20583 * dired.c (make_time): Move to ...
20584 * editfns.c (make_time): ... here.
20585 * systime.h: Note the move.
20586
20587 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20588
20589 * fringe.c (update_window_fringes): Remove unused variables.
20590
20591 * unexmacosx.c (copy_data_segment): Also copy __got section.
20592 (Bug#8223)
20593
20594 2011-03-12 Eli Zaretskii <eliz@gnu.org>
20595
20596 * termcap.c [MSDOS]: Include "msdos.h".
20597 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20598 Constify `char *' arguments and their references according to
20599 prototypes in tparam.h.
20600
20601 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20602
20603 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20604 Adapt all references accordingly.
20605
20606 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20607
20608 2011-03-11 Tom Tromey <tromey@redhat.com>
20609
20610 * buffer.c (syms_of_buffer): Remove obsolete comment.
20611
20612 2011-03-11 Eli Zaretskii <eliz@gnu.org>
20613
20614 * termhooks.h (encode_terminal_code): Declare prototype.
20615
20616 * msdos.c (encode_terminal_code): Don't declare prototype.
20617
20618 * term.c (encode_terminal_code): Now external again, used by
20619 w32console.c and msdos.c.
20620
20621 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20622 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20623
20624 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
20625
20626 Fix some minor problems found by GCC 4.5.2's static checks.
20627
20628 * fringe.c (update_window_fringes): Mark locals as initialized
20629 (Bug#8227).
20630 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20631
20632 * alloc.c (mark_fringe_data): Move decl from here ...
20633 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20634 to check its interface.
20635 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20636
20637 * fontset.c (free_realized_fontset): Now static.
20638 (Fset_fontset_font): Rename local to avoid shadowing.
20639 (fontset_font): Mark local as initialized.
20640 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20641
20642 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20643
20644 * xselect.c (x_disown_buffer_selections): Remove; not used.
20645 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20646 (x_own_selection, Fx_disown_selection_internal): Rename locals
20647 to avoid shadowing.
20648 (x_handle_dnd_message): Remove local to avoid shadowing.
20649
20650 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20651 so that the caller can use some name other than gcpro1.
20652 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20653 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20654 (Fx_backspace_delete_keys_p):
20655 Use them to avoid shadowing, and rename vars to avoid shadowing.
20656 (x_decode_color, x_set_name, x_window): Now static.
20657 (Fx_create_frame): Add braces to silence GCC warning.
20658 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20659 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20660 Remove unused locals.
20661 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20662 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20663 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20664 macros.
20665
20666 * xterm.h (x_mouse_leave): New decl.
20667
20668 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20669 Remove unused functions.
20670 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20671 (x_calc_absolute_position): Now static.
20672 (XTread_socket): Don't define label "out" unless it's used.
20673 Don't declare local "event" unless it's used.
20674 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20675 unless they are used.
20676 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20677 (x_fatal_error_signal): Remove; not used.
20678 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20679 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20680 (x_error_catcher, x_connection_closed, x_error_handler):
20681 (x_error_quitter, xembed_send_message, x_iconify_frame):
20682 (my_log_handler): Rename locals to avoid shadowing.
20683 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20684 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20685
20686 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20687 Rename or move locals to avoid shadowing.
20688 (tty_defined_color, merge_face_heights): Now static.
20689 (free_realized_faces_for_fontset): Remove; not used.
20690 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20691 does not deduce is never used uninitialized.
20692 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20693 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20694
20695 * terminal.c (store_terminal_param): Now static.
20696
20697 * xmenu.c (menu_highlight_callback): Now static.
20698 (set_frame_menubar): Remove unused local.
20699 (xmenu_show): Rename parameter to avoid shadowing.
20700 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20701 since they might point to immutable storage.
20702 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20703 since it's unused otherwise.
20704
20705 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20706 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20707 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20708 avoids a gcc -Wuninitialized diagnostic.
20709 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20710 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20711 does not deduce are never used uninitialized.
20712
20713 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20714
20715 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20716 * window.c (window_loop, size_window):
20717 (run_window_configuration_change_hook, enlarge_window): Likewise.
20718
20719 * window.c (display_buffer): Now static.
20720 (size_window): Mark variables that gcc -Wuninitialized
20721 does not deduce are never used uninitialized.
20722 * window.h (check_all_windows): New decl, to forestall
20723 gcc -Wmissing-prototypes diagnostic.
20724 * dispextern.h (bidi_dump_cached_states): Likewise.
20725
20726 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20727 shadowing.
20728 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20729 Include <limits.h>.
20730 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20731 and to avoid gcc -Wuninitialized warning.
20732 (load_charset_map): Mark variables that gcc -Wuninitialized
20733 does not deduce are never used uninitialized.
20734 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20735
20736 * coding.c (coding_set_source, coding_set_destination):
20737 Use "else { /* comment */ }" rather than "else /* comment */;"
20738 for clarity, and to avoid gcc -Wempty-body warning.
20739 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20740 a block, when the outer 'i' will do.
20741 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20742 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20743 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20744 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20745 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20746 Rename locals to avoid shadowing.
20747 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20748 * coding.c (emacs_mule_char, encode_invocation_designation):
20749 Now static, since they're not used elsewhere.
20750 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20751 (decode_coding_object, encode_coding_object, detect_coding_system):
20752 (decode_coding_emacs_mule): Mark variables that gcc
20753 -Wuninitialized does not deduce are never used uninitialized.
20754 (detect_coding_iso_2022): Initialize a local variable that might
20755 be used uninitialized. Leave a FIXME because it's not clear that
20756 this initialization is needed. (Bug#8211)
20757 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20758 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20759 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20760 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20761 Remove unused macros.
20762
20763 * category.c (hash_get_category_set): Remove unused local var.
20764 (copy_category_table): Now static, since it's not used elsewhere.
20765 * character.c (string_count_byte8): Likewise.
20766
20767 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20768 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20769
20770 * chartab.c (copy_sub_char_table): Now static, since it's not used
20771 elsewhere.
20772 (sub_char_table_ref_and_range, char_table_ref_and_range):
20773 Rename locals to avoid shadowing.
20774 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20775
20776 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20777 (BIDI_BOB): Remove unused macro.
20778
20779 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20780 deduce are never used uninitialized.
20781 * term.c (encode_terminal_code): Likewise.
20782
20783 * term.c (encode_terminal_code): Now static. Remove unused local.
20784
20785 * tparam.h: New file.
20786 * term.c, tparam.h: Include it.
20787 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20788 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20789 Move these decls to tparam.h, and make them agree with what
20790 is actually in tparam.c. The previous trick of using incompatible
20791 decls in different modules does not conform to the C standard.
20792 All callers of tparam changed to use tparam's actual API.
20793 * tparam.c (tparam1, tparam, tgoto):
20794 Use const pointers where appropriate.
20795
20796 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20797 * cm.h (struct cm): Likewise.
20798 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20799 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20800 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20801 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20802 (turn_on_face, init_tty): Likewise.
20803 * termchar.h (struct tty_display_info): Likewise.
20804
20805 * term.c (term_mouse_position): Rename local to avoid shadowing.
20806
20807 * alloc.c (mark_ttys): Move decl from here ...
20808 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20809
20810 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20811
20812 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20813
20814 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20815
20816 * search.c (compile_pattern_1): Remove argument regp, unused since
20817 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20818 (compile_pattern): Don't pass it.
20819
20820 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20821
20822 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20823 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20824 for ! HAVE_GTK3.
20825 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20826
20827 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20828
20829 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20830 gdk_window_get_screen, gdk_window_get_geometry,
20831 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20832 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20833 (xg_get_pixbuf_from_pixmap): New function.
20834 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20835 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20836 Call xg_get_pixbuf_from_pixmap instead of
20837 gdk_pixbuf_get_from_drawable.
20838 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20839 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20840 (xg_check_special_colors): Use GtkStyleContext and its functions
20841 for HAVE_GTK3.
20842 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20843 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20844 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20845 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20846 Call gtk_widget_get_preferred_size.
20847 (xg_frame_resized): gdk_window_get_geometry only takes 5
20848 parameters.
20849 (xg_win_to_widget, xg_event_is_for_menubar):
20850 Call gdk_x11_window_lookup_for_display.
20851 (xg_set_widget_bg): New function.
20852 (delete_cb): New function.
20853 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20854 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20855 (xg_set_background_color): Call xg_set_widget_bg.
20856 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20857 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20858 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20859 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20860 if ! HAVE_GTK3.
20861 (update_frame_tool_bar): Call gtk_widget_hide.
20862 (xg_initialize): Use GDK_KEY_g.
20863
20864 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20865 if ! HAVE_GTK3
20866 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20867
20868 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20869 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20870 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20871
20872 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20873
20874 * w32xfns.c (select_palette): Check success of RealizePalette against
20875 GDI_ERROR, not zero.
20876
20877 See ChangeLog.11 for earlier changes.
20878
20879 ;; Local Variables:
20880 ;; coding: utf-8
20881 ;; End:
20882
20883 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20884
20885 This file is part of GNU Emacs.
20886
20887 GNU Emacs is free software: you can redistribute it and/or modify
20888 it under the terms of the GNU General Public License as published by
20889 the Free Software Foundation, either version 3 of the License, or
20890 (at your option) any later version.
20891
20892 GNU Emacs is distributed in the hope that it will be useful,
20893 but WITHOUT ANY WARRANTY; without even the implied warranty of
20894 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20895 GNU General Public License for more details.
20896
20897 You should have received a copy of the GNU General Public License
20898 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.